Skip to content

Commit

Permalink
Merge pull request #3027 from satra/enh/et
Browse files Browse the repository at this point in the history
enh: add telemetry to nipype
  • Loading branch information
mgxd committed Sep 16, 2019
2 parents 1689fe5 + 7e7568e commit e0aca32
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions nipype/__init__.py
Expand Up @@ -22,7 +22,9 @@

config = NipypeConfig()
logging = Logging(config)
logger = logging.getLogger('nipype.utils')

INIT_MSG = "Running {packname} version {version} (latest: {latest})".format

class NipypeTester(object):
def __call__(self, doctests=True, parallel=False):
Expand Down Expand Up @@ -56,3 +58,17 @@ def get_info():
from .pipeline import Node, MapNode, JoinNode, Workflow
from .interfaces import (DataGrabber, DataSink, SelectFiles, IdentityInterface,
Rename, Function, Select, Merge)


if config.getboolean('execution', 'check_version'):
import etelemetry

latest = {"version": 'Unknown'}
try:
latest = etelemetry.get_project("nipy/nipype")
except Exception as e:
logger.warning("Could not check for version updates: \n%s", e)
finally:
logger.info(INIT_MSG(packname='nipype',
version=__version__,
latest=latest["version"]))
3 changes: 2 additions & 1 deletion nipype/info.py
Expand Up @@ -164,7 +164,8 @@ def get_nipype_gitversion():
'scipy>=%s,<%s ; python_version <= "3.4"' % (SCIPY_MIN_VERSION, SCIPY_MAX_VERSION_34),
'simplejson>=%s' % SIMPLEJSON_MIN_VERSION,
'traits>=%s,!=5.0' % TRAITS_MIN_VERSION,
'filelock>=3.0.0'
'filelock>=3.0.0',
'etelemetry',
]

# neurdflib has to come after prov
Expand Down
1 change: 1 addition & 0 deletions nipype/utils/config.py
Expand Up @@ -68,6 +68,7 @@
parameterize_dirs = true
poll_sleep_duration = 2
xvfb_max_wait = 10
check_version = true
[monitoring]
enabled = false
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -17,3 +17,4 @@ scipy>=0.14
simplejson>=3.8.0
traits>=4.6
filelock>= 3.0.0
etelemetry

0 comments on commit e0aca32

Please sign in to comment.