Skip to content

Commit c7d684b

Browse files
authored
Test under Python 3.11, update CI workflow to latest versions of actions (lovasoa#220)
* Test under Python 3.11 * Do not set PYTHONWARNINGS=error during CI pytest That catches, e.g., deprecation warnings from any package (beyond our control). Note that we do configure a pytest warning filter in pyproject.toml which will generate errors for any warnings generated from within our code. * CI: update to actions/checkout@v3, actions/setup-python@v4, actions/cache@v3 * Hack installation of PyYAML on pypy Currently PyYAML fails to build with Cython 3.0.0a, thus it fails to install from sdist using `pip install --pre`. See yaml/pyyaml#601 * Update pre-commit plugin versions to latest
1 parent ee7e1cf commit c7d684b

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.github/workflows/python-package.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,35 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python_version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy3"]
14+
python_version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.9"]
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python_version }}
2222
- name: set pre-commit cache
23-
uses: actions/cache@v2
23+
uses: actions/cache@v3
2424
with:
2525
path: |
2626
~/.cache/pre-commit
2727
~/.cache/pip
2828
key: ${{ matrix.python_version }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('setup.py') }}
29+
30+
- name: Use latest pip
31+
run: python -m pip install --upgrade pip
32+
- name: Pre-install PyYAML without --pre
33+
if: ${{ startsWith(matrix.python_version, 'pypy') }}
34+
# Temporary workaround:
35+
# PyYAML fails to build with Cython 3.0.0a
36+
# see https://github.com/yaml/pyyaml/issues/601
37+
run: pip install PyYAML
2938
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install --pre -e '.[dev]'
39+
run: pip install --pre -e '.[dev]'
40+
3341
- name: Pre-commit hooks
3442
if: ${{ matrix.python_version != 'pypy3' && matrix.python_version != '3.6' }}
3543
run: pre-commit run --all-files
3644
- name: Test with pytest
3745
run: pytest
38-
env:
39-
PYTHONWARNINGS: error

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.0.0
3+
rev: v3.2.0
44
hooks:
55
- id: pyupgrade
66
args: ["--py36-plus"]
77
- repo: https://github.com/python/black
8-
rev: 22.8.0
8+
rev: 22.10.0
99
hooks:
1010
- id: black
1111
language_version: python3
1212
- repo: https://gitlab.com/pycqa/flake8
1313
rev: 5.0.4
1414
hooks:
1515
- id: flake8
16-
additional_dependencies: ['flake8-bugbear==22.9.23']
16+
additional_dependencies: ['flake8-bugbear==22.10.27']
1717
- repo: https://github.com/pre-commit/mirrors-mypy
1818
rev: v0.982
1919
hooks:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 88
3-
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
3+
target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py310']
44

55
[tool.pytest.ini_options]
66
filterwarnings = [

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"Programming Language :: Python :: 3.7",
1313
"Programming Language :: Python :: 3.8",
1414
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
1517
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
1618
]
1719

0 commit comments

Comments
 (0)