Skip to content

Commit 54268be

Browse files
committed
Use GitHub Actions and RTD CI
1 parent 82b63f3 commit 54268be

File tree

7 files changed

+153
-150
lines changed

7 files changed

+153
-150
lines changed

.appveyor.yml

-28
This file was deleted.

.github/workflows/ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
Windows:
7+
name: 'Windows (${{ matrix.python }})'
8+
runs-on: 'windows-latest'
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python: ['3.7', '3.8', '3.9', '3.10']
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Setup python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python }}
21+
cache: pip
22+
cache-dependency-path: test-requirements.txt
23+
- name: Run tests
24+
run: ./ci.sh
25+
shell: bash
26+
env:
27+
# Should match 'name:' up above
28+
JOB_NAME: 'Windows (${{ matrix.python }})'
29+
30+
Ubuntu:
31+
name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
32+
timeout-minutes: 10
33+
runs-on: 'ubuntu-latest'
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
python: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
38+
check_formatting: ['0']
39+
extra_name: ['']
40+
include:
41+
- python: '3.10'
42+
check_formatting: '1'
43+
extra_name: ', check formatting'
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v2
47+
- name: Setup python
48+
uses: actions/setup-python@v2
49+
if: "!endsWith(matrix.python, '-dev')"
50+
with:
51+
python-version: ${{ matrix.python }}
52+
cache: pip
53+
cache-dependency-path: test-requirements.txt
54+
- name: Setup python (dev)
55+
uses: deadsnakes/[email protected]
56+
if: endsWith(matrix.python, '-dev')
57+
with:
58+
python-version: '${{ matrix.python }}'
59+
- name: Run tests
60+
run: ./ci.sh
61+
env:
62+
CHECK_FORMATTING: '${{ matrix.check_formatting }}'
63+
# Should match 'name:' up above
64+
JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})'
65+
66+
macOS:
67+
name: 'macOS (${{ matrix.python }})'
68+
timeout-minutes: 10
69+
runs-on: 'macos-latest'
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
python: ['3.7', '3.8', '3.9', '3.10']
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
- name: Setup python
78+
uses: actions/setup-python@v2
79+
with:
80+
python-version: ${{ matrix.python }}
81+
cache: pip
82+
cache-dependency-path: test-requirements.txt
83+
- name: Run tests
84+
run: ./ci.sh
85+
env:
86+
# Should match 'name:' up above
87+
JOB_NAME: 'macOS (${{ matrix.python }})'

.travis.yml

-17
This file was deleted.

ci.sh

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
YAPF_VERSION=0.20.1
6+
7+
pip install -U pip setuptools wheel
8+
9+
python setup.py sdist --formats=zip
10+
pip install dist/*.zip
11+
12+
if [ "$CHECK_FORMATTING" = "1" ]; then
13+
pip install yapf==${YAPF_VERSION} isort>=5
14+
if ! yapf -rpd setup.py src tests; then
15+
cat <<EOF
16+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18+
19+
Formatting problems were found (listed above). To fix them, run
20+
21+
pip install yapf==${YAPF_VERSION}
22+
yapf -rpi setup.py src tests
23+
24+
in your local checkout.
25+
26+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28+
EOF
29+
exit 1
30+
fi
31+
32+
# required for isort to order test imports correctly
33+
pip install -Ur test-requirements.txt
34+
35+
if ! isort --check-only --diff . ; then
36+
cat <<EOF
37+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39+
40+
Formatting problems were found (listed above). To fix them, run
41+
42+
pip install isort
43+
isort .
44+
45+
in your local checkout.
46+
47+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
48+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49+
EOF
50+
exit 1
51+
fi
52+
exit 0
53+
fi
54+
55+
# Actual tests
56+
pip install -Ur test-requirements.txt
57+
58+
pytest -W error -ra -v tests --cov --cov-config=.coveragerc
59+
60+
bash <(curl -s https://codecov.io/bash)

ci/travis.sh

-103
This file was deleted.

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ precision = 1
1818
exclude_lines =
1919
pragma: no cover
2020
abc.abstractmethod
21+
22+
[tool:pytest]
23+
asyncio_mode = strict

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
packages=find_packages('src'),
2727
package_dir={'': 'src'},
2828
install_requires=['attrs>=19.2.0'],
29-
python_requires='>=3.6',
29+
python_requires='>=3.7',
3030
keywords='result',
3131
classifiers=[
3232
'Development Status :: 5 - Production/Stable',
@@ -37,9 +37,10 @@
3737
'Operating System :: POSIX :: Linux',
3838
'Operating System :: MacOS :: MacOS X',
3939
'Operating System :: Microsoft :: Windows',
40-
'Programming Language :: Python :: 3.6',
4140
'Programming Language :: Python :: 3.7',
4241
'Programming Language :: Python :: 3.8',
42+
'Programming Language :: Python :: 3.9',
43+
'Programming Language :: Python :: 3.10',
4344
'Programming Language :: Python :: Implementation :: CPython',
4445
'Programming Language :: Python :: Implementation :: PyPy',
4546
],

0 commit comments

Comments
 (0)