From bbbb25981b3693bd106259067c317f09cfdf7c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Wed, 10 Jul 2019 16:05:49 -0700 Subject: [PATCH 1/9] dev: Fix pytest.raises message deprecation See https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises --- tests/eventseg/test_event.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/eventseg/test_event.py b/tests/eventseg/test_event.py index a82de27bd..133b54dd2 100644 --- a/tests/eventseg/test_event.py +++ b/tests/eventseg/test_event.py @@ -33,10 +33,12 @@ def test_fit_shapes(): "Segmentation from find_events not correctly normalized" es_invalid = EventSegment(K) - with pytest.raises(ValueError, message="T < K should cause error"): + with pytest.raises(ValueError): es_invalid.model_prior(K-1) - with pytest.raises(ValueError, message="#Events < K should cause error"): + pytest.fail("T < K should cause error") + with pytest.raises(ValueError): es_invalid.set_event_patterns(np.zeros((V, K-1))) + pytest.fail("#Events < K should cause error") def test_simple_boundary(): @@ -60,11 +62,13 @@ def test_event_transfer(): es = EventSegment(2) sample_data = np.asarray([[1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1]]) - with pytest.raises(NotFittedError, message="Should need to set variance"): + with pytest.raises(NotFittedError): seg = es.find_events(sample_data.T)[0] + pytest.fail("Should need to set variance") - with pytest.raises(NotFittedError, message="Should need to set patterns"): + with pytest.raises(NotFittedError): seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0] + pytest.fail("Should need to set patterns") es.set_event_patterns(np.asarray([[1, 0], [0, 1]])) seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0] From 5bee2c3ebfe2ab8822e10476983cf0ed101f9f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 5 Aug 2019 11:29:52 -0700 Subject: [PATCH 2/9] Pin NumPy <1.17 as workaround for random bug --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3b6f1120a..684b2769e 100644 --- a/setup.py +++ b/setup.py @@ -126,7 +126,8 @@ def finalize_options(self): # https://travis-ci.org/brainiak/brainiak/jobs/545838666 'mpi4py>=3', 'nitime', - 'numpy', + # https://github.com/numpy/numpy/issues/14189 + 'numpy<1.17', 'scikit-learn[alldeps]>=0.18', # See https://github.com/scipy/scipy/pull/8082 # and https://github.com/pymanopt/pymanopt/issues/77 From 00a85a43b50dbe07c62c55234b7ba8d37a8d476c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 5 Aug 2019 13:46:54 -0700 Subject: [PATCH 3/9] Pin SciPy in Jenkins customization --- .conda/bin/jenkins-server-customization | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conda/bin/jenkins-server-customization b/.conda/bin/jenkins-server-customization index d3e3cb223..fc5250d57 100644 --- a/.conda/bin/jenkins-server-customization +++ b/.conda/bin/jenkins-server-customization @@ -1,5 +1,5 @@ # This Bash script must be sourced, not executed # Customizations required for the server that currently runs Jenkins -conda install --yes mpi4py tensorflow +conda install --yes mpi4py tensorflow scipy\<1.3 module unload gcc From 3b4f5465299ca6f54d233739d4153309e1d3809a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 5 Aug 2019 14:41:19 -0700 Subject: [PATCH 4/9] Update minimum MacOS version to 10.9 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 684b2769e..a84083170 100644 --- a/setup.py +++ b/setup.py @@ -82,7 +82,7 @@ class BuildExt(build_ext): c_opts['unix'] += ['-lirc', '-lintlc'] if sys.platform == 'darwin': - c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7', + c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.9', '-ftemplate-depth-1024'] def build_extensions(self): From b8ad451f734f400ad689e1185b5a68b2518804ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 5 Aug 2019 15:35:16 -0700 Subject: [PATCH 5/9] Test all branches --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c7b6d7bd..79a789458 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,3 @@ -branches: - only: - - master - matrix: include: - os: linux From a84704ad77718ffbf5a03660bd26231eedf5bee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Tue, 6 Aug 2019 09:23:21 -0700 Subject: [PATCH 6/9] Use default Xcode --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 79a789458..ccfafee97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,6 @@ matrix: script: ./.conda/bin/build - os: osx - osx_image: xcode8 install: ./.conda/bin/install-miniconda script: ./.conda/bin/build From 906b502ccdc635fe3ff7e8850b4038a6887dc8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 12 Aug 2019 10:27:19 -0700 Subject: [PATCH 7/9] Set MacOS SDK path for conda-build --- .conda/bin/build | 8 +++++++- .conda/build.sh | 8 -------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.conda/bin/build b/.conda/bin/build index b96392864..f59f32c5b 100755 --- a/.conda/bin/build +++ b/.conda/bin/build @@ -21,4 +21,10 @@ then CONDA_HOME="$HOME"/miniconda3 fi -"$CONDA_HOME"/bin/conda build --python=$python_version "$DIR"/.. +if [ $(which xcrun) ] +then + sdk_path=$(xcrun --show-sdk-path) + variants="--variants {'CONDA_BUILD_SYSROOT': ['${sdk_path}']}" +fi + +"$CONDA_HOME"/bin/conda build --python=$python_version $variants "$DIR"/.. diff --git a/.conda/build.sh b/.conda/build.sh index 3f1175f91..c2a562cbf 100755 --- a/.conda/build.sh +++ b/.conda/build.sh @@ -1,13 +1,5 @@ #!/bin/bash -if [[ "$OSTYPE" == "darwin"* ]]; then - export MACOSX_DEPLOYMENT_TARGET=10.9 - export CC=$(which clang) - export CXX=$(which clang++) -fi - -echo $PREFIX - # Install pymanopt via pip because there isn't a conda package PIP_NO_INDEX=False $PYTHON -m pip install pymanopt From aaea251f7c61091a8c6449022b5fd8b1b9ee9ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Mon, 12 Aug 2019 10:50:50 -0700 Subject: [PATCH 8/9] Quote shell variable --- .conda/bin/build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.conda/bin/build b/.conda/bin/build index f59f32c5b..4171700db 100755 --- a/.conda/bin/build +++ b/.conda/bin/build @@ -24,7 +24,9 @@ fi if [ $(which xcrun) ] then sdk_path=$(xcrun --show-sdk-path) - variants="--variants {'CONDA_BUILD_SYSROOT': ['${sdk_path}']}" + variants_prefix="--variants" + variants="{'CONDA_BUILD_SYSROOT': ['${sdk_path}']}" fi -"$CONDA_HOME"/bin/conda build --python=$python_version $variants "$DIR"/.. +"$CONDA_HOME"/bin/conda build --python=$python_version \ + "$variants_prefix" "$variants" "$DIR"/.. From c3260992282c5dfa38c10633affaf489e35de010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Wed, 14 Aug 2019 13:32:54 -0700 Subject: [PATCH 9/9] Explain Pytest code pattern --- tests/eventseg/test_event.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/eventseg/test_event.py b/tests/eventseg/test_event.py index 133b54dd2..56106014b 100644 --- a/tests/eventseg/test_event.py +++ b/tests/eventseg/test_event.py @@ -35,6 +35,7 @@ def test_fit_shapes(): es_invalid = EventSegment(K) with pytest.raises(ValueError): es_invalid.model_prior(K-1) + # ``with`` block is about to end with no error. pytest.fail("T < K should cause error") with pytest.raises(ValueError): es_invalid.set_event_patterns(np.zeros((V, K-1)))