Skip to content

Commit 4ec7701

Browse files
authored
Cleanup and harden CI, add Python 3.15. (#86)
* Cleanup and harden CI, add Python 3.15. * Fix test expectations. * Mention the exception change in release notes.
1 parent 785e512 commit 4ec7701

14 files changed

Lines changed: 171 additions & 135 deletions

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+
cooldown:
12+
default-days: 7

.github/workflows/checks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Checks
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
12+
jobs:
13+
checks:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- python-version: 3.14
20+
env:
21+
TOXENV: mypy
22+
- python-version: 3.14
23+
env:
24+
TOXENV: twinecheck
25+
26+
steps:
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Run check
37+
env: ${{ matrix.env }}
38+
run: |
39+
pip install -U pip
40+
pip install -U tox
41+
tox
42+
43+
pre-commit:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
47+
with:
48+
persist-credentials: false
49+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.github/workflows/publish.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,50 @@
11
name: Publish
2+
3+
permissions:
4+
contents: read
5+
26
on:
37
push:
48
tags:
5-
- '[0-9]+.[0-9]+.[0-9]+'
9+
- "[0-9]+.[0-9]+.[0-9]+"
610

711
jobs:
12+
build:
13+
name: Build distribution
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
persist-credentials: false
19+
- name: Set up Python
20+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
21+
with:
22+
python-version: "3.14"
23+
- name: Install pypa/build
24+
run: python3 -m pip install build --user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
29+
with:
30+
name: python-package-distributions
31+
path: dist/
32+
833
publish:
34+
name: Publish to PyPI
35+
needs:
36+
- build
937
runs-on: ubuntu-latest
1038
environment:
1139
name: pypi
1240
url: https://pypi.org/p/protego
1341
permissions:
1442
id-token: write
1543
steps:
16-
- uses: actions/checkout@v6
17-
- uses: actions/setup-python@v6
18-
with:
19-
python-version: 3.14
20-
- run: |
21-
python -m pip install --upgrade build
22-
python -m build
23-
- name: Publish to PyPI
24-
uses: pypa/gh-action-pypi-publish@release/v1
44+
- name: Download all the dists
45+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution to PyPI
50+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

.github/workflows/tests-macos.yml

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

.github/workflows/tests-ubuntu.yml

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

.github/workflows/tests-windows.yml

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

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
12+
env:
13+
FORCE_COLOR: 1
14+
15+
jobs:
16+
tests:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15", "pypy3.11"]
22+
os: [windows-latest, macos-latest, ubuntu-latest]
23+
24+
steps:
25+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
allow-prereleases: true
34+
35+
- name: Run tests
36+
run: |
37+
pip install -U tox
38+
tox -e py
39+
40+
- name: Upload coverage report
41+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
42+
43+
- name: Upload test results
44+
if: ${{ !cancelled() }}
45+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
46+
with:
47+
report_type: test_results

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: tests/test_data
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.14.14
4+
rev: v0.16.4
55
hooks:
66
- id: ruff-check
77
args: [ --fix ]
@@ -12,6 +12,11 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
1414
- repo: https://github.com/rhysd/actionlint
15-
rev: v1.7.10
15+
rev: v1.7.12
1616
hooks:
1717
- id: actionlint
18+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
19+
rev: v1.29.0
20+
hooks:
21+
- id: zizmor
22+
args: [--no-progress, --fix]

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Protego changelog
33
=================
44

5+
0.x.x (unreleased)
6+
==================
7+
8+
- **Backward-incompatible:** ``Protego.parse()`` now raises a more suitable
9+
``TypeError`` instead of a ``ValueError`` when ``content`` is not a string.
10+
511
0.6.2 (2026-06-25)
612
==================
713

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.12",
2121
"Programming Language :: Python :: 3.13",
2222
"Programming Language :: Python :: 3.14",
23+
"Programming Language :: Python :: 3.15",
2324
"Programming Language :: Python :: Implementation :: CPython",
2425
"Programming Language :: Python :: Implementation :: PyPy",
2526
"Topic :: Internet :: WWW/HTTP",

0 commit comments

Comments
 (0)