Skip to content

Commit b4475d7

Browse files
authored
Merge pull request #302 from python-adaptive/test-py39
test tox with py39 on Github Actions CI
2 parents ae2ddf4 + fddcce8 commit b4475d7

File tree

7 files changed

+93
-105
lines changed

7 files changed

+93
-105
lines changed

.github/workflows/coverage.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: coverage
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up Python ${{ matrix.python-version }}
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.7
15+
- name: Install dependencies
16+
run: pip install tox codecov
17+
- name: Test with tox
18+
run: tox -e py37-alldeps,report
19+
- name: Upload test coverage
20+
run: codecov -t ${{ secrets.CODECOV_TOKEN }} -f .coverage.xml
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "python",
5+
"pattern": [
6+
{
7+
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
8+
"file": 1,
9+
"line": 2
10+
},
11+
{
12+
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
13+
"message": 2
14+
}
15+
]
16+
}
17+
]
18+
}

.github/workflows/pre-commit.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/[email protected]

.github/workflows/tox.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: tox
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
test:
10+
runs-on: ${{ matrix.platform }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
platform: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: [3.6, 3.7, 3.8, 3.9]
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Set Python version for tox
24+
run: echo "PY_VERSION=$(echo py${version//./})" >> $GITHUB_ENV
25+
shell: bash
26+
env:
27+
version: ${{ matrix.python-version }}
28+
- name: Register Python problem matcher
29+
run: echo "::add-matcher::.github/workflows/matchers/pytest.json"
30+
- name: Install dependencies
31+
run: pip install tox pytest-github-actions-annotate-failures
32+
- name: Test with tox using minimal dependencies
33+
run: tox -e ${{ env.PY_VERSION }}-mindeps
34+
- name: Clean
35+
run: tox -e clean
36+
- name: Test with tox with all dependencies
37+
run: tox -e ${{ env.PY_VERSION }}-alldeps

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.3.0
3+
rev: v3.4.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -13,12 +13,12 @@ repos:
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/asottile/pyupgrade
16-
rev: v2.7.3
16+
rev: v2.10.0
1717
hooks:
1818
- id: pyupgrade
1919
args: ['--py36-plus']
2020
- repo: https://github.com/timothycrosley/isort
21-
rev: 5.6.4
21+
rev: 5.7.0
2222
hooks:
2323
- id: isort
2424
- repo: https://gitlab.com/pycqa/flake8

azure-pipelines.yml

-95
Original file line numberDiff line numberDiff line change
@@ -6,101 +6,6 @@ pr:
66
- "*"
77

88
jobs:
9-
- job: pytest
10-
strategy:
11-
# use cross-product when https://github.com/microsoft/azure-pipelines-yaml/issues/20 is solved
12-
matrix:
13-
UbuntuPy36:
14-
python.version: '3.6'
15-
vmImage: 'ubuntu-latest'
16-
tox_env: 'py36'
17-
UbuntuPy37:
18-
python.version: '3.7'
19-
vmImage: 'ubuntu-latest'
20-
tox_env: 'py37'
21-
UbuntuPy38:
22-
python.version: '3.8'
23-
vmImage: 'ubuntu-latest'
24-
tox_env: 'py38'
25-
26-
macOSPy36:
27-
python.version: '3.6'
28-
vmImage: 'macOS-latest'
29-
tox_env: 'py36'
30-
macOSPy37:
31-
python.version: '3.7'
32-
vmImage: 'macOS-latest'
33-
tox_env: 'py37'
34-
macOSPy38:
35-
python.version: '3.8'
36-
vmImage: 'macOS-latest'
37-
tox_env: 'py38'
38-
39-
WindowsServerPy36:
40-
python.version: '3.6'
41-
vmImage: 'vs2017-win2016'
42-
tox_env: 'py36'
43-
WindowsServerPy37:
44-
python.version: '3.7'
45-
vmImage: 'vs2017-win2016'
46-
tox_env: 'py37'
47-
WindowsServerPy38:
48-
python.version: '3.8'
49-
vmImage: 'vs2017-win2016'
50-
tox_env: 'py38'
51-
52-
WindowsPy36:
53-
python.version: '3.6'
54-
vmImage: 'windows-latest'
55-
tox_env: 'py36'
56-
WindowsPy37:
57-
python.version: '3.7'
58-
vmImage: 'windows-latest'
59-
tox_env: 'py37'
60-
WindowsPy38:
61-
python.version: '3.8'
62-
vmImage: 'windows-latest'
63-
tox_env: 'py38'
64-
65-
pool:
66-
vmImage: '$(vmImage)'
67-
steps:
68-
- task: UsePythonVersion@0
69-
inputs:
70-
versionSpec: '$(python.version)'
71-
- script: pip install tox
72-
displayName: Install tox
73-
- script: tox -e $(tox_env)-mindeps
74-
displayName: Run the tests with minimal dependencies
75-
- script: tox -e clean
76-
displayName: Clean
77-
- script: tox -e $(tox_env)-alldeps
78-
displayName: Run the tests
79-
80-
- job: coverage
81-
steps:
82-
- task: UsePythonVersion@0
83-
inputs:
84-
versionSpec: '3.7'
85-
- script: pip install tox
86-
displayName: Install tox
87-
- script: tox -e py37-alldeps,report
88-
displayName: Run the tests and generate coverage
89-
- script: |
90-
pip install codecov
91-
codecov -t $(CODECOV_TOKEN) -f .coverage.xml
92-
displayName: Test upload coverage
93-
94-
- job: pre_commit
95-
steps:
96-
- task: UsePythonVersion@0
97-
inputs:
98-
versionSpec: '3.7'
99-
- script: pip install tox
100-
displayName: Install tox
101-
- script: tox -e pre-commit
102-
displayName: Lining tests
103-
1049
- job: authors_check
10510
steps:
10611
- script: |

tox.ini

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
[tox]
32
isolated_build = True
4-
envlist = clean,py{36,37,38}-{mindeps,alldeps},report,pre-commit
3+
envlist = clean,py{36,37,38,39}-{mindeps,alldeps},report
54

65
[pytest]
76
testpaths = adaptive
@@ -47,11 +46,6 @@ deps = coverage
4746
skip_install = true
4847
commands = coverage erase
4948

50-
[testenv:pre-commit]
51-
skip_install = true
52-
deps = pre-commit
53-
commands = pre-commit run --all-files --show-diff-on-failure
54-
5549
[flake8]
5650
max-line-length = 100
5751
ignore = E501, W503, E203, E266, E741

0 commit comments

Comments
 (0)