From 77af519e5418a043f011824149db3adedbc3d9e5 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Fri, 3 Jul 2020 09:57:40 +0200 Subject: [PATCH 01/10] Remove pip from scripts and use only conda --- scripts/create_testenv.sh | 14 ++++---------- scripts/install_miniconda.sh | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 74f1ad31ad..bebf35cfd2 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -27,20 +27,14 @@ if [ -z ${GLOBAL} ]; then echo "Environment ${ENVNAME} already exists, keeping up to date" else conda create -n ${ENVNAME} --yes pip python=${PYTHON_VERSION} + conda config --add channels conda-forge + conda config --set channel_priority strict fi source activate ${ENVNAME} fi -pip install --upgrade pip -conda install --yes mkl-service -conda install --yes -c conda-forge python-graphviz - -# Travis env is unable to import cached mpl sometimes https://github.com/pymc-devs/pymc3/issues/3423 -pip install --no-cache-dir --force-reinstall -e . -pip install --no-cache-dir --force-reinstall -r requirements-dev.txt - -# Install untested, non-required code (linter fails without them) -pip install ipython ipywidgets +conda install --yes python-graphviz ipywidgets +conda install --yes --file requirements-dev.txt # Install editable using the setup.py if [ -z ${NO_SETUP} ]; then diff --git a/scripts/install_miniconda.sh b/scripts/install_miniconda.sh index b4035f4528..6db6f64934 100755 --- a/scripts/install_miniconda.sh +++ b/scripts/install_miniconda.sh @@ -46,5 +46,3 @@ fi export PATH="$INSTALL_FOLDER/bin:$PATH" echo "Adding $INSTALL_FOLDER to PATH. Consider adding it in your .rc file as well." conda update -q -y conda -# Uninstalling miniconda's numpy to avoid conflicting versions when creating the test env -pip uninstall -y numpy From a17c4d2551eee1c760ac913853fbdb8da782df78 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Fri, 3 Jul 2020 10:49:21 +0200 Subject: [PATCH 02/10] Remove dev dependency on black_nbconvert --- requirements-dev.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7544a31085..2e3b613fa0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -black_nbconvert bokeh>=0.12.13 coverage<5.0 graphviz>=0.8.3 From e1e78308eb825b5818b61824f2316baf83944a39 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Fri, 3 Jul 2020 11:40:02 +0200 Subject: [PATCH 03/10] Use requirements.txt in tests --- scripts/create_testenv.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index bebf35cfd2..cfb1bced81 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -35,6 +35,7 @@ fi conda install --yes python-graphviz ipywidgets conda install --yes --file requirements-dev.txt +conda install --yes --file requirements.txt # Install editable using the setup.py if [ -z ${NO_SETUP} ]; then From a97ee3ab5bf2f899d396125538fc79a9d047e338 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Fri, 3 Jul 2020 11:47:38 +0200 Subject: [PATCH 04/10] Add parameterized to dev requirements --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2e3b613fa0..d707d40e9e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -17,3 +17,4 @@ seaborn>=0.8.1 sphinx-autobuild==0.7.1 sphinx>=1.5.5 watermark +parameterized From cdf0efe7f6c487f3cf3f37e8dd984d99cbcb1d8f Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Sun, 5 Jul 2020 16:40:44 +0200 Subject: [PATCH 05/10] Add some py37 leftovers --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d707d40e9e..0565c4512a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ bokeh>=0.12.13 -coverage<5.0 +coverage>=5.1 graphviz>=0.8.3 ipython Keras>=2.0.8 From 8e38d0db11e4a7a922be3ffb438e71ecfa6419b4 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Sun, 5 Jul 2020 16:41:01 +0200 Subject: [PATCH 06/10] Update conda packages during travis tests --- scripts/create_testenv.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index cfb1bced81..2bc31f0f03 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -33,9 +33,10 @@ if [ -z ${GLOBAL} ]; then source activate ${ENVNAME} fi +conda update --yes --all conda install --yes python-graphviz ipywidgets -conda install --yes --file requirements-dev.txt conda install --yes --file requirements.txt +conda install --yes --file requirements-dev.txt # Install editable using the setup.py if [ -z ${NO_SETUP} ]; then From d311b21dcddfe54823e068fab413221c64e56638 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Sun, 5 Jul 2020 18:42:29 +0200 Subject: [PATCH 07/10] Remove Keras dependency --- pymc3/__init__.py | 6 ------ requirements-dev.txt | 1 - 2 files changed, 7 deletions(-) diff --git a/pymc3/__init__.py b/pymc3/__init__.py index 21ec7f3a59..ad47bbbfe2 100644 --- a/pymc3/__init__.py +++ b/pymc3/__init__.py @@ -27,12 +27,6 @@ handler = logging.StreamHandler() _log.addHandler(handler) -# Set start method to forkserver for MacOS to enable multiprocessing -# Closes issue https://github.com/pymc-devs/pymc3/issues/3849 -sys = platform.system() -if sys == "Darwin": - new_context = mp.get_context("forkserver") - def __set_compiler_flags(): # Workarounds for Theano compiler problems on various platforms diff --git a/requirements-dev.txt b/requirements-dev.txt index 0565c4512a..5ab4cd5cc7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,6 @@ bokeh>=0.12.13 coverage>=5.1 graphviz>=0.8.3 ipython -Keras>=2.0.8 nbsphinx>=0.4.2 nose>=1.3.7 nose-parameterized==0.6.0 From 1e9f8b0ec0b80467e59ecd223db41b388d36a08c Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Sun, 5 Jul 2020 20:29:52 +0200 Subject: [PATCH 08/10] Use conda to uninstall arviz for travis test --- .travis.yml | 2 +- pymc3/__init__.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6cad79c230..5d93859b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ jobs: stage: test install: - . ./scripts/create_testenv.sh - - pip uninstall arviz -y + - conda uninstall arviz -y # replace ArviZ with the lastest master - pip install git+git://github.com/arviz-devs/arviz.git - pip install codecov diff --git a/pymc3/__init__.py b/pymc3/__init__.py index ad47bbbfe2..21ec7f3a59 100644 --- a/pymc3/__init__.py +++ b/pymc3/__init__.py @@ -27,6 +27,12 @@ handler = logging.StreamHandler() _log.addHandler(handler) +# Set start method to forkserver for MacOS to enable multiprocessing +# Closes issue https://github.com/pymc-devs/pymc3/issues/3849 +sys = platform.system() +if sys == "Darwin": + new_context = mp.get_context("forkserver") + def __set_compiler_flags(): # Workarounds for Theano compiler problems on various platforms From b6b8e800839cff05a7b9cf4d0eaa9b59cc34d82c Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Mon, 6 Jul 2020 15:17:09 +0200 Subject: [PATCH 09/10] Install black_nbconvert in testenv --- scripts/create_testenv.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 2bc31f0f03..8a9eedee4c 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -37,6 +37,7 @@ conda update --yes --all conda install --yes python-graphviz ipywidgets conda install --yes --file requirements.txt conda install --yes --file requirements-dev.txt +pip install --no-cache-dir --force-reinstall black_nbconvert # Install editable using the setup.py if [ -z ${NO_SETUP} ]; then From 94a645a17e0e11c997753c450f6caedfec761238 Mon Sep 17 00:00:00 2001 From: Adrian Seyboldt Date: Tue, 7 Jul 2020 15:58:21 +0200 Subject: [PATCH 10/10] Use conda environmnent file for testenv --- environment-dev.yml | 40 +++++++++++++++++++++++++++++++++++++++ scripts/create_testenv.sh | 7 +------ 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 environment-dev.yml diff --git a/environment-dev.yml b/environment-dev.yml new file mode 100644 index 0000000000..aacffa1776 --- /dev/null +++ b/environment-dev.yml @@ -0,0 +1,40 @@ +name: testenv +channels: + - conda-forge + - defaults +dependencies: + - python=3.6 + - arviz>=0.9 + - theano>=1.0.4 + - numpy>=1.13 + - scipy>=0.18 + - pandas >=0.18 + - patsy>=0.5 + - fastprogress>=0.2 + - h5py>=2.7 + - typing-extensions>=3.7 + - bokeh>=0.12 + - coverage>=5.1 + - python-graphviz + - ipython>=7.16 + - nbsphinx>=0.4 + - nose>=1.3 + - nose-parameterized>=0.6 + - numpydoc>=0.9 + - pycodestyle>=2.3 + - pyflakes>=1.5 + - pylint>=1.7 + - pytest-cov>=2.5 + - pytest>=3.0 + - recommonmark>=0.4 + - seaborn>=0.8 + - sphinx-autobuild>=0.7 + - sphinx>=1.5 + - watermark + - parameterized + - black + - ipywidgets + - dataclasses # python_version < 3.7 + - contextvars # python_version < 3.7 + - pip: + - black_nbconvert diff --git a/scripts/create_testenv.sh b/scripts/create_testenv.sh index 8a9eedee4c..6b31af9ec3 100755 --- a/scripts/create_testenv.sh +++ b/scripts/create_testenv.sh @@ -20,24 +20,19 @@ command -v conda >/dev/null 2>&1 || { } ENVNAME="${ENVNAME:-testenv}" # if no ENVNAME is specified, use testenv -PYTHON_VERSION=${PYTHON_VERSION:-3.6} # if no python specified, use 3.6 if [ -z ${GLOBAL} ]; then if conda env list | grep -q ${ENVNAME}; then echo "Environment ${ENVNAME} already exists, keeping up to date" else - conda create -n ${ENVNAME} --yes pip python=${PYTHON_VERSION} conda config --add channels conda-forge conda config --set channel_priority strict + conda env create -f environment-dev.yml fi source activate ${ENVNAME} fi conda update --yes --all -conda install --yes python-graphviz ipywidgets -conda install --yes --file requirements.txt -conda install --yes --file requirements-dev.txt -pip install --no-cache-dir --force-reinstall black_nbconvert # Install editable using the setup.py if [ -z ${NO_SETUP} ]; then