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

Add 3.13 to CI #359

Merged
merged 1 commit into from
Sep 7, 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
30 changes: 16 additions & 14 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: check
on:
workflow_dispatch:
push:
branches: "main"
branches: ["main"]
tags-ignore: ["**"]
pull_request:
schedule:
Expand All @@ -26,8 +26,7 @@ jobs:
- "3.10"
- "3.9"
- "3.8"
- "pypy3.9"
- "pypy3.8"
- "pypy3.10"
os:
- ubuntu-latest
- windows-latest
Expand All @@ -37,9 +36,9 @@ jobs:
- 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
Expand Down Expand Up @@ -79,10 +78,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
Expand All @@ -94,28 +95,29 @@ 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
run: python -m pip install build
- 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
run: pwd
- 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
Expand All @@ -140,10 +142,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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 16 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,38 @@ 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"]
- repo: https://github.com/tox-dev/pyproject-fmt
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:
- [email protected]
- "@prettier/[email protected]"
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
35 changes: 20 additions & 15 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.18",
"hatchling>=1.25",
]

[project]
Expand Down Expand Up @@ -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",
Expand All @@ -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"
Expand Down Expand Up @@ -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 = [
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/asyncio.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
42 changes: 21 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -39,15 +39,15 @@ 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"))'

[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 =
Expand All @@ -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 =
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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
Loading