Skip to content

Commit

Permalink
Merge pull request #396 from nipreps/maint/rm-warnings-filter
Browse files Browse the repository at this point in the history
MAINT: Revisit warnings filter
  • Loading branch information
mgxd authored Sep 17, 2024
2 parents 8e2415f + 92b434e commit 9b149e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RUN micromamba create -y -f /tmp/env.yml && \
micromamba clean -y -a

ENV PATH="/opt/conda/envs/nibabies/bin:$PATH"
RUN npm install -g svgo@^3.2.0 bids-validator@^1.14.0 && \
RUN npm install -g svgo@^3.2.0 [email protected].10 && \
rm -r ~/.npm

# Main container
Expand Down
21 changes: 1 addition & 20 deletions nibabies/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
finally:
# Defer all custom import for after initializing the forkserver and
# ignoring the most annoying warnings
import logging
import random
import sys
from pathlib import Path
Expand All @@ -118,26 +119,6 @@

from . import __version__

if not hasattr(sys, '_is_pytest_session'):
sys._is_pytest_session = False # Trick to avoid sklearn's FutureWarnings
# Disable all warnings in main and children processes only on production versions
if not any(
(
'+' in __version__,
__version__.endswith('.dirty'),
os.getenv('NIBABIES_DEV', '0').lower() in ('1', 'on', 'true', 'y', 'yes'),
)
):
from ._warnings import logging

os.environ['PYTHONWARNINGS'] = 'ignore'
elif os.getenv('NIBABIES_WARNINGS', '0').lower() in ('1', 'on', 'true', 'y', 'yes'):
# allow disabling warnings on development versions
# https://github.com/nipreps/fmriprep/pull/2080#discussion_r409118765
from ._warnings import logging
else:
import logging

logging.addLevelName(25, 'IMPORTANT') # Add a new level between INFO and WARNING
logging.addLevelName(15, 'VERBOSE') # Add a new level between INFO and DEBUG

Expand Down

0 comments on commit 9b149e4

Please sign in to comment.