Skip to content

Commit

Permalink
Merge pull request #140 from thequackdaddy/py37
Browse files Browse the repository at this point in the history
TST: Add python 3.7 testing
  • Loading branch information
njsmith authored Oct 31, 2018
2 parents 80321a0 + 1869503 commit 4c613d0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 24 deletions.
54 changes: 33 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
language: minimal
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"
- 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/
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
Expand All @@ -42,7 +54,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
Expand Down
5 changes: 4 additions & 1 deletion patsy/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions tools/check-API-refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -21,14 +23,15 @@ def _documented(rst_path):
documented.add(symbol)
return documented


try:
import patsy
except ImportError:
sys.path.append(root)
import patsy

documented = set(_documented(patsy_ref))
#print(documented)
# print(documented)
exported = set(patsy.__all__)
missed = exported.difference(documented)
extra = documented.difference(exported)
Expand Down

0 comments on commit 4c613d0

Please sign in to comment.