Skip to content

Commit

Permalink
Merge #908
Browse files Browse the repository at this point in the history
908: Apply NEP-29; add Python 3.7/3.8 r=hgrecco a=crusaderky

Closes #906 (pending agreement).
Closes #871.
Add formal support to Python 3.7 and 3.8.
Drop support for uncertainties versions more than 2 years old.
Actual code cleanup is out of scope and left to a later PR.

Co-authored-by: Guido Imperiale <crusaderky@gmail.com>
  • Loading branch information
bors[bot] and crusaderky authored Dec 3, 2019
2 parents cf05eb8 + 9ab8689 commit 5f89246
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 160 deletions.
7 changes: 0 additions & 7 deletions .travis-exclude.yml

This file was deleted.

106 changes: 0 additions & 106 deletions .travis-full.yml

This file was deleted.

67 changes: 33 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,40 @@ 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

- 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: pandas tests
# - PKGS="python=3.7 numpy pandas uncertainties pandas"

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 config --add channels conda-forge
- 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

Expand All @@ -46,24 +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 == 'Y' ]; then pip install 'uncertainties==2.4.7.1'; 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
- 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
Expand Down
2 changes: 1 addition & 1 deletion docs/getting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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_::

Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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`_.


Expand Down
2 changes: 1 addition & 1 deletion docs/serialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
)

0 comments on commit 5f89246

Please sign in to comment.