Skip to content

Commit f6ef188

Browse files
authored
Update tool versions, setup trusted publishing. (#152)
1 parent c8f18fa commit f6ef188

8 files changed

+28
-32
lines changed

.github/workflows/checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- python-version: 3.13
1212
env:
1313
TOXENV: pylint
14-
- python-version: 3.12 # Keep in sync with .readthedocs.yml
14+
- python-version: 3.13 # Keep in sync with .readthedocs.yml
1515
env:
1616
TOXENV: docs
1717
- python-version: 3.13

.github/workflows/publish.yml

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
name: Publish
2-
on: [push]
2+
on:
3+
push:
4+
tags:
5+
- 'v[0-9]+.[0-9]+.[0-9]+'
36

47
jobs:
58
publish:
69
runs-on: ubuntu-latest
7-
if: startsWith(github.event.ref, 'refs/tags/')
10+
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/cssselect
14+
15+
permissions:
16+
id-token: write
817

918
steps:
1019
- uses: actions/checkout@v4
1120

12-
- name: Set up Python 3.13
21+
- name: Set up Python
1322
uses: actions/setup-python@v5
1423
with:
1524
python-version: 3.13
1625

17-
- name: Check Tag
18-
id: check-release-tag
26+
- name: Build
1927
run: |
20-
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then
21-
echo ::set-output name=release_tag::true
22-
fi
28+
python -m pip install --upgrade build
29+
python -m build
2330
2431
- name: Publish to PyPI
25-
if: steps.check-release-tag.outputs.release_tag == 'true'
26-
run: |
27-
pip install --upgrade setuptools wheel twine
28-
python setup.py sdist bdist_wheel
29-
export TWINE_USERNAME=__token__
30-
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
31-
twine upload dist/*
32+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.4
3+
rev: v0.9.10
44
hooks:
55
- id: ruff
66
args: [ --fix ]

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ sphinx:
44
configuration: docs/conf.py
55
fail_on_warning: true
66
build:
7-
os: ubuntu-22.04
7+
os: ubuntu-24.04
88
tools:
99
# For available versions, see:
1010
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
11-
python: "3.12" # Keep in sync with .github/workflows/checks.yml
11+
python: "3.13" # Keep in sync with .github/workflows/checks.yml
1212
python:
1313
install:
1414
- requirements: docs/requirements.txt

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include AUTHORS CHANGES LICENSE README.rst tox.ini .coveragerc cssselect/py.typed
1+
include AUTHORS CHANGES LICENSE README.rst tox.ini cssselect/py.typed
22
recursive-include docs *
33
recursive-include tests *
44
prune docs/_build

docs/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sphinx==7.2.6
2-
sphinx-rtd-theme==2.0.0
1+
sphinx==8.2.3
2+
sphinx-rtd-theme==3.0.2

pyproject.toml

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ exclude_also = [
1818
"if TYPE_CHECKING:",
1919
]
2020

21-
[tool.mypy]
22-
check_untyped_defs = true
23-
ignore_missing_imports = true
24-
no_warn_no_return = true
25-
2621
[tool.pylint.MASTER]
2722
persistent = "no"
2823
extension-pkg-allow-list = ["lxml"]

tox.ini

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ commands =
1616
[testenv:pylint]
1717
deps =
1818
{[testenv]deps}
19-
pylint==3.3.4
19+
pylint==3.3.5
2020
commands =
2121
pylint {posargs: cssselect setup.py tests docs}
2222

@@ -30,8 +30,8 @@ commands =
3030
[testenv:typing]
3131
deps =
3232
{[testenv]deps}
33-
mypy==1.14.1
34-
types-lxml==2024.12.13
33+
mypy==1.15.0
34+
types-lxml==2025.3.4
3535
commands =
3636
mypy --strict {posargs: cssselect tests}
3737

@@ -43,8 +43,8 @@ skip_install = true
4343
[testenv:twinecheck]
4444
basepython = python3
4545
deps =
46-
twine==5.1.1
47-
build==1.2.2
46+
twine==6.1.0
47+
build==1.2.2.post1
4848
commands =
4949
python -m build --sdist
5050
twine check dist/*

0 commit comments

Comments
 (0)