From 01604e1d6726c2a524111714800fbabbbaf3b69f Mon Sep 17 00:00:00 2001 From: thequackdaddy Date: Sun, 28 Oct 2018 19:13:45 -0500 Subject: [PATCH 1/5] MAINT: Add python 3.7 testing --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fce4c2e..1eb295f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,10 +23,16 @@ matrix: env: PANDAS_VERSION_STR="NONE" - python: 2.7 env: PANDAS_VERSION_STR="NONE" + - python: 3.7 + sudo: true + dist: xenial + - python: 3.7 + sudo: true + dist: xenial + env: PANDAS_VERSION_STR="NONE" # This disables sudo, but makes builds start much faster # See http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ -sudo: false before_install: # Work around terrible pathological behaviour in OpenBLAS multithreading, that causes execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices - export OMP_NUM_THREADS=1 From 6328c7652e4d7fda9872a555d31658e54b7b0e6e Mon Sep 17 00:00:00 2001 From: thequackdaddy Date: Sun, 28 Oct 2018 19:38:08 -0500 Subject: [PATCH 2/5] MAINT: A few python 3.7 fixes --- .travis.yml | 1 + patsy/constraint.py | 5 ++++- tools/check-API-refs.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1eb295f..068aa48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ matrix: # This disables sudo, but makes builds start much faster # See http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ +sudo: false before_install: # Work around terrible pathological behaviour in OpenBLAS multithreading, that causes execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices - export OMP_NUM_THREADS=1 diff --git a/patsy/constraint.py b/patsy/constraint.py index ca9f6e2..d710a94 100644 --- a/patsy/constraint.py +++ b/patsy/constraint.py @@ -10,7 +10,10 @@ __all__ = ["LinearConstraint"] import re -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping import six import numpy as np from patsy import PatsyError diff --git a/tools/check-API-refs.py b/tools/check-API-refs.py index 8e9e8a1..9349028 100644 --- a/tools/check-API-refs.py +++ b/tools/check-API-refs.py @@ -9,7 +9,7 @@ root = dirname(dirname(abspath(__file__))) patsy_ref = root + "/doc/API-reference.rst" -doc_re = re.compile("^\.\. (.*):: ([^\(]*)") +doc_re = re.compile("^\\.\\. (.*):: ([^\\(]*)") def _documented(rst_path): documented = set() for line in open(rst_path): From 4029bf2fd28aa6d11e10b32a345eb0ebbe6d6833 Mon Sep 17 00:00:00 2001 From: thequackdaddy Date: Mon, 29 Oct 2018 09:49:58 -0500 Subject: [PATCH 3/5] Maint: don't use travis python --- .travis.yml | 59 +++++++++++++++++++++++------------------ tools/check-API-refs.py | 7 +++-- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 068aa48..e19de49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,42 @@ -language: python -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 +language: none matrix: include: + - env: + - PYTHON_VERSION=2.7 + - env: + - PYTHON_VERSION=3.4 + - env: + - PYTHON_VERSION=3.5 + - env: + - PYTHON_VERSION=3.6 + - env: + - PYTHON_VERSION=3.7 # 0.14.0 is the last version with the old categorical system # libfortran=1.0 is needed to work around a bug in anaconda # (https://github.com/pydata/patsy/pull/83#issuecomment-206895923) - - python: 3.4 - env: PANDAS_VERSION_STR="=0.14.0 libgfortran=1.0" - - python: 2.7 - env: PANDAS_VERSION_STR="=0.14.0 libgfortran=1.0" + - env: + - PYTHON_VERSION=3.4 + - PANDAS_VERSION_STR="=0.14.0 libgfortran=1.0" + - env: + - PYTHON_VERSION=2.7 + - PANDAS_VERSION_STR="=0.14.0 libgfortran=1.0" # 0.18.0 has is_categorical_dtype in a different place than 0.19.0+ - - python: 3.4 - env: PANDAS_VERSION_STR="=0.18.0" - - python: 2.7 - env: PANDAS_VERSION_STR="=0.18.0" + - env: + - PYTHON_VERSION=3.4 + - PANDAS_VERSION_STR="=0.18.0" + - env: + - PYTHON_VERSION=2.7 + - PANDAS_VERSION_STR="=0.18.0" # make sure it works without pandas - - python: 3.6 - env: PANDAS_VERSION_STR="NONE" - - python: 2.7 - env: PANDAS_VERSION_STR="NONE" - - python: 3.7 - sudo: true - dist: xenial - - python: 3.7 - sudo: true - dist: xenial - env: PANDAS_VERSION_STR="NONE" + - env: + - PYTHON_VERSION=2.7 + - PANDAS_VERSION_STR="NONE" + - env: + - PYTHON_VERSION=3.6 + - PANDAS_VERSION_STR="NONE" + - env: + - PYTHON_VERSION=3.7 + - PANDAS_VERSION_STR="NONE" # This disables sudo, but makes builds start much faster # See http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ @@ -49,7 +56,7 @@ before_install: - conda info -a - export PKGS="numpy scipy coverage nose pip" - if [ "$PANDAS_VERSION_STR" != "NONE" ]; then export PKGS="${PKGS} pandas${PANDAS_VERSION_STR}"; fi - - conda create -q -n testenv python=$TRAVIS_PYTHON_VERSION ${PKGS} + - conda create -q -n testenv python=$PYTHON_VERSION ${PKGS} - source activate testenv install: - python setup.py sdist diff --git a/tools/check-API-refs.py b/tools/check-API-refs.py index 9349028..88f428f 100644 --- a/tools/check-API-refs.py +++ b/tools/check-API-refs.py @@ -9,7 +9,9 @@ root = dirname(dirname(abspath(__file__))) patsy_ref = root + "/doc/API-reference.rst" -doc_re = re.compile("^\\.\\. (.*):: ([^\\(]*)") +doc_re = re.compile(r"^\.\. (.*):: ([^\(]*)") + + def _documented(rst_path): documented = set() for line in open(rst_path): @@ -21,6 +23,7 @@ def _documented(rst_path): documented.add(symbol) return documented + try: import patsy except ImportError: @@ -28,7 +31,7 @@ def _documented(rst_path): import patsy documented = set(_documented(patsy_ref)) -#print(documented) +# print(documented) exported = set(patsy.__all__) missed = exported.difference(documented) extra = documented.difference(exported) From a9fa17c5eed9e1bea02fbf9d19fe1473fdee9841 Mon Sep 17 00:00:00 2001 From: thequackdaddy Date: Mon, 29 Oct 2018 09:52:03 -0500 Subject: [PATCH 4/5] Don't need to deactivate anything --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e19de49..ed014b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,8 +44,6 @@ sudo: false before_install: # Work around terrible pathological behaviour in OpenBLAS multithreading, that causes execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices - export OMP_NUM_THREADS=1 - # Escape Travis virtualenv - - deactivate # See: http://conda.pydata.org/docs/travis.html - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda From 18695036873293651e2794e26f8430787da0086d Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Mon, 29 Oct 2018 17:33:06 -0700 Subject: [PATCH 5/5] Fix language: key See: https://docs.travis-ci.com/user/languages/minimal-and-generic/ --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ed014b0..8c4d9db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: none +language: minimal matrix: include: - env: