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

Declare 3.13 support #130

Merged
merged 1 commit into from
Sep 8, 2024
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
73 changes: 30 additions & 43 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,65 @@ concurrency:

jobs:
test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: test ${{ matrix.py }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
os:
- ubuntu-latest
- windows-2022
- macos-12

steps:
- name: Setup python for tox
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: setup python for tox
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install tox
run: python -m pip install tox-uv
- name: install tox
run: uv pip install tox tox-uv --system
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python for test ${{ matrix.py }}
- name: setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import os; import platform; import sys; from pathlib import Path
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
file_handler.write(env)
shell: python
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox --skip-pkg-install
env:
PYTEST_ADDOPTS: "-vv --durations=20"
CI_RUN: "yes"
allow-prereleases: true
- name: setup test suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
- name: run test suite
run: tox run --skip-pkg-install -e ${{ matrix.py }}

check:
name: tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: tox env ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-2022
tox_env:
- dev
- type
- dev
- readme
exclude:
- { os: windows-2022, tox_env: readme }
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
with:
fetch-depth: 0
- name: Setup Python "3.11"
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install tox
run: python -m pip install tox-uv
python-version: "3.12"
- name: install tox
run: uv pip install tox tox-uv --system
- name: Setup test suite
run: tox -vv --notest -e ${{ matrix.tox_env }}
run: tox -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
- name: Run test suite
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ jobs:
- name: Setup python to build package
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- 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/gh-action-pypi-publish@v1.10.1
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.13"]
- 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
25 changes: 15 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.21.1",
"hatchling>=1.25",
]

[project]
Expand Down Expand Up @@ -38,6 +38,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
Expand All @@ -46,15 +47,15 @@ dynamic = [
"version",
]
dependencies = [
"devpi-client>=7.0.2",
"devpi-server>=6.10",
"typing-extensions>=4.9; python_version<'3.11'",
"devpi-client>=7.1",
"devpi-server>=6.12.1",
"typing-extensions>=4.12.2; python_version<'3.11'",
]
optional-dependencies.test = [
"covdefaults>=2.3",
"httpx>=0.27",
"pytest>=8.0.1",
"pytest-cov>=4.1",
"httpx>=0.27.2",
"pytest>=8.3.2",
"pytest-cov>=5",
]
urls.Homepage = "https://github.com/tox-dev/devpi-process#readme"
urls.Source = "https://github.com/tox-dev/devpi-process"
Expand Down Expand Up @@ -83,15 +84,16 @@ lint.ignore = [
"CPY", # No copyright statements
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"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
"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 @@ -106,6 +108,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 All @@ -126,6 +131,6 @@ run.plugins = [
]

[tool.mypy]
python_version = "3.11"
python_version = "3.12"
show_error_codes = true
strict = true
31 changes: 16 additions & 15 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 @@ -34,7 +36,7 @@ commands =
description = run static analysis and style check using flake8
skip_install = true
deps =
pre-commit>=3.6.2
pre-commit-uv>=4.1
pass_env =
HOMEPATH
PROGRAMDATA
Expand All @@ -44,9 +46,7 @@ commands =
[testenv:type]
description = run type check on code base
deps =
mypy==1.8
set_env =
{tty:MYPY_FORCE_COLOR = 1}
mypy==1.11.2
commands =
mypy src
mypy tests
Expand All @@ -55,11 +55,13 @@ commands =
description = check that the long description is valid
skip_install = true
deps =
build[virtualenv]>=1.0.3
twine>=5
build[uv]>=1.2.2
check-wheel-contents>=0.6
twine>=5.1.1
commands =
python -m build --sdist --wheel -o {envtmpdir} .
twine check {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
Expand All @@ -68,6 +70,5 @@ extras =
docs
test
commands =
python -m pip list --format=columns
uv pip tree
python -c 'import sys; print(sys.executable)'
uv_seed = true