From 64701ef5b6268ce92e120151d248909fc8b81d1b Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 11:26:56 +0000 Subject: [PATCH 1/7] Apply NEP-29. Drop uncertainties < 3.0. Add support for Python 3.7 and 3.8. --- .travis.yml | 47 +++++++++++++++++++++++++++--------------- docs/getting.rst | 2 +- docs/index.rst | 5 +---- docs/serialization.rst | 2 +- setup.py | 13 ++++++------ 5 files changed, 39 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 844277492..35ddb766a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,21 +7,35 @@ branches: - trying.tmp env: - # Should pandas tests be removed or replaced wih import checks? - #- UNCERTAINTIES="N" PYTHON="3.6" NUMPY_VERSION=1.14 PANDAS=1 - - UNCERTAINTIES="N" PYTHON="3.3" NUMPY_VERSION=1.9.2 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.4" NUMPY_VERSION=1.11.2 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.5" NUMPY_VERSION=1.11.2 PANDAS=0 - - UNCERTAINTIES="Y" PYTHON="3.5" NUMPY_VERSION=1.11.2 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.6" NUMPY_VERSION=1.11.2 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=0 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.5" NUMPY_VERSION=0 PANDAS=0 - # Test with the latest numpy version - - UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=1.14 PANDAS=0 - #- UNCERTAINTIES="N" PYTHON="3.4" NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.5" NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES="Y" PYTHON="3.5" NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES="N" PYTHON="3.6" NUMPY_VERSION=1.14 PANDAS=0 + # This project adheres to NEP-29 + # https://numpy.org/neps/nep-0029-deprecation_policy.html + + # Refer to https://docs.scipy.org/doc/numpy/release.html for + # min/max Python version supported by numpy + # Refer to history of https://github.com/lebigot/uncertainties/blob/master/setup.py + # for min/max Python versions supported by uncertainties + # At the moment of writing, uncertainties doesn't officially support Python 3.8 + + # Without numpy, without uncertainties + - UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=0 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.7 NUMPY_VERSION=0 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.8 NUMPY_VERSION=0 PANDAS=0 + # Without numpy, min version of uncertainties + - UNCERTAINTIES=3.0 PYTHON=3.6 NUMPY_VERSION=0 PANDAS=0 + - UNCERTAINTIES=3.0 PYTHON=3.7 NUMPY_VERSION=0 PANDAS=0 + # Min version of numpy, without uncertainties + - UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.7 NUMPY_VERSION=1.14 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.8 NUMPY_VERSION=1.17 PANDAS=0 + # Min version of numpy, min version of uncertainties + - UNCERTAINTIES=3.0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=0 + - UNCERTAINTIES=3.0 PYTHON=3.7 NUMPY_VERSION=1.14 PANDAS=0 + # Latest versions of numpy and uncertainties (where different from the minimum ones) + - UNCERTAINTIES=3.1 PYTHON=3.6 NUMPY_VERSION=1.17 PANDAS=0 + - UNCERTAINTIES=3.1 PYTHON=3.7 NUMPY_VERSION=1.17 PANDAS=0 + + # TODO: Should pandas tests be removed or replaced wih import checks? + #- UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=1 before_install: - sudo apt-get update @@ -51,9 +65,8 @@ before_install: install: - conda create --yes -n $ENV_NAME python=$PYTHON pip - source activate $ENV_NAME - - if [ $UNCERTAINTIES == 'Y' ]; then pip install 'uncertainties==2.4.7.1'; fi + - if [ $UNCERTAINTIES != '0' ]; then pip install uncertainties==$UNCERTAINTIES; fi - if [ $NUMPY_VERSION != '0' ]; then conda install --yes numpy==$NUMPY_VERSION; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.5' && $NUMPY_VERSION == 1.11.2 && $UNCERTAINTIES == "Y" ]]; then pip install babel serialize pyyaml; fi # this is superslow but suck it up until updates to pandas are made - if [[ $PANDAS == '1' ]]; then pip install numpy cython pytest pytest-cov nbval; pip install git+https://github.com/pandas-dev/pandas.git@bdb7a1603f1e0948ca0cab011987f616e7296167; python -c 'import pandas; print(pandas.__version__)'; fi - pip install coveralls diff --git a/docs/getting.rst b/docs/getting.rst index 939b4b49d..db3b2ebf9 100644 --- a/docs/getting.rst +++ b/docs/getting.rst @@ -3,7 +3,7 @@ Installation ============ -Pint has no dependencies except Python_ itself. In runs on Python 2.7 and 3.3+. +Pint has no dependencies except Python_ itself. In runs on Python 3.6+. You can install it (or upgrade to the latest version) using pip_:: diff --git a/docs/index.rst b/docs/index.rst index b6eac5dba..bb76a7249 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ Due to its modular design, you can extend (or even rewrite!) the complete list without changing the source code. It supports a lot of numpy mathematical operations **without monkey patching or wrapping numpy**. -It has a complete test coverage. It runs in Python 2.7 and 3.3+ with no other +It has a complete test coverage. It runs in Python 3.6+ with no other dependency. It is licensed under BSD. @@ -99,9 +99,6 @@ points, like positions on a map or absolute temperature scales. **Dependency free**: it depends only on Python and its standard library. -**Python 2 and 3**: a single codebase that runs unchanged in Python 2.7+ and -Python 3.3+. - **Pandas integration**: Thanks to `Pandas Extension Types`_ it is now possible to use Pint with Pandas. Operations on DataFrames and between columns are units aware, providing even more convenience for users of Pandas DataFrames. For full details, see the `pint-pandas Jupyter notebook`_. diff --git a/docs/serialization.rst b/docs/serialization.rst index fe09f9d8e..1ebd24552 100644 --- a/docs/serialization.rst +++ b/docs/serialization.rst @@ -109,7 +109,7 @@ Using the serialize_ package you can load and read from multiple formats: .. _Pickle: http://docs.python.org/3/library/pickle.html .. _json: http://docs.python.org/3/library/json.html .. _yaml: http://pyyaml.org/ -.. _shelve: http://docs.python.org/3.4/library/shelve.html +.. _shelve: http://docs.python.org/3.6/library/shelve.html .. _hdf5: http://www.h5py.org/ .. _PyTables: http://www.pytables.org .. _dill: https://pypi.python.org/pypi/dill diff --git a/setup.py b/setup.py index a6d83d6fc..478177c31 100644 --- a/setup.py +++ b/setup.py @@ -56,14 +56,13 @@ def read(filename): 'Programming Language :: Python', 'Topic :: Scientific/Engineering', 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], + python_requires='>=3.6', extras_require={ - ':python_version == "2.7"': [ - 'funcsigs', - ], + 'numpy': ['numpy >= 1.14'], + 'uncertainties': ['uncertainties >= 3.0'], }, ) From 93df6c460178b741048a3f5c3a621b487de9ea5d Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 11:32:37 +0000 Subject: [PATCH 2/7] Remove Python 2.7 specific code --- .travis.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35ddb766a..9954df204 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,19 +39,12 @@ env: before_install: - sudo apt-get update - - if [[ "$PYTHON" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no - conda update -q conda - - if [[ "$PYTHON" != "2.7" ]]; then - conda config --set restore_free_channel yes; - fi # Useful for debugging any issues with conda - conda info -a From 6fb06116f0f2a4fe0aadd4ceec8a503a9178237a Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 11:47:22 +0000 Subject: [PATCH 3/7] Unbound max versions --- .travis.yml | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9954df204..2c54716da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,29 +17,29 @@ env: # At the moment of writing, uncertainties doesn't officially support Python 3.8 # Without numpy, without uncertainties - - UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=0 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.7 NUMPY_VERSION=0 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.8 NUMPY_VERSION=0 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.6 NUMPY=0 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.7 NUMPY=0 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.8 NUMPY=0 PANDAS=0 # Without numpy, min version of uncertainties - - UNCERTAINTIES=3.0 PYTHON=3.6 NUMPY_VERSION=0 PANDAS=0 - - UNCERTAINTIES=3.0 PYTHON=3.7 NUMPY_VERSION=0 PANDAS=0 + - UNCERTAINTIES=3.0.1 PYTHON=3.6 NUMPY=0 PANDAS=0 + - UNCERTAINTIES=3.0.1 PYTHON=3.7 NUMPY=0 PANDAS=0 # Min version of numpy, without uncertainties - - UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.7 NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.8 NUMPY_VERSION=1.17 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.6 NUMPY=1.14 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.7 NUMPY=1.14 PANDAS=0 + - UNCERTAINTIES=0 PYTHON=3.8 NUMPY=1.17 PANDAS=0 # Min version of numpy, min version of uncertainties - - UNCERTAINTIES=3.0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=0 - - UNCERTAINTIES=3.0 PYTHON=3.7 NUMPY_VERSION=1.14 PANDAS=0 + - UNCERTAINTIES=3.0.1 PYTHON=3.6 NUMPY=1.14 PANDAS=0 + - UNCERTAINTIES=3.0.1 PYTHON=3.7 NUMPY=1.14 PANDAS=0 # Latest versions of numpy and uncertainties (where different from the minimum ones) - - UNCERTAINTIES=3.1 PYTHON=3.6 NUMPY_VERSION=1.17 PANDAS=0 - - UNCERTAINTIES=3.1 PYTHON=3.7 NUMPY_VERSION=1.17 PANDAS=0 + - UNCERTAINTIES=999 PYTHON=3.6 NUMPY=999 PANDAS=0 + - UNCERTAINTIES=999 PYTHON=3.7 NUMPY=999 PANDAS=0 # TODO: Should pandas tests be removed or replaced wih import checks? - #- UNCERTAINTIES=0 PYTHON=3.6 NUMPY_VERSION=1.14 PANDAS=1 + #- UNCERTAINTIES=0 PYTHON=3.6 NUMPY=1.14 PANDAS=1 before_install: - sudo apt-get update - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r @@ -58,8 +58,10 @@ before_install: install: - conda create --yes -n $ENV_NAME python=$PYTHON pip - source activate $ENV_NAME - - if [ $UNCERTAINTIES != '0' ]; then pip install uncertainties==$UNCERTAINTIES; fi - - if [ $NUMPY_VERSION != '0' ]; then conda install --yes numpy==$NUMPY_VERSION; fi + - if [[ $UNCERTAINTIES != 0 && $UNCERTAINTIES < 999 ]]; then pip install uncertainties==$UNCERTAINTIES; fi + - if [[ $UNCERTAINTIES == 999 ]]; then pip install uncertainties; fi + - if [[ $NUMPY != 0 && $NUMPY < 999 ]; then conda install --yes numpy==$NUMPY; fi + - if [[ $NUMPY == "latest" ]; then conda install --yes numpy; fi # this is superslow but suck it up until updates to pandas are made - if [[ $PANDAS == '1' ]]; then pip install numpy cython pytest pytest-cov nbval; pip install git+https://github.com/pandas-dev/pandas.git@bdb7a1603f1e0948ca0cab011987f616e7296167; python -c 'import pandas; print(pandas.__version__)'; fi - pip install coveralls From 3f67922b953e3167f5c2417503347f9155881698 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 11:50:48 +0000 Subject: [PATCH 4/7] uncertainties on Python 3.8 --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2c54716da..b489892b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ env: # min/max Python version supported by numpy # Refer to history of https://github.com/lebigot/uncertainties/blob/master/setup.py # for min/max Python versions supported by uncertainties - # At the moment of writing, uncertainties doesn't officially support Python 3.8 # Without numpy, without uncertainties - UNCERTAINTIES=0 PYTHON=3.6 NUMPY=0 PANDAS=0 @@ -33,6 +32,9 @@ env: # Latest versions of numpy and uncertainties (where different from the minimum ones) - UNCERTAINTIES=999 PYTHON=3.6 NUMPY=999 PANDAS=0 - UNCERTAINTIES=999 PYTHON=3.7 NUMPY=999 PANDAS=0 + # At the moment of writing, uncertainties doesn't officially support Python 3.8 + # We're testing here at our own risk + - UNCERTAINTIES=999 PYTHON=3.8 NUMPY=999 PANDAS=0 # TODO: Should pandas tests be removed or replaced wih import checks? #- UNCERTAINTIES=0 PYTHON=3.6 NUMPY=1.14 PANDAS=1 From e38205401554efc31800405698f405351d570574 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 11:56:29 +0000 Subject: [PATCH 5/7] Bugfix --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b489892b3..b700eb065 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,8 +62,8 @@ install: - source activate $ENV_NAME - if [[ $UNCERTAINTIES != 0 && $UNCERTAINTIES < 999 ]]; then pip install uncertainties==$UNCERTAINTIES; fi - if [[ $UNCERTAINTIES == 999 ]]; then pip install uncertainties; fi - - if [[ $NUMPY != 0 && $NUMPY < 999 ]; then conda install --yes numpy==$NUMPY; fi - - if [[ $NUMPY == "latest" ]; then conda install --yes numpy; fi + - if [[ $NUMPY != 0 && $NUMPY < 999 ]]; then conda install --yes numpy==$NUMPY; fi + - if [[ $NUMPY == 999 ]]; then conda install --yes numpy; fi # this is superslow but suck it up until updates to pandas are made - if [[ $PANDAS == '1' ]]; then pip install numpy cython pytest pytest-cov nbval; pip install git+https://github.com/pandas-dev/pandas.git@bdb7a1603f1e0948ca0cab011987f616e7296167; python -c 'import pandas; print(pandas.__version__)'; fi - pip install coveralls From d7ddc1de4d13497471f0aee5d909b1637b4476c3 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 13:25:00 +0000 Subject: [PATCH 6/7] Remove unneeded files --- .travis-exclude.yml | 7 --- .travis-full.yml | 106 -------------------------------------------- 2 files changed, 113 deletions(-) delete mode 100644 .travis-exclude.yml delete mode 100644 .travis-full.yml diff --git a/.travis-exclude.yml b/.travis-exclude.yml deleted file mode 100644 index 372418dc7..000000000 --- a/.travis-exclude.yml +++ /dev/null @@ -1,7 +0,0 @@ -# This file is used to autogenerate the travis exclude matrix. -rules: - "3.5": "NUMPY_VERSION>=1.9.2" - "3.4": "NUMPY_VERSION>=1.8.1" - "3.3": "NUMPY_VERSION>=1.7.0,<=1.9.2" - "2.7": "NUMPY_VERSION>1.5.1" - diff --git a/.travis-full.yml b/.travis-full.yml deleted file mode 100644 index 9e9776f56..000000000 --- a/.travis-full.yml +++ /dev/null @@ -1,106 +0,0 @@ -language: python - -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" -env: - - UNCERTAINTIES="N" NUMPY_VERSION=0 - - UNCERTAINTIES="N" NUMPY_VERSION=1.6.2 - - UNCERTAINTIES="N" NUMPY_VERSION=1.7.1 - - UNCERTAINTIES="N" NUMPY_VERSION=1.8.2 - - UNCERTAINTIES="N" NUMPY_VERSION=1.9.3 - - UNCERTAINTIES="N" NUMPY_VERSION=1.10.4 - - UNCERTAINTIES="Y" NUMPY_VERSION=0 - - UNCERTAINTIES="Y" NUMPY_VERSION=1.6.2 - - UNCERTAINTIES="Y" NUMPY_VERSION=1.7.1 - - UNCERTAINTIES="Y" NUMPY_VERSION=1.8.2 - - UNCERTAINTIES="Y" NUMPY_VERSION=1.9.3 - - UNCERTAINTIES="Y" NUMPY_VERSION=1.10.4 - -branches: - only: - - master - - develop - -before_install: - - sudo apt-get update - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - # The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda - - sudo rm -rf /dev/shm - - sudo ln -s /run/shm /dev/shm - - - export ENV_NAME=travis - -install: - - conda create -c mwcraig --yes -n $ENV_NAME python=$TRAVIS_PYTHON_VERSION pip - - source activate $ENV_NAME - - if [ $UNCERTAINTIES == 'Y' ]; then pip install 'uncertainties==2.4.7.1'; fi - - if [ $NUMPY_VERSION != '0' ]; then conda install -c mwcraig --yes numpy==$NUMPY_VERSION; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.5' && $NUMPY_VERSION == 1.10.4 && $UNCERTAINTIES == "Y" ]]; then pip install serialize pyyaml; fi - - pip install coveralls - -script: - - python -bb -m coverage run -p --source=pint --omit="*test*","*compat*" setup.py test - - coverage combine - - coverage report -m - -after_success: - - coveralls --verbose - -matrix: - exclude: -# Do not edit after this line - - python: "3.5" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.8.2 - - python: "3.5" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.6.2 - - python: "3.5" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.8.2 - - python: "3.5" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.6.2 - - python: "3.5" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.7.1 - - python: "3.5" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.7.1 - - python: "3.4" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.6.2 - - python: "3.4" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.6.2 - - python: "3.4" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.7.1 - - python: "3.4" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.7.1 - - python: "3.3" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.6.2 - - python: "3.3" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.9.3 - - python: "3.3" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.10.4 - - python: "3.3" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.6.2 - - python: "3.3" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.9.3 - - python: "3.3" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.10.4 - - python: "2.6" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.9.3 - - python: "2.6" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.10.4 - - python: "2.6" - env: UNCERTAINTIES="Y" NUMPY_VERSION=1.9.3 - - python: "2.6" - env: UNCERTAINTIES="N" NUMPY_VERSION=1.10.4 From 9ab86896f73bc8ce492be863bc5961a1a06a496b Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Tue, 3 Dec 2019 13:44:47 +0000 Subject: [PATCH 7/7] Simplify travis CI --- .travis.yml | 57 +++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index b700eb065..ea25ab36c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,29 +15,22 @@ env: # Refer to history of https://github.com/lebigot/uncertainties/blob/master/setup.py # for min/max Python versions supported by uncertainties - # Without numpy, without uncertainties - - UNCERTAINTIES=0 PYTHON=3.6 NUMPY=0 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.7 NUMPY=0 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.8 NUMPY=0 PANDAS=0 - # Without numpy, min version of uncertainties - - UNCERTAINTIES=3.0.1 PYTHON=3.6 NUMPY=0 PANDAS=0 - - UNCERTAINTIES=3.0.1 PYTHON=3.7 NUMPY=0 PANDAS=0 - # Min version of numpy, without uncertainties - - UNCERTAINTIES=0 PYTHON=3.6 NUMPY=1.14 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.7 NUMPY=1.14 PANDAS=0 - - UNCERTAINTIES=0 PYTHON=3.8 NUMPY=1.17 PANDAS=0 - # Min version of numpy, min version of uncertainties - - UNCERTAINTIES=3.0.1 PYTHON=3.6 NUMPY=1.14 PANDAS=0 - - UNCERTAINTIES=3.0.1 PYTHON=3.7 NUMPY=1.14 PANDAS=0 - # Latest versions of numpy and uncertainties (where different from the minimum ones) - - UNCERTAINTIES=999 PYTHON=3.6 NUMPY=999 PANDAS=0 - - UNCERTAINTIES=999 PYTHON=3.7 NUMPY=999 PANDAS=0 - # At the moment of writing, uncertainties doesn't officially support Python 3.8 - # We're testing here at our own risk - - UNCERTAINTIES=999 PYTHON=3.8 NUMPY=999 PANDAS=0 + - PKGS="python=3.6" + - PKGS="python=3.7" + - PKGS="python=3.8" + - PKGS="python=3.6 uncertainties=3.0" + - PKGS="python=3.7 uncertainties=3.0" + - PKGS="python=3.6 numpy=1.14" + - PKGS="python=3.7 numpy=1.14" + - PKGS="python=3.8 numpy=1.17" + - PKGS="python=3.6 numpy=1.14 uncertainties=3.0" + - PKGS="python=3.7 numpy=1.14 uncertainties=3.0" + - PKGS="python=3.6 numpy uncertainties" + - PKGS="python=3.7 numpy uncertainties" + - PKGS="python=3.8 numpy uncertainties" - # TODO: Should pandas tests be removed or replaced wih import checks? - #- UNCERTAINTIES=0 PYTHON=3.6 NUMPY=1.14 PANDAS=1 + # TODO: pandas tests + # - PKGS="python=3.7 numpy pandas uncertainties pandas" before_install: - sudo apt-get update @@ -46,6 +39,7 @@ before_install: - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no + - conda config --add channels conda-forge - conda update -q conda # Useful for debugging any issues with conda - conda info -a @@ -55,25 +49,20 @@ before_install: # - sudo rm -rf /dev/shm # - sudo ln -s /run/shm /dev/shm - - export ENV_NAME=travis - install: - - conda create --yes -n $ENV_NAME python=$PYTHON pip - - source activate $ENV_NAME - - if [[ $UNCERTAINTIES != 0 && $UNCERTAINTIES < 999 ]]; then pip install uncertainties==$UNCERTAINTIES; fi - - if [[ $UNCERTAINTIES == 999 ]]; then pip install uncertainties; fi - - if [[ $NUMPY != 0 && $NUMPY < 999 ]]; then conda install --yes numpy==$NUMPY; fi - - if [[ $NUMPY == 999 ]]; then conda install --yes numpy; fi + - conda create -n travis $PKGS coveralls + - source activate travis + - if [[ $PKGS =~ pandas ]]; then PANDAS=1; else PANDAS=0; fi # this is superslow but suck it up until updates to pandas are made - - if [[ $PANDAS == '1' ]]; then pip install numpy cython pytest pytest-cov nbval; pip install git+https://github.com/pandas-dev/pandas.git@bdb7a1603f1e0948ca0cab011987f616e7296167; python -c 'import pandas; print(pandas.__version__)'; fi - - pip install coveralls + # - if [[ $PANDAS == '1' ]]; then pip install numpy cython pytest pytest-cov nbval; pip install git+https://github.com/pandas-dev/pandas.git@bdb7a1603f1e0948ca0cab011987f616e7296167; python -c 'import pandas; print(pandas.__version__)'; fi + - conda list script: # if we're doing the pandas tests and hence have pytest available, we can # simply use it to run all the tests - - if [[ $PANDAS == '1' ]]; then python -bb -m coverage run -p --source=pint --omit="*test*","*compat*" -m py.test -rfsxEX; fi + # - if [[ $PANDAS == '1' ]]; then python -bb -m coverage run -p --source=pint --omit="*test*","*compat*" -m py.test -rfsxEX; fi # test notebooks too if pandas available - - if [[ $PANDAS == '1' ]]; then pip install -e .; pytest --nbval notebooks/*; fi + # - if [[ $PANDAS == '1' ]]; then pip install -e .; pytest --nbval notebooks/*; fi - if [[ $PANDAS == '0' ]]; then python -bb -m coverage run -p --source=pint --omit="*test*","*compat*","*pandas*" setup.py test; fi - coverage combine - coverage report -m