Skip to content

Commit 66c733b

Browse files
Migrate to GitHub Actions from Travis CI.
1 parent b74b893 commit 66c733b

File tree

3 files changed

+116
-80
lines changed

3 files changed

+116
-80
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish tagged releases to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: '3.7'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install setuptools wheel twine
21+
- name: Build and publish
22+
env:
23+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
24+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
twine upload dist/*

.github/workflows/tox.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Run Tox Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
max-parallel: 4
13+
matrix:
14+
include:
15+
- python-version: 2.7
16+
- python-version: 3.4
17+
- python-version: 3.5
18+
- python-version: 3.6
19+
- python-version: 3.7
20+
# 0.14.0 is the last version with the old categorical system
21+
# libfortran=1.0 is needed to work around a bug in anaconda
22+
# (https://github.com/pydata/patsy/pull/83#issuecomment-206895923)
23+
- python-version: 2.7
24+
pandas-version-string: "=0.14.0 libgfortran=1.0"
25+
- python-version: 3.4
26+
pandas-version-string: "=0.14.0 libgfortran=1.0"
27+
# 0.18.0 has is_categorical_dtype in a different place than 0.19.0+
28+
- env:
29+
- python-version: 3.4
30+
- pandas-version-string: "=0.18.0"
31+
- env:
32+
- python-version: 2.7
33+
- pandas-version-string: "=0.18.0"
34+
# make sure it works without pandas
35+
- env:
36+
- python-version: 2.7
37+
- pandas-version-string: "NONE"
38+
- env:
39+
- python-version: 3.6
40+
- pandas-version-string: "NONE"
41+
- env:
42+
- python-version: 3.7
43+
- pandas-version-string: "NONE"
44+
env:
45+
PYTHON_VERSION: ${{ matrix.python-version }}
46+
PANDAS_VERSION_STR: ${{ matrix.pandas-version-string }}
47+
# 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
48+
OMP_NUM_THREADS: 1
49+
steps:
50+
- uses: actions/checkout@v1
51+
- name: Set up Miniconda environment for Python ${{ matrix.python-version }}
52+
uses: conda-incubator/setup-miniconda@v2
53+
with:
54+
miniforge-variant: Mambaforge
55+
activate-environment: patsy
56+
auto-update-conda: true
57+
channels: conda-forge
58+
channel-priority: flexible
59+
python-version: ${{ matrix.python-version }}
60+
- name: Install conda dependencies
61+
shell: bash -l {0}
62+
run: |
63+
export PKGS="numpy scipy coverage nose pip"
64+
if [ "$PANDAS_VERSION_STR" != "NONE" ]; then export PKGS="${PKGS} pandas${PANDAS_VERSION_STR}"; fi
65+
mamba install -y $PKGS
66+
- name: Install patsy
67+
shell: bash -l {0}
68+
run: |
69+
python setup.py sdist
70+
pip install dist/*
71+
- name: Run tests
72+
shell: bash -l {0}
73+
run: |
74+
mkdir empty
75+
cd empty
76+
INSTALLDIR=$(python -c "import os; import patsy; print(os.path.dirname(patsy.__file__))")
77+
export PYTHONWARNINGS=default PATSY_FORCE_NO_WARNINGS=1
78+
# The --exe is because python sometimes marks all installed modules
79+
# as executable, so without --exe nosetests will just ignore
80+
# everything. Baffling, but so it goes.
81+
coverage run --source=$INSTALLDIR --rcfile=../.coveragerc $(which nosetests) -vvv --nocapture --exe --failure-detail --all-modules $INSTALLDIR
82+
coverage report --rcfile=../.coveragerc --show-missing
83+
python ../tools/check-API-refs.py
84+
- name: Upload coverage to Codecov
85+
uses: codecov/codecov-action@v1.0.10
86+
with:
87+
file: ./coverage.xml
88+
flags: unittests
89+
env_vars: PYTHON_VERSION,PANDAS_VERSION_STR

.travis.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)