From ec300a18efac907e648a413a98f81e89492ea6f2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 5 Oct 2018 11:14:14 -0400 Subject: [PATCH 01/10] ENH: enable debug session for appveyor --- appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 05510ec886..9d6450dea8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,3 +33,9 @@ test_script: - mkdir for_testing - cd for_testing - nosetests --with-doctest nibabel + + +on_finish: + # 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')) + From e5b16f9f3649be75ee9d5dc02de9eb43492d6b03 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 5 Oct 2018 11:14:52 -0400 Subject: [PATCH 02/10] TEMP: debug appveyor -- disable all the not interesting stuff --- .travis.yml | 153 --------------------------------------------------- appveyor.yml | 6 -- 2 files changed, 159 deletions(-) delete mode 100644 .travis.yml 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 9d6450dea8..6f25e88e71 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,16 +4,10 @@ environment: 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 From 1100222f2cbf66d70c2ca77e3d1daad0ee003ce4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 5 Oct 2018 14:39:59 -0400 Subject: [PATCH 03/10] ENH: output all environment variables right before running tests --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 6f25e88e71..334918d337 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,6 +26,8 @@ test_script: # Change into an innocuous directory and find tests from installation - mkdir for_testing - cd for_testing + # Show all environment variables to ease possible future debugging + - set - nosetests --with-doctest nibabel From 985e6f7e3d69a9b474da2817d5a6215edf62c5b9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 5 Oct 2018 14:40:22 -0400 Subject: [PATCH 04/10] RF: debug session only in the case of failure --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 334918d337..51328a6a9f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ test_script: - nosetests --with-doctest nibabel -on_finish: +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')) From 8507ed85f5cf1f251a4bce0433172f3ce5d43ac6 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Sat, 6 Oct 2018 07:28:35 -0400 Subject: [PATCH 05/10] CI: Use GCE build worker cloud Re-enable printing python, numpy versions Also disable RDP debugging for now --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 51328a6a9f..dcbdf816c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ # CI on Windows via appveyor environment: - + appveyor_build_worker_cloud: gce matrix: - PYTHON: C:\Python34 - PYTHON: C:\Python34-x64 @@ -26,6 +26,8 @@ test_script: # Change into an innocuous directory and find tests from installation - mkdir for_testing - cd for_testing + # 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 nibabel @@ -33,5 +35,5 @@ test_script: 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')) + # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 0a92a2a526f6193f695865bcdd7f55af892d5058 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 6 Oct 2018 10:22:41 -0400 Subject: [PATCH 06/10] MNT: Empty commit to trigger AppVeyor From a24404ba5428af2370ad3c71e7460d6cb7a226cb Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 6 Oct 2018 17:18:26 -0400 Subject: [PATCH 07/10] MNT: Empty commit to trigger AppVeyor From 955f9fceece63c993146ac2b69334ef8b20c1230 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 6 Oct 2018 17:18:42 -0400 Subject: [PATCH 08/10] MNT: Empty commit to trigger AppVeyor From c6353d25b185c81285c5c8fd771f85fd48c0f35c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 8 Oct 2018 15:01:07 -0400 Subject: [PATCH 09/10] TEMP: add printouts on IDs etc for one of the failures --- nibabel/__init__.py | 7 +++++++ nibabel/tests/test_minc1.py | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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']) From e82d96d97340337147a513c9556241376898565b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 8 Oct 2018 23:47:04 -0400 Subject: [PATCH 10/10] Make nosetests -s -v so we could see what is original dtype id and either more warnings etc --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index dcbdf816c8..b9feead1cd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,7 @@ test_script: - 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 nibabel + - nosetests --with-doctest -s -v nibabel on_failure: