Skip to content

Commit 23a17f3

Browse files
satraeffigies
authored andcommitted
enh: use new environment variable to suppress ET for nipype
1 parent 2e02a8a commit 23a17f3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

nipype/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def check_latest_version(raise_exception=False):
124124
if config.getboolean("execution", "check_version"):
125125
import __main__
126126

127-
if not hasattr(__main__, "__file__"):
127+
if not hasattr(__main__, "__file__") and "NO_NIPYPE_ET" in os.environ:
128128
from .interfaces.base import BaseInterface
129129

130130
if BaseInterface._etelemetry_version_data is None:

nipype/interfaces/base/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ class BaseInterface(Interface):
168168
def __init__(
169169
self, from_file=None, resource_monitor=None, ignore_exception=False, **inputs
170170
):
171-
if config.getboolean("execution", "check_version"):
171+
if (
172+
config.getboolean("execution", "check_version")
173+
and "NO_NIPYPE_ET" in os.environ
174+
):
172175
from ... import check_latest_version
173176

174177
if BaseInterface._etelemetry_version_data is None:

nipype/pipeline/plugins/tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ def create_pyscript(node, updatehash=False, store_exception=True):
126126
pass
127127
128128
import os
129-
os.environ['NO_ET'] = "1"
130-
129+
value = os.environ.get('NO_NIPYPE_ET', None)
130+
if value is None:
131+
os.environ['NO_NIPYPE_ET'] = "1"
131132
from nipype import config, logging
133+
if value is None:
134+
del os.environ['NO_NIPYPE_ET']
135+
132136
from nipype.utils.filemanip import loadpkl, savepkl
133137
from socket import gethostname
134138
from traceback import format_exception

0 commit comments

Comments
 (0)