diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8a81e08..d716413 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,6 +20,7 @@ jobs: fail-fast: false matrix: py: + - "3.13" - "3.12" - "3.11" - "3.10" @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73ec509..7e50f84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/gh-action-pypi-publish@v1.10.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf5967b..c46b622 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,14 +8,14 @@ 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"] @@ -23,13 +23,17 @@ repos: 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 diff --git a/pyproject.toml b/pyproject.toml index 9c645c8..5db65d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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", ] @@ -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 = [ @@ -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 diff --git a/tox.ini b/tox.ini index d806958..c73fa7e 100644 --- a/tox.ini +++ b/tox.ini @@ -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] @@ -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 @@ -42,25 +44,22 @@ 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 @@ -68,14 +67,14 @@ 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