Skip to content

Commit

Permalink
Add 3.13 to CI
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Sep 7, 2024
1 parent 4dc2a8f commit 2477ac0
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 56 deletions.
27 changes: 15 additions & 12 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 Down Expand Up @@ -37,9 +37,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 +79,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 +96,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 +143,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"
hooks:
- id: prettier
additional_dependencies:
- prettier@3.3.3
- "@prettier/plugin-xml@3.4.1"
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# filelock
bu# filelock

[![PyPI](https://img.shields.io/pypi/v/filelock)](https://pypi.org/project/filelock/)
[![Supported Python
Expand Down
31 changes: 16 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 @@ -41,23 +41,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 +91,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 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

0 comments on commit 2477ac0

Please sign in to comment.