Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tool versions, setup trusted publishing. #152

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- python-version: 3.13
env:
TOXENV: pylint
- python-version: 3.12 # Keep in sync with .readthedocs.yml
- python-version: 3.13 # Keep in sync with .readthedocs.yml
env:
TOXENV: docs
- python-version: 3.13
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
name: Publish
on: [push]
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/')

environment:
name: pypi
url: https://pypi.org/p/cssselect

permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.13
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Check Tag
id: check-release-tag
- name: Build
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then
echo ::set-output name=release_tag::true
fi
python -m pip install --upgrade build
python -m build

- name: Publish to PyPI
if: steps.check-release-tag.outputs.release_tag == 'true'
run: |
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
twine upload dist/*
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.9.10
hooks:
- id: ruff
args: [ --fix ]
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ sphinx:
configuration: docs/conf.py
fail_on_warning: true
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
# For available versions, see:
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python
python: "3.12" # Keep in sync with .github/workflows/checks.yml
python: "3.13" # Keep in sync with .github/workflows/checks.yml
python:
install:
- requirements: docs/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include AUTHORS CHANGES LICENSE README.rst tox.ini .coveragerc cssselect/py.typed
include AUTHORS CHANGES LICENSE README.rst tox.ini cssselect/py.typed
recursive-include docs *
recursive-include tests *
prune docs/_build
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sphinx==7.2.6
sphinx-rtd-theme==2.0.0
sphinx==8.2.3
sphinx-rtd-theme==3.0.2
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ exclude_also = [
"if TYPE_CHECKING:",
]

[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = true
no_warn_no_return = true

[tool.pylint.MASTER]
persistent = "no"
extension-pkg-allow-list = ["lxml"]
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commands =
[testenv:pylint]
deps =
{[testenv]deps}
pylint==3.3.4
pylint==3.3.5
commands =
pylint {posargs: cssselect setup.py tests docs}

Expand All @@ -30,8 +30,8 @@ commands =
[testenv:typing]
deps =
{[testenv]deps}
mypy==1.14.1
types-lxml==2024.12.13
mypy==1.15.0
types-lxml==2025.3.4
commands =
mypy --strict {posargs: cssselect tests}

Expand All @@ -43,8 +43,8 @@ skip_install = true
[testenv:twinecheck]
basepython = python3
deps =
twine==5.1.1
build==1.2.2
twine==6.1.0
build==1.2.2.post1
commands =
python -m build --sdist
twine check dist/*