Skip to content

Commit

Permalink
Declare 3.13 support (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Sep 8, 2024
1 parent 4735375 commit fa10e6f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 38 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
Expand All @@ -37,9 +38,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Install self
run: python -m pip install .
allow-prereleases: true
- name: setup uv for tox
uses: yezz123/setup-uv@v4
- name: install self with tox-uv
run: uv pip install tox-uv tox-gh@. --system
- name: Setup test suite
run: tox -vv --notest
run: tox run -vv --skip-missing-interpreters false --notest
- name: Run test suite
run: tox --skip-pkg-install
run: tox run --skip-pkg-install
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: setup uv for tox
uses: yezz123/setup-uv@v4
- name: Install build
run: python -m pip install build
run: uv pip install build[uv] --system
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build package
run: pyproject-build -s -w . -o dist
run: pyproject-build --installer uv --sdist --wheel . --outdir dist
- name: Publish to PyPI
uses: pypa/[email protected]
12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,32 @@ repos:
rev: 0.29.2
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
args: ["--verbose"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
rev: "1.3.2"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.1"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.15.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.3"
rev: "v0.6.4"
hooks:
- id: ruff-format
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
hooks:
- id: prettier
args: ["--print-width=120", "--prose-wrap=always"]
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: System",
Expand All @@ -40,12 +41,12 @@ dynamic = [
"version",
]
dependencies = [
"tox>=4.15.1",
"tox>=4.18.1",
]
optional-dependencies.test = [
"covdefaults>=2.3",
"devpi-process>=1",
"pytest>=8.2.2",
"pytest>=8.3.2",
"pytest-cov>=5",
"pytest-mock>=3.14",
]
Expand Down Expand Up @@ -84,15 +85,16 @@ lint.ignore = [
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"D301", # Use `r"""` if any backslashes in a docstring
"D401", # First line of docstring should be in imperative mood
"DOC", # not supported
"ISC001", # Conflict with formatter
"S104", # Possible binding to all interface
]
lint.per-file-ignores."tests/**/*.py" = [
"D", # don"t care about documentation in tests
"FBT", # don"t care about booleans as positional arguments in tests
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"S101", # asserts allowed in tests...
"S101", # asserts allowed in tests
"S603", # `subprocess` call: check for execution of untrusted input
]
lint.isort = { known-first-party = [
Expand All @@ -108,6 +110,9 @@ builtin = "clear,usage,en-GB_to_en-US"
write-changes = true
count = true

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.coverage]
html.show_contexts = true
html.skip_covered = false
Expand Down
45 changes: 22 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[tox]
requires =
tox>=4.2
tox-uv>=1.11.3
env_list =
fix
py312
py311
py310
py39
py38
type
readme
3.13
3.12
3.11
3.10
3.9
3.8
skip_missing_interpreters = true

[testenv]
Expand All @@ -32,7 +34,7 @@ commands =
description = run static analysis and style check using flake8
skip_install = true
deps =
pre-commit>=3.7.1
pre-commit>=3.8
pass_env =
HOMEPATH
PROGRAMDATA
Expand All @@ -42,40 +44,37 @@ commands =
[testenv:type]
description = run type check on code base
deps =
mypy==1.10
set_env =
{tty:MYPY_FORCE_COLOR = 1}
mypy==1.11.2
commands =
mypy src {posargs}
mypy tests {posargs}

[testenv:readme]
description = check that the package metadata is correct
description = check that the long description is valid
skip_install = true
deps =
build[virtualenv]>=1.2.1
twine>=5.1
set_env =
{tty:FORCE_COLOR = 1}
change_dir = {toxinidir}
build[uv]>=1.2.2
check-wheel-contents>=0.6
twine>=5.1.1
commands =
python -m build --sdist --wheel -o {envtmpdir} .
pyproject-build --installer uv --outdir {envtmpdir} --sdist --wheel .
twine check {envtmpdir}{/}*
check-wheel-contents --no-config {envtmpdir}

[testenv:dev]
description = generate a DEV environment
package = editable
extras =
test
commands =
python -m pip list --format=columns
uv pip tree
python -c 'import sys; print(sys.executable)'
uv_seed = true

[gh]
python =
3.8 = py38
3.9 = py39
3.10 = py310
3.11 = py311
3.12 = py312, type, dev, readme
3.8 = 3.8
3.9 = 3.9
3.10 = 3.10
3.11 = 3.11
3.12 = 3.12
3.13 = type, dev, readme

0 comments on commit fa10e6f

Please sign in to comment.