Skip to content

Commit dfb10ff

Browse files
committed
enh: do not import etelemetry or nipype just to ping an endpoint
1 parent 935f2e0 commit dfb10ff

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

fmriprep/config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
from templateflow import __version__ as _tf_ver
9292
from . import __version__
9393

94-
9594
if not hasattr(sys, "_is_pytest_session"):
9695
sys._is_pytest_session = False # Trick to avoid sklearn's FutureWarnings
9796
# Disable all warnings in main and children processes only on production versions
@@ -117,9 +116,11 @@
117116
# Ping NiPype eTelemetry once if env var was not set
118117
# workers on the pool will have the env variable set from the master process
119118
if _nipype_et is None:
120-
# check for latest version
121-
from nipype import check_latest_version
122-
check_latest_version()
119+
# Just get so analytics track one hit
120+
from contextlib import suppress
121+
from requests import get as _get_url, ConnectionError, ReadTimeout
122+
with suppress((ConnectionError, ReadTimeout)):
123+
_get_url("https://rig.mit.edu/et/projects/nipy/nipype", timeout=0.05)
123124

124125
# Execution environment
125126
_exec_env = os.name

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ install_requires =
3333
psutil >= 5.4
3434
pybids >= 0.10.2
3535
pyyaml
36+
requests
3637
sdcflows ~= 1.3.1
3738
smriprep ~= 0.6.1
3839
tedana >= 0.0.9a1, < 0.0.10

0 commit comments

Comments
 (0)