diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9a0d227fdf..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,153 +0,0 @@ -# vim ft=yaml -# Multiple lines can be made a single "virtual line" because of how Travis -# munges each line before executing it to print out the exit status. It's okay -# for it to be on multiple physical lines, so long as you remember: - There -# can't be any leading "-"s - All newlines will be removed, so use ";"s - -dist: xenial -sudo: true -language: python - -cache: - directories: - - $HOME/.cache/pip -env: - global: - - DEPENDS="six numpy scipy matplotlib h5py pillow pydicom hypothesis" - - OPTIONAL_DEPENDS="" - - INSTALL_TYPE="setup" - - EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com" - - PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" - - EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS" - - PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS" -python: - - 3.5 - - 3.6 - - 3.7 -matrix: - include: - - python: 3.4 - dist: trusty - sudo: false - - python: 2.7 - env: - - COVERAGE=1 - # Absolute minimum dependencies - - python: 2.7 - env: - - DEPENDS="numpy==1.7.1" - # Absolute minimum dependencies plus oldest MPL - # Check these against: - # nibabel/info.py - # doc/source/installation.rst - # requirements.txt - - python: 2.7 - env: - - DEPENDS="numpy==1.7.1 matplotlib==1.3.1" - # Minimum pydicom dependency - - python: 2.7 - env: - - DEPENDS="numpy==1.7.1 pydicom==0.9.9 pillow==2.6" - # pydicom master branch - - python: 3.5 - env: - - DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master" - # test 2.7 against pre-release builds of everything - - python: 2.7 - env: - - EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS" - # test 3.5 against pre-release builds of everything - - python: 3.5 - env: - - EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS" - # Documentation doctests - - python: 2.7 - env: - - DOC_DOC_TEST=1 - - python: 2.7 - env: - - INSTALL_TYPE=sdist - - python: 2.7 - env: - - INSTALL_TYPE=wheel - - python: 2.7 - env: - - INSTALL_TYPE=requirements - - python: 2.7 - env: - - STYLE=1 - - python: 3.5 - env: - - STYLE=1 - - python: 3.5 - env: - - DOC_DOC_TEST=1 - # Run tests with indexed_gzip present - - python: 2.7 - env: - - OPTIONAL_DEPENDS="indexed_gzip" - - python: 3.5 - env: - - OPTIONAL_DEPENDS="indexed_gzip" -before_install: - - source tools/travis_tools.sh - - python -m pip install --upgrade pip - - pip install --upgrade virtualenv - - virtualenv --python=python venv - - source venv/bin/activate - - python --version # just to check - - pip install -U pip wheel # needed at one point - - retry pip install nose flake8 mock hypothesis # always - - pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS - - if [ "${COVERAGE}" == "1" ]; then - pip install coverage; - pip install coveralls; - pip install codecov; - fi -# command to install dependencies -install: - - | - if [ "$INSTALL_TYPE" == "setup" ]; then - python setup.py install - elif [ "$INSTALL_TYPE" == "sdist" ]; then - python setup_egg.py egg_info # check egg_info while we're here - python setup_egg.py sdist - pip install $EXTRA_PIP_FLAGS dist/*.tar.gz - elif [ "$INSTALL_TYPE" == "wheel" ]; then - pip install wheel - python setup_egg.py bdist_wheel - pip install $EXTRA_PIP_FLAGS dist/*.whl - elif [ "$INSTALL_TYPE" == "requirements" ]; then - pip install $EXTRA_PIP_FLAGS -r requirements.txt - python setup.py install - fi - # Point to nibabel data directory - - export NIBABEL_DATA_DIR="$PWD/nibabel-data" -# command to run tests, e.g. python setup.py test -script: - - | - if [ "${STYLE}" == "1" ]; then - # Run styles only on core nibabel code. - flake8 nibabel - else - # Change into an innocuous directory and find tests from installation - mkdir for_testing - cd for_testing - if [ "${COVERAGE}" == "1" ]; then - cp ../.coveragerc .; - COVER_ARGS="--with-coverage --cover-package nibabel"; - fi - if [ "$DOC_DOC_TEST" == "1" ]; then - cd ../doc; - pip install -r ../doc-requirements.txt - make html; - make doctest; - else - nosetests --with-doctest $COVER_ARGS nibabel; - fi - fi -after_success: - - if [ "${COVERAGE}" == "1" ]; then coveralls; codecov; fi - -notifications: - webhooks: http://nipy.bic.berkeley.edu:54856/travis diff --git a/appveyor.yml b/appveyor.yml index 05510ec886..b9feead1cd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,18 +2,12 @@ # CI on Windows via appveyor environment: - + appveyor_build_worker_cloud: gce matrix: - - PYTHON: C:\Python27 - - PYTHON: C:\Python27-x64 - PYTHON: C:\Python34 - PYTHON: C:\Python34-x64 - PYTHON: C:\Python35 - PYTHON: C:\Python35-x64 - - PYTHON: C:\Python36 - - PYTHON: C:\Python36-x64 - - PYTHON: C:\Python37 - - PYTHON: C:\Python37-x64 install: # Prepend newly installed Python to the PATH of this build (this cannot be @@ -32,4 +26,14 @@ test_script: # Change into an innocuous directory and find tests from installation - mkdir for_testing - cd for_testing - - nosetests --with-doctest nibabel + # Print Python, numpy versions + - python -c "import sys, numpy; print('Python', sys.version); print('numpy', numpy.__version__)" + # Show all environment variables to ease possible future debugging + - set + - nosetests --with-doctest -s -v nibabel + + +on_failure: + # enable the next to let the build VM block for up to 60min to log in via RDP and debug + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + diff --git a/nibabel/__init__.py b/nibabel/__init__.py index 4c3c7ae55c..201c480b94 100644 --- a/nibabel/__init__.py +++ b/nibabel/__init__.py @@ -86,3 +86,10 @@ def test(*args, **kwargs): def get_info(): return _get_pkg_info(os.path.dirname(__file__)) + +def print_numpy_info(): + import numpy as np + print("NUMPY: ID(numpy): %d ID(numpy.float64): %d" % (id(np), id(np.float64))) + +def setup_package(): + print_numpy_info() \ No newline at end of file diff --git a/nibabel/tests/test_minc1.py b/nibabel/tests/test_minc1.py index cb59d921eb..5d6fb4ea80 100644 --- a/nibabel/tests/test_minc1.py +++ b/nibabel/tests/test_minc1.py @@ -7,6 +7,7 @@ # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## from __future__ import division, print_function, absolute_import +import sys from os.path import join as pjoin @@ -156,7 +157,17 @@ def test_mincfile(self): for tp in self.test_files: mnc_obj = self.opener(tp['fname'], 'r') mnc = self.file_class(mnc_obj) - assert_equal(mnc.get_data_dtype().type, tp['dtype']) + try: + assert_equal(mnc.get_data_dtype().type, tp['dtype']) + except AssertionError: + from nibabel import print_numpy_info + print() + for l, t in (('mnc.get_data_dtype().type', mnc.get_data_dtype().type), + ("tp['dtype']", tp['dtype'])): + print("%30s ID: %s, __module__: %s, id(sys[__module__]): %s" + % (l, id(t), t.__module__, id(sys.modules[t.__module__]))) + print_numpy_info() + raise assert_equal(mnc.get_data_shape(), tp['shape']) assert_equal(mnc.get_zooms(), tp['zooms']) assert_array_equal(mnc.get_affine(), tp['affine'])