diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1fe9ed1..f878151 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" @@ -33,24 +34,17 @@ jobs: with: python-version: "3.12" - name: install tox - run: uv pip install tox tox-uv --system + run: uv pip install tox-uv --system - uses: actions/checkout@v4 - name: setup python for test ${{ matrix.py }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.py }} - - name: Pick environment to run - run: | - import codecs; import os; import sys - env = "TOXENV=py{}{}\n".format(*sys.version_info[0:2]) - print("Picked:\n{}for{}".format(env, sys.version)) - with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: - file_handler.write(env) - shell: python + allow-prereleases: true - name: setup test suite - run: tox -vv --notest + run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }} - name: run test suite - run: tox --skip-pkg-install + run: tox run --skip-pkg-install -e ${{ matrix.py }} check: name: tox env ${{ matrix.tox_env }} @@ -71,8 +65,8 @@ jobs: with: python-version: "3.12" - name: install tox - run: uv pip install tox tox-uv --system - - name: run check for ${{ matrix.tox_env }} - run: python -m tox -e ${{ matrix.tox_env }} - env: - UPGRADE_ADVISORY: "yes" + run: uv pip install tox-uv --system + - name: Setup test suite + 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86702ce..8542db9 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.9.0 + uses: pypa/gh-action-pypi-publish@v1.10.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d62411..d42a3ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,30 +5,37 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.1 + 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 - args: ["--write-changes"] + 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.0" + rev: "2.2.1" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.5" + 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 + additional_dependencies: + - prettier@3.3.3 + - "@prettier/plugin-xml@3.4.1" - repo: meta hooks: - id: check-hooks-apply diff --git a/.readthedocs.yml b/.readthedocs.yml index 98529f0..68e7e75 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,6 +4,6 @@ build: tools: python: "3.12" commands: - - pip install tox-uv - - tox r -e docs -vv --notest - - tox r -e docs --skip-pkg-install -- "${READTHEDOCS_OUTPUT}"/html + - pip install tox-uv + - tox r -e docs -vv --notest + - tox r -e docs --skip-pkg-install -- "${READTHEDOCS_OUTPUT}"/html diff --git a/pyproject.toml b/pyproject.toml index c5d5ed2..5a79a13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dynamic = [ "version", @@ -37,10 +38,10 @@ dependencies = [ "tomli>=2.0.1; python_version<'3.11'", ] optional-dependencies.docs = [ - "furo>=2024.7.18", - "sphinx>=7.4.4", - "sphinx-argparse-cli>=1.16", - "sphinx-autodoc-typehints>=2.2.3", + "furo>=2024.8.6", + "sphinx>=8.0.2", + "sphinx-argparse-cli>=1.17", + "sphinx-autodoc-typehints>=2.4", "sphinx-copybutton>=0.5.2", ] optional-dependencies.test = [ @@ -83,19 +84,20 @@ 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 "DOC501", # not working with Sphinx "ISC001", # Conflict with formatter "S104", # Possible binding to all interfaces ] 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 "PLC2701", # private import "PLR0913", # any number of arguments in tests "PLR0917", # any number of arguments in tests "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 = [ @@ -109,6 +111,9 @@ lint.preview = true builtin = "clear,usage,en-GB_to_en-US" count = true +[tool.pyproject-fmt] +max_supported_python = "3.13" + [tool.pytest] ini_options.testpaths = [ "tests", diff --git a/tox.ini b/tox.ini index b6293d3..1f31eee 100644 --- a/tox.ini +++ b/tox.ini @@ -3,14 +3,15 @@ requires = tox>=4.2 env_list = fix - py312 - py311 - py310 - py39 - py38 type readme docs + 3.13 + 3.12 + 3.11 + 3.10 + 3.9 + 3.8 skip_missing_interpreters = true [testenv] @@ -43,9 +44,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.11.1 -set_env = - {tty:MYPY_FORCE_COLOR = 1} + mypy==1.11.2 commands = mypy src mypy tests @@ -54,10 +53,10 @@ commands = description = check that the long description is valid skip_install = true deps = - build[virtualenv]>=1.2.1 + build[uv]>=1.2.2 twine>=5.1.1 commands = - python -m build --sdist --wheel -o {envtmpdir} . + pyproject-build --installer uv --sdist --wheel -o {envtmpdir} . twine check {envtmpdir}/* [testenv:docs] @@ -77,6 +76,5 @@ extras = docs test commands = - python -m pip list --format=columns + uv pip tree python -c 'import sys; print(sys.executable)' -uv_seed = true