Skip to content

Commit 6ce56d6

Browse files
Simplify and unify CI and tox workflows.
1 parent 64b5eeb commit 6ce56d6

File tree

2 files changed

+22
-63
lines changed

2 files changed

+22
-63
lines changed

.github/workflows/tox.yml

Lines changed: 13 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,28 @@ jobs:
1111
strategy:
1212
max-parallel: 4
1313
matrix:
14-
include:
15-
- python-version: 3.6
16-
- python-version: 3.7
17-
- python-version: 3.8
18-
# make sure it works without pandas
19-
- python-version: 3.6
20-
pandas-version-string: "NONE"
21-
- python-version: 3.7
22-
pandas-version-string: "NONE"
23-
- python-version: 3.8
24-
pandas-version-string: "NONE"
14+
python-version: [3.6, 3.7, 3.8]
15+
pandas-presence: ['with_pandas', 'without_pandas']
2516
env:
2617
PYTHON_VERSION: ${{ matrix.python-version }}
27-
PANDAS_VERSION_STR: ${{ matrix.pandas-version-string }}
28-
# Work around terrible pathological behaviour in OpenBLAS/MKL/VML multithreading, that causes
29-
# execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices
30-
OMP_NUM_THREADS: 1
31-
MKL_NUM_THREADS: 1
32-
VML_NUM_THREADS: 1
18+
PANDAS_PRESENCE: ${{ matrix.pandas-presence }}
3319
steps:
3420
- uses: actions/checkout@v1
35-
- name: Set up Miniconda environment for Python ${{ matrix.python-version }}
36-
uses: conda-incubator/setup-miniconda@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
3723
with:
38-
miniforge-variant: Mambaforge
39-
activate-environment: patsy
40-
auto-update-conda: true
41-
channels: conda-forge
42-
channel-priority: flexible
4324
python-version: ${{ matrix.python-version }}
44-
- name: Install conda dependencies
45-
shell: bash -l {0}
25+
- name: Install dependencies
4626
run: |
47-
export PKGS="numpy scipy pytest pytest-cov pip"
48-
if [ "$PANDAS_VERSION_STR" != "NONE" ]; then export PKGS="${PKGS} pandas${PANDAS_VERSION_STR}"; fi
49-
mamba install -y $PKGS
50-
- name: Install patsy
51-
shell: bash -l {0}
27+
python -m pip install --upgrade pip
28+
pip install tox
29+
- name: Test with tox
5230
run: |
53-
python setup.py sdist
54-
pip install dist/*
55-
- name: Run tests
56-
shell: bash -l {0}
57-
run: |
58-
mkdir empty
59-
cd empty
60-
INSTALLDIR=$(python -c "import os; import patsy; print(os.path.dirname(patsy.__file__))")
61-
export PYTHONWARNINGS=default PATSY_FORCE_NO_WARNINGS=1
62-
pytest -vv -c ../setup.cfg --cov=$INSTALLDIR --cov-config=../.coveragerc --cov-report=term-missing --cov-report=xml $INSTALLDIR
63-
python ../tools/check-API-refs.py
31+
PYTHON_ENV="py${PYTHON_VERSION//./}"
32+
tox -e "${PYTHON_ENV}-${PANDAS_PRESENCE}"
6433
- name: Upload coverage to Codecov
6534
uses: codecov/codecov-action@v1.0.10
6635
with:
67-
file: ./empty/coverage.xml
36+
file: ./coverage.xml
6837
flags: unittests
69-
env_vars: PYTHON_VERSION,PANDAS_VERSION_STR
38+
env_vars: PYTHON_VERSION,PANDAS_PRESENCE

tox.ini

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
# We still support py24 and py25, but virtualenv and pip don't :-(
21
[tox]
3-
envlist = py26,py27,py31,py32,py33,py27-no-pandas,py32-no-pandas
2+
envlist = {py36,py37,py38}-{with_pandas,without_pandas}
43

54
[testenv]
6-
deps=.[test]
5+
deps=
6+
.[test]
7+
with_pandas: pandas
78
# Display all warnings, and error out on any warnings attributed to
89
# code in the patsy namespace (but not ones triggered by pytest, etc.):
910
setenv=
1011
PYTHONWARNINGS=default
1112
PATSY_FORCE_NO_WARNINGS=1
12-
changedir={envdir}
13+
# Work around terrible pathological behaviour in OpenBLAS/MKL/VML multithreading, that causes
14+
# execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices
15+
OMP_NUM_THREADS=1
16+
MKL_NUM_THREADS=1
17+
VML_NUM_THREADS=1
1318
commands=
14-
sh -c "[ \"x$NO_PANDAS\" = xTRUE ] || pip install pandas"
1519
pytest -vv --cov=patsy --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-report=xml --cov-report=html:{toxworkdir}/coverage/{envname} {posargs:}
1620
env PATSY_AVOID_OPTIONAL_DEPENDENCIES=1 pytest -vv --cov=patsy --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-report=xml --cov-report=html:{toxworkdir}/coverage/{envname} {posargs:}
1721
python {toxinidir}/tools/check-API-refs.py
18-
19-
[testenv:py32-no-pandas]
20-
basepython=python3.2
21-
setenv=
22-
PYTHONWARNINGS=default
23-
PATSY_FORCE_NO_WARNINGS=1
24-
NO_PANDAS=TRUE
25-
26-
[testenv:py27-no-pandas]
27-
basepython=python2.7
28-
setenv=
29-
PYTHONWARNINGS=default
30-
PATSY_FORCE_NO_WARNINGS=1
31-
NO_PANDAS=TRUE

0 commit comments

Comments
 (0)