Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Add python 3.7 testing #140

Merged
merged 5 commits into from Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 33 additions & 21 deletions .travis.yml
@@ -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
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
Expand Up @@ -9,7 +9,9 @@
root = dirname(dirname(abspath(__file__)))
patsy_ref = root + "/doc/API-reference.rst"

doc_re = re.compile("^\.\. (.*):: ([^\(]*)")
thequackdaddy marked this conversation as resolved.
Show resolved Hide resolved
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