From b973ddfd9b29714601ef48bc9144148a2aec602f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Sat, 7 Sep 2024 08:49:57 -0700 Subject: [PATCH] Add 3.13 to CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/check.yml | 31 +++++++++++++++----------- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 21 +++++++++++++----- pyproject.toml | 35 ++++++++++++++++------------- src/filelock/asyncio.py | 2 +- tox.ini | 42 +++++++++++++++++------------------ 6 files changed, 77 insertions(+), 56 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fdb980a..b12ccf5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ name: check on: workflow_dispatch: push: - branches: "main" + branches: ["main"] tags-ignore: ["**"] pull_request: schedule: @@ -26,20 +26,22 @@ jobs: - "3.10" - "3.9" - "3.8" - - "pypy3.9" + - "pypy3.10" - "pypy3.8" os: - ubuntu-latest - windows-latest - macos-latest + exclude: + - { py: "pypy-3.8", os: windows-latest} steps: - name: Setup python for tox uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install tox - run: python -m pip install tox + run: python -m pip install tox-uv - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -79,10 +81,12 @@ jobs: shell: python - if: ${{ !startsWith(matrix.py, 'pypy')}} name: Upload coverage data - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage-data + include-hidden-files: true + name: .coverage.${{ matrix.os }}.${{ matrix.py }} path: ".tox/.coverage.*" + retention-days: 3 coverage: name: Combine coverage @@ -94,9 +98,9 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install tox - run: python -m pip install tox build + run: python -m pip install tox-uv build[uv] - name: Setup coverage tool run: tox -e coverage --notest - name: Install package builder @@ -104,10 +108,11 @@ jobs: - name: Build package run: pyproject-build --wheel . - name: Download coverage data - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4 with: - name: coverage-data path: .tox + pattern: .coverage.* + merge-multiple: true - name: Show contents run: ls -alth * - name: pwd @@ -115,7 +120,7 @@ jobs: - name: Combine and report coverage run: tox -e coverage - name: Upload HTML report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: html-report path: .tox/htmlcov @@ -140,10 +145,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Python "3.11" + - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install tox run: python -m pip install tox - name: Setup test suite diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c634245..54e33b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Setup python to build package uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Install build run: python -m pip install build - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c30e40..4b981c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,13 +4,18 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.29.2 + hooks: + - id: check-github-workflows + 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"] @@ -18,13 +23,19 @@ repos: rev: "2.2.1" hooks: - id: pyproject-fmt - additional_dependencies: ["tox>=4.12.1"] - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.3" + - repo: https://github.com/astral-sh/ruff-pre-commit + 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" # Use the sha / tag you want to point at + 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/pyproject.toml b/pyproject.toml index 64a2c20..e864255 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.4", - "hatchling>=1.18", + "hatchling>=1.25", ] [project] @@ -33,6 +33,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", @@ -41,23 +42,23 @@ dynamic = [ "version", ] optional-dependencies.docs = [ - "furo>=2023.9.10", - "sphinx>=7.2.6", - "sphinx-autodoc-typehints!=1.23.4,>=1.25.2", + "furo>=2024.8.6", + "sphinx>=8.0.2", + "sphinx-autodoc-typehints!=1.23.4,>=2.4", ] optional-dependencies.testing = [ "covdefaults>=2.3", - "coverage>=7.3.2", - "diff-cover>=8.0.1", - "pytest>=7.4.3", - "pytest-asyncio>=0.21", - "pytest-cov>=4.1", - "pytest-mock>=3.12", - "pytest-timeout>=2.2", - "virtualenv>=20.26.2", + "coverage>=7.6.1", + "diff-cover>=9.1.1", + "pytest>=8.3.2", + "pytest-asyncio>=0.24", + "pytest-cov>=5", + "pytest-mock>=3.14", + "pytest-timeout>=2.3.1", + "virtualenv>=20.26.3", ] optional-dependencies.typing = [ - "typing-extensions>=4.8; python_version<'3.11'", + "typing-extensions>=4.12.2; python_version<'3.11'", ] urls.Documentation = "https://py-filelock.readthedocs.io" urls.Homepage = "https://github.com/tox-dev/py-filelock" @@ -91,15 +92,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", # no support yet "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 + "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 = [ @@ -115,6 +117,9 @@ count = true quiet-level = 3 ignore-words-list = "master" +[tool.pyproject-fmt] +max_supported_python = "3.13" + [tool.coverage] html.show_contexts = true html.skip_covered = false diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index f5848c8..0fdd8f7 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -1,4 +1,4 @@ -"""An asyncio-based implementation of the file lock.""" +"""An asyncio-based implementation of the file lock.""" # noqa: A005 from __future__ import annotations diff --git a/tox.ini b/tox.ini index ac18f54..b0fda1c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,19 @@ [tox] requires = tox>=4.2 + tox-uv>=1.11.3 env_list = fix - py313 - py312 - py311 - py310 - py39 - py38 - py37 type coverage docs readme + 3.13 + 3.12 + 3.11 + 3.10 + 3.9 + 3.8 skip_missing_interpreters = true [testenv] @@ -39,7 +39,7 @@ description = format the code base to adhere to our styles, and complain about w base_python = python3.10 skip_install = true deps = - pre-commit>=3.5 + pre-commit>=3.8 commands = pre-commit run --all-files --show-diff-on-failure python -c 'import pathlib; print("hint: run \{\} install to add checks as pre-commit hook".format(pathlib.Path(r"{envdir}") / "bin" / "pre-commit"))' @@ -47,7 +47,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.7.1 + mypy==1.11.2 set_env = {tty:MYPY_FORCE_COLOR = 1} commands = @@ -59,8 +59,8 @@ description = combine coverage files and generate diff (against DIFF_AGAINST def skip_install = true deps = covdefaults>=2.3 - coverage[toml]>=7.3.2 - diff-cover>=8.0.1 + coverage[toml]>=7.6.1 + diff-cover>=9.1.1 extras = parallel_show_output = true pass_env = @@ -74,11 +74,12 @@ commands = coverage html -d {toxworkdir}/htmlcov diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml depends = - py311 - py310 - py39 - py38 - py37 + 3.13 + 3.12 + 3.11 + 3.10 + 3.9 + 3.8 [testenv:docs] description = build documentation @@ -92,11 +93,11 @@ commands = description = check that the long description is valid (need for PyPI) skip_install = true deps = - build[virtualenv]>=1.0.3 - twine>=4.0.2 + build[uv]>=1.2.2 + twine>=5.1.1 extras = commands = - pyproject-build -o {envtmpdir} --wheel --sdist . + pyproject-build -o {envtmpdir} --installer uv --wheel --sdist . twine check {envtmpdir}/* [testenv:dev] @@ -106,6 +107,5 @@ extras = docs testing commands = - python -m pip list --format=columns + uv pip tree python -c 'import sys; print(sys.executable)' -uv_seed = true