Skip to content

Commit 982d440

Browse files
authored
Merge pull request #145 from digitronik/py39_gh_action
Py39 and workflows changes
2 parents 5bffb0f + 1c49e10 commit 982d440

8 files changed

Lines changed: 70 additions & 24 deletions

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
type: [ "opened", "reopened", "synchronize" ]
49

510
env:
611
FORCE_COLOR: 1
712

813
jobs:
914
build:
15+
name: pre-commit
1016
runs-on: ubuntu-latest
1117

1218
steps:
@@ -26,7 +32,7 @@ jobs:
2632
- name: Set up Python
2733
uses: actions/setup-python@v2
2834
with:
29-
python-version: 3.8
35+
python-version: '3.x'
3036

3137
- name: Install dependencies
3238
run: |

.github/workflows/test.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: Test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
type: [ "opened", "reopened", "synchronize" ]
49

510
env:
611
FORCE_COLOR: 1
712

813
jobs:
9-
build:
14+
tests:
15+
name: py-${{ matrix.python-version }}:pytest-${{ matrix.pytest-version }}
1016
runs-on: ubuntu-latest
1117
strategy:
1218
fail-fast: false
@@ -15,16 +21,17 @@ jobs:
1521
"3.6",
1622
"3.7",
1723
"3.8",
24+
"3.9",
1825
"pypy3",
1926
]
2027
pytest-version: [
21-
"5.0.1",
22-
"5.1.3",
23-
"5.2.4",
24-
"5.3.5",
25-
"5.4.3",
26-
"6.0.2",
27-
"6.1.1",
28+
"5.0.*",
29+
"5.1.*",
30+
"5.2.*",
31+
"5.3.*",
32+
"5.4.*",
33+
"6.0.*",
34+
"6.1.*",
2835
]
2936
steps:
3037
- uses: actions/checkout@v2
@@ -58,3 +65,30 @@ jobs:
5865
shell: bash
5966
run: |
6067
pytest
68+
69+
platform:
70+
# Test devel setup on different platforms.
71+
name: Platform-${{ matrix.os }}
72+
needs: [ tests ]
73+
runs-on: ${{ matrix.os }}
74+
strategy:
75+
matrix:
76+
os: [ubuntu-latest, windows-latest, macos-latest]
77+
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v2
80+
81+
- name: Setup python
82+
uses: actions/setup-python@v2
83+
with:
84+
python-version: '3.x'
85+
architecture: 'x64'
86+
87+
- name: Development setup on platform ${{ matrix.os }}
88+
run: |
89+
python -m pip install -U pip
90+
python -m pip install pytest
91+
python -m pip install -e .
92+
93+
- name: Tests
94+
run: pytest

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
repos:
33
- repo: https://github.com/psf/black
4-
rev: 19.10b0
4+
rev: 20.8b1
55
hooks:
66
- id: black
77
args: [--safe, --quiet, --target-version, py36]
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v3.1.0
9+
rev: v3.4.0
1010
hooks:
1111
- id: trailing-whitespace
1212
- id: end-of-file-fixer
@@ -16,18 +16,18 @@ repos:
1616
- id: debug-statements
1717
language_version: python3
1818
- repo: https://gitlab.com/pycqa/flake8
19-
rev: 3.8.3
19+
rev: 3.8.4
2020
hooks:
2121
- id: flake8
2222
language_version: python3
2323
additional_dependencies: [flake8-typing-imports==1.9.0]
2424
- repo: https://github.com/asottile/reorder_python_imports
25-
rev: v2.3.2
25+
rev: v2.3.6
2626
hooks:
2727
- id: reorder-python-imports
2828
args: ['--application-directories=.:src', --py3-plus]
2929
- repo: https://github.com/asottile/pyupgrade
30-
rev: v2.7.1
30+
rev: v2.7.4
3131
hooks:
3232
- id: pyupgrade
3333
args: [--py36-plus]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Requirements
1919

2020
You will need the following prerequisites in order to use pytest-rerunfailures:
2121

22-
- Python 3.6, up to 3.8, or PyPy3
22+
- Python 3.6, up to 3.9, or PyPy3
2323
- pytest 5.0 or newer
2424

2525
This package is currently tested against the last 5 minor pytest releases. In

pytest_rerunfailures.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,13 @@ def pytest_runtest_protocol(item, nextitem):
297297

298298

299299
def pytest_report_teststatus(report):
300-
"""Adapted from https://pytest.org/latest/_modules/_pytest/skipping.html
301-
"""
300+
"""Adapted from https://pytest.org/latest/_modules/_pytest/skipping.html"""
302301
if report.outcome == "rerun":
303302
return "rerun", "R", ("RERUN", {"yellow": True})
304303

305304

306305
def pytest_terminal_summary(terminalreporter):
307-
"""Adapted from https://pytest.org/latest/_modules/_pytest/skipping.html
308-
"""
306+
"""Adapted from https://pytest.org/latest/_modules/_pytest/skipping.html"""
309307
tr = terminalreporter
310308
if not tr.reportchars:
311309
return

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"Programming Language :: Python :: 3.6",
3434
"Programming Language :: Python :: 3.7",
3535
"Programming Language :: Python :: 3.8",
36+
"Programming Language :: Python :: 3.9",
3637
"Programming Language :: Python :: 3 :: Only",
3738
"Programming Language :: Python :: Implementation :: CPython",
3839
"Programming Language :: Python :: Implementation :: PyPy",

test_pytest_rerunfailures.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ def check_outcome_field(outcomes, field_name, expected_value):
3232

3333

3434
def assert_outcomes(
35-
result, passed=1, skipped=0, failed=0, error=0, xfailed=0, xpassed=0, rerun=0
35+
result,
36+
passed=1,
37+
skipped=0,
38+
failed=0,
39+
error=0,
40+
xfailed=0,
41+
xpassed=0,
42+
rerun=0,
3643
):
3744
outcomes = result.parseoutcomes()
3845
check_outcome_field(outcomes, "passed", passed)
@@ -324,7 +331,7 @@ def test_fail_two():
324331

325332
def test_rerun_on_setup_class_with_error_with_reruns(testdir):
326333
"""
327-
Case: setup_class throwing error on the first execution for parametrized test
334+
Case: setup_class throwing error on the first execution for parametrized test
328335
"""
329336
testdir.makepyfile(
330337
"""

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ max-line-length = 88
1111
[tox]
1212
envlist =
1313
linting
14-
py{36,37,38,py3}-pytest{50,51,52,53,54,60,61}
14+
py{36,37,38,39,py3}-pytest{50,51,52,53,54,60,61}
1515
minversion = 3.17.1
1616

1717
[testenv]

0 commit comments

Comments
 (0)