From 4104f3e0e6e809d3ce7ca3105cbb0f5599d45ddb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 18:36:29 -0700 Subject: [PATCH 01/65] [pre-commit.ci] pre-commit autoupdate (#348) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab84d912..87e6694c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: pyproject-fmt additional_dependencies: ["tox>=4.12.1"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.9" + rev: "v0.5.0" hooks: - id: ruff-format - id: ruff From 85760d7531cfaa6fe9382d950aadf2ebd21364a0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:20:00 +0300 Subject: [PATCH 02/65] Test Python 3.13 (#352) --- .github/workflows/check.yml | 2 ++ tox.ini | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ed427be3..103d5f69 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" @@ -46,6 +47,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.py }} + allow-prereleases: true - name: Pick environment to run run: | import os; import platform; import sys; from pathlib import Path diff --git a/tox.ini b/tox.ini index a7520f88..ac18f544 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ requires = tox>=4.2 env_list = fix + py313 py312 py311 py310 From 067b65169525f3358808b8dad0afd728c7750ea8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 21:57:25 -0700 Subject: [PATCH 03/65] Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (#357) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 103d5f69..fdb980ae 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -104,7 +104,7 @@ jobs: - name: Build package run: pyproject-build --wheel . - name: Download coverage data - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.7 with: name: coverage-data path: .tox From 7397dd7a17678354b3a732faec98d1b50c71c0be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:03:21 -0700 Subject: [PATCH 04/65] [pre-commit.ci] pre-commit autoupdate (#354) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- tests/test_async_filelock.py | 10 +++++----- tests/test_filelock.py | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87e6694c..1c30e403 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,12 +15,12 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.1.3" + 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.5.0" + rev: "v0.6.3" hooks: - id: ruff-format - id: ruff diff --git a/tests/test_async_filelock.py b/tests/test_async_filelock.py index e0b150c1..73eef145 100644 --- a/tests/test_async_filelock.py +++ b/tests/test_async_filelock.py @@ -11,7 +11,7 @@ @pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) @pytest.mark.parametrize("path_type", [str, PurePath, Path]) @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"]) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_simple( lock_type: type[BaseAsyncFileLock], path_type: type[str | Path], @@ -43,7 +43,7 @@ async def test_simple( @pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) @pytest.mark.parametrize("path_type", [str, PurePath, Path]) @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"]) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_acquire( lock_type: type[BaseAsyncFileLock], path_type: type[str | Path], @@ -73,7 +73,7 @@ async def test_acquire( @pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path) -> None: # raises Timeout error when the lock cannot be acquired lock_path = tmp_path / "a" @@ -147,7 +147,7 @@ async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path) @pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) @pytest.mark.parametrize("thread_local", [True, False]) -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_non_executor(lock_type: type[BaseAsyncFileLock], thread_local: bool, tmp_path: Path) -> None: lock_path = tmp_path / "a" lock = lock_type(str(lock_path), thread_local=thread_local, run_in_executor=False) @@ -157,7 +157,7 @@ async def test_non_executor(lock_type: type[BaseAsyncFileLock], thread_local: bo assert not lock.is_locked -@pytest.mark.asyncio() +@pytest.mark.asyncio async def test_coroutine_function(tmp_path: Path) -> None: acquired = released = False diff --git a/tests/test_filelock.py b/tests/test_filelock.py index 6c63255d..8808bf6f 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -63,7 +63,7 @@ def make_ro(path: Path) -> Iterator[None]: path.chmod(path.stat().st_mode | write) -@pytest.fixture() +@pytest.fixture def tmp_path_ro(tmp_path: Path) -> Iterator[Path]: with make_ro(tmp_path): yield tmp_path @@ -81,7 +81,7 @@ def test_ro_folder(lock_type: type[BaseFileLock], tmp_path_ro: Path) -> None: lock.acquire() -@pytest.fixture() +@pytest.fixture def tmp_file_ro(tmp_path: Path) -> Iterator[Path]: filename = tmp_path / "a" filename.write_text("") @@ -680,7 +680,7 @@ def test_lock_can_be_non_thread_local( def test_subclass_compatibility(tmp_path: Path) -> None: class MyFileLock(FileLock): - def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5) + def __init__( self, lock_file: str | os.PathLike[str], timeout: float = -1, @@ -696,7 +696,7 @@ def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5) MyFileLock(str(lock_path), my_param=1) class MySoftFileLock(SoftFileLock): - def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5) + def __init__( self, lock_file: str | os.PathLike[str], timeout: float = -1, From 4dc2a8f5f3678f8b0fc9939b9fc09e1ca733e382 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:03:29 -0700 Subject: [PATCH 05/65] Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.1 (#356) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0da2b8fc..c634245a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,4 +24,4 @@ jobs: - name: Build package run: pyproject-build -s -w . -o dist - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.9.0 + uses: pypa/gh-action-pypi-publish@v1.10.1 From 0acea4f63dc11522441b89a6a699253818c0269d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Sat, 7 Sep 2024 09:12:53 -0700 Subject: [PATCH 06/65] Add 3.13 to CI (#359) --- .github/workflows/check.yml | 30 +++++++++++++------------ .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 21 +++++++++++++----- pyproject.toml | 35 ++++++++++++++++------------- src/filelock/asyncio.py | 2 +- tox.ini | 42 +++++++++++++++++------------------ 6 files changed, 75 insertions(+), 57 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fdb980ae..a4871484 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,8 +26,7 @@ jobs: - "3.10" - "3.9" - "3.8" - - "pypy3.9" - - "pypy3.8" + - "pypy3.10" os: - ubuntu-latest - windows-latest @@ -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 @@ -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 @@ -94,9 +95,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 +105,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 +117,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 +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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c634245a..54e33b81 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 1c30e403..4b981c1c 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 64a2c200..e864255e 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 f5848c89..0fdd8f79 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 ac18f544..b0fda1cf 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 From e6865be6475b968d80245822d694114e2b38cdaf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 10:12:35 -0700 Subject: [PATCH 07/65] [pre-commit.ci] pre-commit autoupdate (#360) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b981c1c..2556d245 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.2.1" + rev: "2.2.3" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit From 4e9873196502700775d51560be5267e3fb408dc0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:18:59 -0700 Subject: [PATCH 08/65] [pre-commit.ci] pre-commit autoupdate (#361) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- tox.ini | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2556d245..43c6308b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.0.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.3.2" + rev: "1.4.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.4" + rev: "v0.6.5" hooks: - id: ruff-format - id: ruff diff --git a/tox.ini b/tox.ini index b0fda1cf..a393499d 100644 --- a/tox.ini +++ b/tox.ini @@ -4,16 +4,16 @@ requires = tox-uv>=1.11.3 env_list = fix - type - coverage - docs - readme 3.13 3.12 3.11 3.10 3.9 3.8 + type + coverage + docs + readme skip_missing_interpreters = true [testenv] From c2c43e456b4369ecac8c932115e41b3addc5c3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 17 Sep 2024 11:57:52 -0700 Subject: [PATCH 09/65] CI improvements (#362) --- .github/workflows/check.yaml | 154 +++++++++++++++++++++++++++++++++ .github/workflows/check.yml | 154 --------------------------------- .github/workflows/release.yaml | 48 ++++++++++ .github/workflows/release.yml | 27 ------ pyproject.toml | 11 ++- tox.ini | 13 +-- 6 files changed, 216 insertions(+), 191 deletions(-) create mode 100644 .github/workflows/check.yaml delete mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 00000000..15ad3a6d --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,154 @@ +name: check +on: + workflow_dispatch: + push: + branches: ["main"] + tags-ignore: ["**"] + pull_request: + schedule: + - cron: "0 8 * * *" + +concurrency: + group: check-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: test ${{ matrix.py }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + py: + - "pypy3.10" # ahead to start it earlier because takes longer + - "3.13" + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + os: + - ubuntu-latest + - windows-latest + - macos-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Add .local/bin to Windows PATH + if: runner.os == 'Windows' + shell: bash + run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH + - name: Install tox + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + - name: Install Python + run: uv python install --python-preference only-managed ${{ matrix.py }} + - name: Setup test suite + run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }} + - name: Run test suite + if: ${{ !startsWith(matrix.py, 'pypy')}} + run: tox run --skip-pkg-install -e ${{ matrix.py }} + env: + PYTEST_ADDOPTS: "-vv --durations=20" + DIFF_AGAINST: HEAD + - name: Run test suite without coverage + if: ${{ startsWith(matrix.py, 'pypy')}} + run: tox run --skip-pkg-install -e ${{ matrix.py }} -- + env: + PYTEST_ADDOPTS: "-vv --durations=20" + - name: Rename coverage report file + if: ${{ !startsWith(matrix.py, 'pypy')}} + run: | + import os; import sys + os.rename(f".tox/.coverage.${{ matrix.py }}", f".tox/.coverage.${{ matrix.py }}-{sys.platform}") + shell: python + - name: Upload coverage data + if: ${{ !startsWith(matrix.py, 'pypy')}} + uses: actions/upload-artifact@v4 + with: + include-hidden-files: true + name: .coverage.${{ matrix.os }}.${{ matrix.py }} + path: ".tox/.coverage.*" + retention-days: 3 + + coverage: + name: Combine coverage + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Add .local/bin to Windows PATH + if: runner.os == 'Windows' + shell: bash + run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH + - name: Install hatch + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + - name: Build package to generate version + run: uv build --python 3.13 --python-preference only-managed --wheel . --out-dir dist + - name: Setup coverage tool + run: tox -e coverage --notest + - name: Download coverage data + uses: actions/download-artifact@v4 + with: + path: .tox + pattern: .coverage.* + merge-multiple: true + - name: Combine and report coverage + run: tox -e coverage --skip-pkg-install + - name: Upload HTML report + uses: actions/upload-artifact@v4 + with: + name: html-report + path: .tox/htmlcov + + check: + name: ${{ matrix.tox_env }} - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + tox_env: + - dev + - type + - docs + - readme + exclude: + - { os: windows-latest, tox_env: readme } + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Add .local/bin to Windows PATH + if: runner.os == 'Windows' + shell: bash + run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH + - name: Install tox + run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv + - name: Setup test suite + run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} + - name: Run test suite + run: tox run --skip-pkg-install -e ${{ matrix.tox_env }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index a4871484..00000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: check -on: - workflow_dispatch: - push: - branches: ["main"] - tags-ignore: ["**"] - pull_request: - schedule: - - cron: "0 8 * * *" - -concurrency: - group: check-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - name: test ${{ matrix.py }} - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - py: - - "3.13" - - "3.12" - - "3.11" - - "3.10" - - "3.9" - - "3.8" - - "pypy3.10" - os: - - ubuntu-latest - - windows-latest - - macos-latest - - steps: - - name: Setup python for tox - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install tox - run: python -m pip install tox-uv - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup python for test ${{ matrix.py }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.py }} - allow-prereleases: true - - name: Pick environment to run - run: | - import os; import platform; import sys; from pathlib import Path - env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}' - print(f"Picked: {env} for {sys.version} based of {sys.executable}") - with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler: - file_handler.write(env) - shell: python - - name: Setup test suite - run: tox r -vv --notest - - if: ${{ startsWith(matrix.py, 'pypy') }} - name: Run test suite - run: tox r --skip-pkg-install -- - env: - PYTEST_ADDOPTS: "-vv --durations=20" - CI_RUN: "yes" - - if: ${{ !startsWith(matrix.py, 'pypy')}} - name: Run test suite - run: tox r --skip-pkg-install - env: - PYTEST_ADDOPTS: "-vv --durations=20" - CI_RUN: "yes" - DIFF_AGAINST: HEAD - - if: ${{ !startsWith(matrix.py, 'pypy')}} - name: Rename coverage report file - run: | - import os; import sys - os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}") - shell: python - - if: ${{ !startsWith(matrix.py, 'pypy')}} - name: Upload coverage data - uses: actions/upload-artifact@v4 - with: - include-hidden-files: true - name: .coverage.${{ matrix.os }}.${{ matrix.py }} - path: ".tox/.coverage.*" - retention-days: 3 - - coverage: - name: Combine coverage - runs-on: ubuntu-latest - needs: test - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install tox - 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 - with: - 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@v4 - with: - name: html-report - path: .tox/htmlcov - - check: - name: ${{ matrix.tox_env }} - ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - tox_env: - - dev - - type - - docs - - readme - exclude: - - { os: windows-latest, tox_env: readme } - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install tox - run: python -m pip install tox - - name: Setup test suite - run: tox -vv --notest -e ${{ matrix.tox_env }} - - name: Run test suite - run: tox --skip-pkg-install -e ${{ matrix.tox_env }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..a6593a7d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +name: Release to PyPI +on: + push: + tags: ["*"] + +env: + dists-artifact-name: python-package-distributions + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Build package + run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: ${{ env.dists-artifact-name }} + path: dist/* + + release: + needs: + - build + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/project/filelock/${{ github.ref_name }} + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: ${{ env.dists-artifact-name }} + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.10.1 + with: + attestations: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 54e33b81..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Release to PyPI -on: - push: - tags: ["*"] - -jobs: - release: - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/filelock - permissions: - id-token: write - steps: - - name: Setup python to build package - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install build - run: python -m pip install build - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Build package - run: pyproject-build -s -w . -o dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.10.1 diff --git a/pyproject.toml b/pyproject.toml index e864255e..259d8e98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,18 +44,18 @@ dynamic = [ optional-dependencies.docs = [ "furo>=2024.8.6", "sphinx>=8.0.2", - "sphinx-autodoc-typehints!=1.23.4,>=2.4", + "sphinx-autodoc-typehints>=2.4.1", ] optional-dependencies.testing = [ "covdefaults>=2.3", "coverage>=7.6.1", - "diff-cover>=9.1.1", - "pytest>=8.3.2", + "diff-cover>=9.2", + "pytest>=8.3.3", "pytest-asyncio>=0.24", "pytest-cov>=5", "pytest-mock>=3.14", "pytest-timeout>=2.3.1", - "virtualenv>=20.26.3", + "virtualenv>=20.26.4", ] optional-dependencies.typing = [ "typing-extensions>=4.12.2; python_version<'3.11'", @@ -120,6 +120,9 @@ ignore-words-list = "master" [tool.pyproject-fmt] max_supported_python = "3.13" +[tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "session" + [tool.coverage] html.show_contexts = true html.skip_covered = false diff --git a/tox.ini b/tox.ini index a393499d..c82819c0 100644 --- a/tox.ini +++ b/tox.ini @@ -60,7 +60,7 @@ skip_install = true deps = covdefaults>=2.3 coverage[toml]>=7.6.1 - diff-cover>=9.1.1 + diff-cover>=9.2 extras = parallel_show_output = true pass_env = @@ -90,15 +90,16 @@ commands = python -c 'print(r"documentation available under file://{toxworkdir}{/}docs_out{/}index.html")' [testenv:readme] -description = check that the long description is valid (need for PyPI) +description = check that the long description is valid skip_install = true deps = - build[uv]>=1.2.2 + check-wheel-contents>=0.6 twine>=5.1.1 -extras = + uv>=0.4.10 commands = - pyproject-build -o {envtmpdir} --installer uv --wheel --sdist . - twine check {envtmpdir}/* + uv build --sdist --wheel --out-dir {envtmpdir} . + twine check {envtmpdir}{/}* + check-wheel-contents --no-config {envtmpdir} [testenv:dev] description = generate a DEV environment From 2542dad85a9a8b6fdd3b9029df4c6e64fb9c0def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 17 Sep 2024 12:05:56 -0700 Subject: [PATCH 10/65] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0631c88e..081c7b73 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ status](https://readthedocs.org/projects/py-filelock/badge/?version=latest)](htt [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Downloads](https://static.pepy.tech/badge/filelock/month)](https://pepy.tech/project/filelock) -[![check](https://github.com/tox-dev/py-filelock/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/py-filelock/actions/workflows/check.yml) +[![check](https://github.com/tox-dev/py-filelock/actions/workflows/check.yaml/badge.svg)](https://github.com/tox-dev/py-filelock/actions/workflows/check.yaml) For more information checkout the [official documentation](https://py-filelock.readthedocs.io/en/latest/index.html). From b825dada512bdea35d6b59602a8c8eb656c8460d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:57:12 -0700 Subject: [PATCH 11/65] [pre-commit.ci] pre-commit autoupdate (#365) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43c6308b..4c2089cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,16 +15,16 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.0.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.4.0" + rev: "1.4.1" hooks: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.2.3" + rev: "2.2.4" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.5" + rev: "v0.6.7" hooks: - id: ruff-format - id: ruff From 4b723c9b98560093f040b9a6e0d8f0f22e24af2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 00:01:33 +0000 Subject: [PATCH 12/65] Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 (#364) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a6593a7d..6aff124a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.10.1 + uses: pypa/gh-action-pypi-publish@v1.10.2 with: attestations: true From 6481da88c92cde966779acdfd286d62721f0b807 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:28:58 -0700 Subject: [PATCH 13/65] [pre-commit.ci] pre-commit autoupdate (#366) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c2089cc..463affa1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.2 + rev: 0.29.3 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.7" + rev: "v0.6.8" hooks: - id: ruff-format - id: ruff From ceb54483fe6371f5b614d8e6b96d6c0c378d6157 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:56:34 +0200 Subject: [PATCH 14/65] [pre-commit.ci] pre-commit autoupdate (#369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.6.8 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.8...v0.6.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 463affa1..23726edf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.8" + rev: "v0.6.9" hooks: - id: ruff-format - id: ruff From ed1f4776b813be0b74dd7073ee67405bb0c0f313 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:00:53 -0700 Subject: [PATCH 15/65] Bump pypa/gh-action-pypi-publish from 1.10.2 to 1.10.3 (#367) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6aff124a..6ab95838 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.10.2 + uses: pypa/gh-action-pypi-publish@v1.10.3 with: attestations: true From 30281d20cf8bed6d9136acff6727eb07c3e889e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:39:46 -0700 Subject: [PATCH 16/65] [pre-commit.ci] pre-commit autoupdate (#370) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 23726edf..7bc1adcc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.3 + rev: 0.29.4 hooks: - id: check-github-workflows args: ["--verbose"] @@ -20,7 +20,7 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.2.4" + rev: "2.3.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit From 170c1a97186743e2fbb5092551f34952c93e9ea8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:37:15 -0700 Subject: [PATCH 17/65] [pre-commit.ci] pre-commit autoupdate (#371) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bc1adcc..8fd5c0f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.3.0" + rev: "2.4.3" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.9" + rev: "v0.7.0" hooks: - id: ruff-format - id: ruff From 56470bce989f38482c23d80dea8cf37963d50775 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:59:43 -0700 Subject: [PATCH 18/65] [pre-commit.ci] pre-commit autoupdate (#372) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fd5c0f1..4cf21a14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.4.3" + rev: "v2.4.3" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.0" + rev: "v0.7.1" hooks: - id: ruff-format - id: ruff From eb2dc968c6d7fffed4cf6909189a4d98e6456b68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:07:23 -0700 Subject: [PATCH 19/65] Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.11.0 (#373) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6ab95838..4daeb320 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.10.3 + uses: pypa/gh-action-pypi-publish@v1.11.0 with: attestations: true From f3293da843213a8425251914a753e978067deffc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:29:31 -0800 Subject: [PATCH 20/65] Bump pypa/gh-action-pypi-publish from 1.11.0 to 1.12.2 (#376) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.11.0 to 1.12.2. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.11.0...v1.12.2) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4daeb320..38d09013 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.11.0 + uses: pypa/gh-action-pypi-publish@v1.12.2 with: attestations: true From 2e1a1b228dcf9ab82d93be164573def7c630ae54 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:29:36 -0800 Subject: [PATCH 21/65] [pre-commit.ci] pre-commit autoupdate (#374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/pyproject-fmt: v2.4.3 → v2.5.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.4.3...v2.5.0) - [github.com/astral-sh/ruff-pre-commit: v0.7.1 → v0.7.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.1...v0.7.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4cf21a14..fcf81652 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.4.3" + rev: "v2.5.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.1" + rev: "v0.7.2" hooks: - id: ruff-format - id: ruff From ee4c7ba1c863509a4fa9a8a992c7ec41747e1f96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:47:05 -0800 Subject: [PATCH 22/65] [pre-commit.ci] pre-commit autoupdate (#377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.7.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.2...v0.7.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcf81652..84d93ac5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.2" + rev: "v0.7.3" hooks: - id: ruff-format - id: ruff From 07c2840b805d1dd2400ee1b6b193dd3c9bf1f7c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:30:45 -0800 Subject: [PATCH 23/65] [pre-commit.ci] pre-commit autoupdate (#379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.7.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.3...v0.7.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84d93ac5..b88f80dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.3" + rev: "v0.7.4" hooks: - id: ruff-format - id: ruff From fb2a4e26c6b391e78ca35d0959e854e9c174fc2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:26:06 -0800 Subject: [PATCH 24/65] Bump astral-sh/setup-uv from 3 to 4 (#381) Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 3 to 4. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v3...v4) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 15ad3a6d..93055b23 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -87,7 +87,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -137,7 +137,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 with: enable-cache: true cache-dependency-glob: "pyproject.toml" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 38d09013..4fb4f4f5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 with: enable-cache: true cache-dependency-glob: "pyproject.toml" From d4feb5a15974754a8fcd7893c196f229652a05ca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:25:02 -0800 Subject: [PATCH 25/65] [pre-commit.ci] pre-commit autoupdate (#382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.4 → v0.8.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.4...v0.8.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b88f80dd..70ff53f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.8.0" hooks: - id: ruff-format - id: ruff From 57f488ff8fdc2193572efe102408fb63cfefe4e4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:57:15 +0100 Subject: [PATCH 26/65] [pre-commit.ci] pre-commit autoupdate (#383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.29.4 → 0.30.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.4...0.30.0) - [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.0...v0.8.1) - [github.com/rbubley/mirrors-prettier: v3.3.3 → v3.4.1](https://github.com/rbubley/mirrors-prettier/compare/v3.3.3...v3.4.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- src/filelock/_api.py | 4 ++-- src/filelock/_unix.py | 2 +- src/filelock/_windows.py | 2 +- src/filelock/asyncio.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70ff53f7..203a6b2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.4 + rev: 0.30.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.0" + rev: "v0.8.1" 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 + rev: "v3.4.1" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: diff --git a/src/filelock/_api.py b/src/filelock/_api.py index 771a559a..8fde69a0 100644 --- a/src/filelock/_api.py +++ b/src/filelock/_api.py @@ -106,7 +106,7 @@ def __call__( # noqa: PLR0913 if passed_param != set_param } if not non_matching_params: - return cast(BaseFileLock, instance) + return cast("BaseFileLock", instance) # parameters do not match; raise error msg = "Singleton lock instances cannot be initialized with differing arguments" @@ -136,7 +136,7 @@ def __call__( # noqa: PLR0913 if is_singleton: cls._instances[str(lock_file)] = instance # type: ignore[attr-defined] - return cast(BaseFileLock, instance) + return cast("BaseFileLock", instance) class BaseFileLock(contextlib.ContextDecorator, metaclass=FileLockMeta): diff --git a/src/filelock/_unix.py b/src/filelock/_unix.py index 4ae1fbe9..04f590da 100644 --- a/src/filelock/_unix.py +++ b/src/filelock/_unix.py @@ -56,7 +56,7 @@ def _release(self) -> None: # Do not remove the lockfile: # https://github.com/tox-dev/py-filelock/issues/31 # https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition - fd = cast(int, self._context.lock_file_fd) + fd = cast("int", self._context.lock_file_fd) self._context.lock_file_fd = None fcntl.flock(fd, fcntl.LOCK_UN) os.close(fd) diff --git a/src/filelock/_windows.py b/src/filelock/_windows.py index 8db55dcb..348251d1 100644 --- a/src/filelock/_windows.py +++ b/src/filelock/_windows.py @@ -40,7 +40,7 @@ def _acquire(self) -> None: self._context.lock_file_fd = fd def _release(self) -> None: - fd = cast(int, self._context.lock_file_fd) + fd = cast("int", self._context.lock_file_fd) self._context.lock_file_fd = None msvcrt.locking(fd, msvcrt.LK_UNLCK, 1) os.close(fd) diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index 0fdd8f79..252de203 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -95,7 +95,7 @@ def __call__( # type: ignore[override] # noqa: PLR0913 run_in_executor=run_in_executor, executor=executor, ) - return cast(BaseAsyncFileLock, instance) + return cast("BaseAsyncFileLock", instance) class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta): From 46dddc89672d1646156c61c4db0a664ba4886d2f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:32:21 -0800 Subject: [PATCH 27/65] [pre-commit.ci] pre-commit autoupdate (#385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.1...v0.8.3) - [github.com/rbubley/mirrors-prettier: v3.4.1 → v3.4.2](https://github.com/rbubley/mirrors-prettier/compare/v3.4.1...v3.4.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 203a6b2b..7418e15c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.1" + rev: "v0.8.3" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.4.1" # Use the sha / tag you want to point at + rev: "v3.4.2" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From 79a958358f79ea3ae0ae1bc7ee7ce6a96a5ef407 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 20:32:26 -0800 Subject: [PATCH 28/65] Bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 (#386) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.2 to 1.12.3. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.2...v1.12.3) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4fb4f4f5..5370c90a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.2 + uses: pypa/gh-action-pypi-publish@v1.12.3 with: attestations: true From 23a984803c969a75530ba8c2c5fb5a6b73686762 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 17:34:58 -0800 Subject: [PATCH 29/65] Bump astral-sh/setup-uv from 4 to 5 (#387) Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 4 to 5. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v4...v5) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 93055b23..1a0413f0 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -87,7 +87,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -137,7 +137,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "pyproject.toml" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5370c90a..c59bad8d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 with: enable-cache: true cache-dependency-glob: "pyproject.toml" From 5eb02b2580122e6f42fb8b7a4e08cededcb22b1c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:03:27 -0800 Subject: [PATCH 30/65] Drop 3.8 (#388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.30.0...0.31.0) - [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.9.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.3...v0.9.2) * Fix failures and drop 3.8 Signed-off-by: Bernát Gábor --------- Signed-off-by: Bernát Gábor Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor --- .github/workflows/check.yaml | 13 ++++++++++++- .pre-commit-config.yaml | 10 +++++----- pyproject.toml | 23 ++++++++++------------- tests/test_async_filelock.py | 14 +++++++------- tests/test_filelock.py | 28 +++++++++++++++------------- tox.ini | 19 +++++++++---------- 6 files changed, 58 insertions(+), 49 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 1a0413f0..08b5aba9 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -26,7 +26,6 @@ jobs: - "3.11" - "3.10" - "3.9" - - "3.8" os: - ubuntu-latest - windows-latest @@ -52,17 +51,21 @@ jobs: run: uv python install --python-preference only-managed ${{ matrix.py }} - name: Setup test suite run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }} + env: + UV_PYTHON_PREFERENCE: only-managed - name: Run test suite if: ${{ !startsWith(matrix.py, 'pypy')}} run: tox run --skip-pkg-install -e ${{ matrix.py }} env: PYTEST_ADDOPTS: "-vv --durations=20" DIFF_AGAINST: HEAD + UV_PYTHON_PREFERENCE: only-managed - name: Run test suite without coverage if: ${{ startsWith(matrix.py, 'pypy')}} run: tox run --skip-pkg-install -e ${{ matrix.py }} -- env: PYTEST_ADDOPTS: "-vv --durations=20" + UV_PYTHON_PREFERENCE: only-managed - name: Rename coverage report file if: ${{ !startsWith(matrix.py, 'pypy')}} run: | @@ -102,6 +105,8 @@ jobs: run: uv build --python 3.13 --python-preference only-managed --wheel . --out-dir dist - name: Setup coverage tool run: tox -e coverage --notest + env: + UV_PYTHON_PREFERENCE: only-managed - name: Download coverage data uses: actions/download-artifact@v4 with: @@ -110,6 +115,8 @@ jobs: merge-multiple: true - name: Combine and report coverage run: tox -e coverage --skip-pkg-install + env: + UV_PYTHON_PREFERENCE: only-managed - name: Upload HTML report uses: actions/upload-artifact@v4 with: @@ -150,5 +157,9 @@ jobs: run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv - name: Setup test suite run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} + env: + UV_PYTHON_PREFERENCE: only-managed - name: Run test suite run: tox run --skip-pkg-install -e ${{ matrix.tox_env }} + env: + UV_PYTHON_PREFERENCE: only-managed diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7418e15c..acc1c5e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -13,9 +13,9 @@ repos: rev: v2.3.0 hooks: - id: codespell - additional_dependencies: ["tomli>=2.0.1"] + additional_dependencies: ["tomli>=2.2.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.4.1" + rev: "1.5.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.3" + rev: "v0.9.2" hooks: - id: ruff-format - id: ruff @@ -34,7 +34,7 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.3.3 + - prettier@3.4.2 - "@prettier/plugin-xml@3.4.1" - repo: meta hooks: diff --git a/pyproject.toml b/pyproject.toml index 259d8e98..64a7ef16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.4", - "hatchling>=1.25", + "hatchling>=1.27", ] [project] @@ -20,7 +20,7 @@ license = "Unlicense" maintainers = [ { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -28,7 +28,6 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -43,19 +42,19 @@ dynamic = [ ] optional-dependencies.docs = [ "furo>=2024.8.6", - "sphinx>=8.0.2", - "sphinx-autodoc-typehints>=2.4.1", + "sphinx>=8.1.3", + "sphinx-autodoc-typehints>=3", ] optional-dependencies.testing = [ "covdefaults>=2.3", - "coverage>=7.6.1", - "diff-cover>=9.2", - "pytest>=8.3.3", - "pytest-asyncio>=0.24", - "pytest-cov>=5", + "coverage>=7.6.10", + "diff-cover>=9.2.1", + "pytest>=8.3.4", + "pytest-asyncio>=0.25.2", + "pytest-cov>=6", "pytest-mock>=3.14", "pytest-timeout>=2.3.1", - "virtualenv>=20.26.4", + "virtualenv>=20.28.1", ] optional-dependencies.typing = [ "typing-extensions>=4.12.2; python_version<'3.11'", @@ -75,7 +74,6 @@ build.targets.sdist.include = [ version.source = "vcs" [tool.ruff] -target-version = "py38" line-length = 120 format.preview = true format.docstring-code-line-length = 100 @@ -84,7 +82,6 @@ lint.select = [ "ALL", ] lint.ignore = [ - "ANN101", # Missing type annotation for `self` in method "COM812", # Conflict with formatter "CPY", # No copyright statements "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible diff --git a/tests/test_async_filelock.py b/tests/test_async_filelock.py index 73eef145..643c6677 100644 --- a/tests/test_async_filelock.py +++ b/tests/test_async_filelock.py @@ -91,32 +91,32 @@ async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path) assert not lock_5.is_locked # try to acquire lock 2 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): await lock_2.acquire(blocking=False) assert not lock_2.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `blocking=False` lock 3 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): await lock_3.acquire() assert not lock_3.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `blocking=False` lock 3 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): async with lock_3: pass assert not lock_3.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=0` lock 4 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): await lock_4.acquire() assert not lock_4.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=0` lock 4 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): async with lock_4: pass assert not lock_4.is_locked @@ -124,13 +124,13 @@ async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path) # blocking precedence over timeout # try to acquire pre-parametrized `timeout=-1,blocking=False` lock 5 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): await lock_5.acquire() assert not lock_5.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=-1,blocking=False` lock 5 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): async with lock_5: pass assert not lock_5.is_locked diff --git a/tests/test_filelock.py b/tests/test_filelock.py index 8808bf6f..b071396e 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -12,7 +12,7 @@ from pathlib import Path, PurePath from stat import S_IWGRP, S_IWOTH, S_IWUSR, filemode from types import TracebackType -from typing import TYPE_CHECKING, Any, Callable, Iterator, Tuple, Type, Union +from typing import TYPE_CHECKING, Any, Callable, Union from uuid import uuid4 from weakref import WeakValueDictionary @@ -21,6 +21,8 @@ from filelock import BaseFileLock, FileLock, SoftFileLock, Timeout, UnixFileLock, WindowsFileLock if TYPE_CHECKING: + from collections.abc import Iterator + from pytest_mock import MockerFixture @@ -218,7 +220,7 @@ def test_nested_contruct(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_1.is_locked -_ExcInfoType = Union[Tuple[Type[BaseException], BaseException, TracebackType], Tuple[None, None, None]] +_ExcInfoType = Union[tuple[type[BaseException], BaseException, TracebackType], tuple[None, None, None]] class ExThread(threading.Thread): @@ -304,7 +306,7 @@ def test_timeout(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_2.is_locked # try to acquire lock 2 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_2.acquire(timeout=0.1) assert not lock_2.is_locked assert lock_1.is_locked @@ -333,44 +335,44 @@ def test_non_blocking(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_5.is_locked # try to acquire lock 2 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_2.acquire(blocking=False) assert not lock_2.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `blocking=False` lock 3 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_3.acquire() assert not lock_3.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `blocking=False` lock 3 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."), lock_3: + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."), lock_3: pass assert not lock_3.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=0` lock 4 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_4.acquire() assert not lock_4.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=0` lock 4 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."), lock_4: + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."), lock_4: pass assert not lock_4.is_locked assert lock_1.is_locked # blocking precedence over timeout # try to acquire pre-parametrized `timeout=-1,blocking=False` lock 5 with `acquire` - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_5.acquire() assert not lock_5.is_locked assert lock_1.is_locked # try to acquire pre-parametrized `timeout=-1,blocking=False` lock 5 with context manager - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."), lock_5: + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."), lock_5: pass assert not lock_5.is_locked assert lock_1.is_locked @@ -397,7 +399,7 @@ def test_default_timeout(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_2.is_locked # try to acquire lock 2 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_2.acquire() assert not lock_2.is_locked assert lock_1.is_locked @@ -405,7 +407,7 @@ def test_default_timeout(lock_type: type[BaseFileLock], tmp_path: Path) -> None: lock_2.timeout = 0 assert lock_2.timeout == 0 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_2.acquire() assert not lock_2.is_locked assert lock_1.is_locked @@ -459,7 +461,7 @@ def test_del(lock_type: type[BaseFileLock], tmp_path: Path) -> None: assert not lock_2.is_locked # try to acquire lock 2 - with pytest.raises(Timeout, match="The file lock '.*' could not be acquired."): + with pytest.raises(Timeout, match=r"The file lock '.*' could not be acquired."): lock_2.acquire(timeout=0.1) # delete lock 1 and try to acquire lock 2 again diff --git a/tox.ini b/tox.ini index c82819c0..960e01e0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] requires = - tox>=4.2 - tox-uv>=1.11.3 + tox>=4.23.2 + tox-uv>=1.17 env_list = fix 3.13 @@ -9,7 +9,6 @@ env_list = 3.11 3.10 3.9 - 3.8 type coverage docs @@ -39,7 +38,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.8 + pre-commit>=4.0.1 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 +46,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.11.2 + mypy==1.14.1 set_env = {tty:MYPY_FORCE_COLOR = 1} commands = @@ -59,8 +58,8 @@ description = combine coverage files and generate diff (against DIFF_AGAINST def skip_install = true deps = covdefaults>=2.3 - coverage[toml]>=7.6.1 - diff-cover>=9.2 + coverage[toml]>=7.6.10 + diff-cover>=9.2.1 extras = parallel_show_output = true pass_env = @@ -93,9 +92,9 @@ commands = description = check that the long description is valid skip_install = true deps = - check-wheel-contents>=0.6 - twine>=5.1.1 - uv>=0.4.10 + check-wheel-contents>=0.6.1 + twine>=6.0.1 + uv>=0.5.18 commands = uv build --sdist --wheel --out-dir {envtmpdir} . twine check {envtmpdir}{/}* From 18c9571afba87bb6329aef9c2c7798cbe8adfea5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 08:03:32 -0800 Subject: [PATCH 31/65] Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 (#390) Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.3 to 1.12.4. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.3...v1.12.4) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c59bad8d..f063e965 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,6 @@ jobs: name: ${{ env.dists-artifact-name }} path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.3 + uses: pypa/gh-action-pypi-publish@v1.12.4 with: attestations: true From 2760759ac82f7e8583f708d9bf801c3a79ccd340 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:03:08 -0800 Subject: [PATCH 32/65] [pre-commit.ci] pre-commit autoupdate (#391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/codespell-project/codespell: v2.3.0 → v2.4.0](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.0) - [github.com/astral-sh/ruff-pre-commit: v0.9.2 → v0.9.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.2...v0.9.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index acc1c5e8..d6684c31 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: check-github-workflows args: ["--verbose"] - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.0 hooks: - id: codespell additional_dependencies: ["tomli>=2.2.1"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.2" + rev: "v0.9.3" hooks: - id: ruff-format - id: ruff From 3c9b68049961d1b4aade1cc806e731f90b5d2c24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:12:03 -0800 Subject: [PATCH 33/65] [pre-commit.ci] pre-commit autoupdate (#393) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.0...0.31.1) - [github.com/codespell-project/codespell: v2.4.0 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.4.0...v2.4.1) - [github.com/astral-sh/ruff-pre-commit: v0.9.3 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.3...v0.9.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6684c31..14dbb394 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,12 +5,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-github-workflows args: ["--verbose"] - repo: https://github.com/codespell-project/codespell - rev: v2.4.0 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: ["tomli>=2.2.1"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.3" + rev: "v0.9.4" hooks: - id: ruff-format - id: ruff From b5f98a66d0fb59e62894ad2b537deb877279adda Mon Sep 17 00:00:00 2001 From: bicarlsen Date: Tue, 4 Feb 2025 03:11:48 +0100 Subject: [PATCH 34/65] Indicate that locks are exclusive/write locks. (#394) --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 7995f760..57c6bd89 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,7 +57,7 @@ working directory is currently used. To do so, create a :class:`FileLock Date: Mon, 10 Feb 2025 10:48:39 -0800 Subject: [PATCH 35/65] [pre-commit.ci] pre-commit autoupdate (#395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.4...v0.9.6) - [github.com/rbubley/mirrors-prettier: v3.4.2 → v3.5.0](https://github.com/rbubley/mirrors-prettier/compare/v3.4.2...v3.5.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- src/filelock/asyncio.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14dbb394..5041b1e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.4" + rev: "v0.9.6" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.4.2" # Use the sha / tag you want to point at + rev: "v3.5.0" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: diff --git a/src/filelock/asyncio.py b/src/filelock/asyncio.py index 252de203..1c9c9f05 100644 --- a/src/filelock/asyncio.py +++ b/src/filelock/asyncio.py @@ -1,4 +1,4 @@ -"""An asyncio-based implementation of the file lock.""" # noqa: A005 +"""An asyncio-based implementation of the file lock.""" from __future__ import annotations From 468ba431d1d40b494724f3269d3241a5d1ddd411 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 14:04:55 -0800 Subject: [PATCH 36/65] [pre-commit.ci] pre-commit autoupdate (#396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/rbubley/mirrors-prettier: v3.5.0 → v3.5.1](https://github.com/rbubley/mirrors-prettier/compare/v3.5.0...v3.5.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5041b1e4..376b5c54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.0" # Use the sha / tag you want to point at + rev: "v3.5.1" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From 82f5a2d6c260a43dc88b51121087bdfa21fb205f Mon Sep 17 00:00:00 2001 From: Juniper Tyree <50025784+juntyr@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:32:44 +0200 Subject: [PATCH 37/65] Support fcntl check on Emscripten (#398) * Support fcntl check on Emscripten * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix `fcntl.flock` typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/filelock/_unix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/filelock/_unix.py b/src/filelock/_unix.py index 04f590da..b2fd0f33 100644 --- a/src/filelock/_unix.py +++ b/src/filelock/_unix.py @@ -26,7 +26,9 @@ def _release(self) -> None: else: # pragma: win32 no cover try: import fcntl - except ImportError: + + _ = (fcntl.flock, fcntl.LOCK_EX, fcntl.LOCK_NB, fcntl.LOCK_UN) + except (ImportError, AttributeError): pass else: has_fcntl = True From efba779022cf62956efe88ea3c65620098fbf75c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:15:45 -0800 Subject: [PATCH 38/65] [pre-commit.ci] pre-commit autoupdate (#401) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.1 → 0.31.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.1...0.31.2) - [github.com/astral-sh/ruff-pre-commit: v0.9.6 → v0.9.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.6...v0.9.7) - [github.com/rbubley/mirrors-prettier: v3.5.1 → v3.5.2](https://github.com/rbubley/mirrors-prettier/compare/v3.5.1...v3.5.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 376b5c54..461277de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.6" + rev: "v0.9.7" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.1" # Use the sha / tag you want to point at + rev: "v3.5.2" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From 717d7e018c6e3c3cd00a0f35c775ebbbafda41cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:49:09 -0800 Subject: [PATCH 39/65] [pre-commit.ci] pre-commit autoupdate (#403) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/pyproject-fmt: v2.5.0 → v2.5.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.5.0...v2.5.1) - [github.com/astral-sh/ruff-pre-commit: v0.9.7 → v0.9.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.7...v0.9.9) - [github.com/rbubley/mirrors-prettier: v3.5.2 → v3.5.3](https://github.com/rbubley/mirrors-prettier/compare/v3.5.2...v3.5.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 461277de..bb27ec67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,17 +20,17 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.5.0" + rev: "v2.5.1" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.7" + rev: "v0.9.9" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.2" # Use the sha / tag you want to point at + rev: "v3.5.3" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From 129a1efb6a0e1c40ff7c0b094db1b888fcb46d93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:07:34 -0700 Subject: [PATCH 40/65] [pre-commit.ci] pre-commit autoupdate (#405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.2 → 0.31.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.2...0.31.3) - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.9.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.9...v0.9.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb27ec67..1e776892 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.9" + rev: "v0.9.10" hooks: - id: ruff-format - id: ruff From a686b85cd707d4466c49dd9cecb006ffad439226 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 11:47:33 -0700 Subject: [PATCH 41/65] [pre-commit.ci] pre-commit autoupdate (#406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.10...v0.11.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e776892..be5c49d9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.10" + rev: "v0.11.2" hooks: - id: ruff-format - id: ruff From 344818caa10b33209a80fea5ea97c4b99c416253 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 10:10:59 -0700 Subject: [PATCH 42/65] [pre-commit.ci] pre-commit autoupdate (#407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.3 → 0.32.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.3...0.32.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be5c49d9..ea7af6dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.1 hooks: - id: check-github-workflows args: ["--verbose"] From 02fb52e5a5c4a9b862ce2221d4fe92a30ff031ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 12:37:39 -0700 Subject: [PATCH 43/65] [pre-commit.ci] pre-commit autoupdate (#410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.2 → v0.11.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.2...v0.11.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea7af6dd..8f42034e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.2" + rev: "v0.11.4" hooks: - id: ruff-format - id: ruff From bcad0f5873617a4ccdbff992c394742816529901 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 10:42:28 -0500 Subject: [PATCH 44/65] [pre-commit.ci] pre-commit autoupdate (#411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.32.1 → 0.33.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.32.1...0.33.0) - [github.com/astral-sh/ruff-pre-commit: v0.11.4 → v0.11.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.4...v0.11.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f42034e..516af67c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.1 + rev: 0.33.0 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.4" + rev: "v0.11.5" hooks: - id: ruff-format - id: ruff From e32530320aca79640dc0ac7e8eabfc2369ec0cbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:40:00 -0500 Subject: [PATCH 45/65] Bump astral-sh/setup-uv from 5 to 6 (#413) Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 6. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 08b5aba9..cee62e8a 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -36,7 +36,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -90,7 +90,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: enable-cache: true cache-dependency-glob: "pyproject.toml" @@ -144,7 +144,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: enable-cache: true cache-dependency-glob: "pyproject.toml" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f063e965..68578959 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 with: enable-cache: true cache-dependency-glob: "pyproject.toml" From 50b382482c494f818c81ff8f06548e475439792f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:41:33 -0500 Subject: [PATCH 46/65] [pre-commit.ci] pre-commit autoupdate (#412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.5 → v0.11.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.5...v0.11.6) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 516af67c..aac26382 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.5" + rev: "v0.11.6" hooks: - id: ruff-format - id: ruff From 2131ef247d16513e9cc8f05f8aceb60741343a76 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:26:42 -0500 Subject: [PATCH 47/65] [pre-commit.ci] pre-commit autoupdate (#414) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.6 → v0.11.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.6...v0.11.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aac26382..959e2315 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.6" + rev: "v0.11.7" hooks: - id: ruff-format - id: ruff From 7c15554112d78cb74333fa4c3adc1adf0227a515 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 15:15:58 -0500 Subject: [PATCH 48/65] [pre-commit.ci] pre-commit autoupdate (#415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.7 → v0.11.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.7...v0.11.8) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 959e2315..c946cba5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.7" + rev: "v0.11.8" hooks: - id: ruff-format - id: ruff From c3658081013f81640ba1648c187db306248cee25 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 09:50:18 -0500 Subject: [PATCH 49/65] [pre-commit.ci] pre-commit autoupdate (#417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.11.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c946cba5..0dc1e159 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.8" + rev: "v0.11.9" hooks: - id: ruff-format - id: ruff From 17e49036870c5cfeeb5173f52139ff055440a349 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 12:56:00 -0500 Subject: [PATCH 50/65] [pre-commit.ci] pre-commit autoupdate (#418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.9 → v0.11.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.9...v0.11.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0dc1e159..bfd5bceb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.9" + rev: "v0.11.10" hooks: - id: ruff-format - id: ruff From 28df647ed959c5fc5a0b1be145d0d7514056d8a3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 07:43:56 -0700 Subject: [PATCH 51/65] [pre-commit.ci] pre-commit autoupdate (#419) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfd5bceb..f79cfb0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.5.1" + rev: "v2.6.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.10" + rev: "v0.11.11" hooks: - id: ruff-format - id: ruff From c73facda4df8a77ff92fb02df64bcd610623883b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 21:38:46 -0700 Subject: [PATCH 52/65] [pre-commit.ci] pre-commit autoupdate (#420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.11 → v0.11.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.11...v0.11.13) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f79cfb0e..ad7ace3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.11" + rev: "v0.11.13" hooks: - id: ruff-format - id: ruff From 6762fef78e82705490b91e2ac05d9f196b3dba0b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 10:14:23 -0700 Subject: [PATCH 53/65] [pre-commit.ci] pre-commit autoupdate (#422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.33.0 → 0.33.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.33.0...0.33.1) - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.1) - [github.com/rbubley/mirrors-prettier: v3.5.3 → v3.6.2](https://github.com/rbubley/mirrors-prettier/compare/v3.5.3...v3.6.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad7ace3b..47ec00a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.33.0 + rev: 0.33.1 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,13 +24,13 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.13" + rev: "v0.12.1" hooks: - id: ruff-format - id: ruff args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.5.3" # Use the sha / tag you want to point at + rev: "v3.6.2" # Use the sha / tag you want to point at hooks: - id: prettier additional_dependencies: From 38ed4d2db4dba89831c21dd1724845a87f087912 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 08:03:14 -0700 Subject: [PATCH 54/65] [pre-commit.ci] pre-commit autoupdate (#423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.33.1 → 0.33.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.33.1...0.33.2) - [github.com/astral-sh/ruff-pre-commit: v0.12.1 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.1...v0.12.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47ec00a8..9fc90301 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.33.1 + rev: 0.33.2 hooks: - id: check-github-workflows args: ["--verbose"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.1" + rev: "v0.12.2" hooks: - id: ruff-format - id: ruff From d3a8b6dae3a4a82e192d6659c3159a23da63b5a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 12:08:56 -0700 Subject: [PATCH 55/65] [pre-commit.ci] pre-commit autoupdate (#424) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.2 → v0.12.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.2...v0.12.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fc90301..591d3fd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.2" + rev: "v0.12.3" hooks: - id: ruff-format - id: ruff From 6b097e76de603d9be6a24c5058b6fe53ef003afd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:58:11 -0700 Subject: [PATCH 56/65] [pre-commit.ci] pre-commit autoupdate (#425) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.3 → v0.12.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.3...v0.12.4) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- tests/test_filelock.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 591d3fd3..27567661 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.3" + rev: "v0.12.4" hooks: - id: ruff-format - id: ruff diff --git a/tests/test_filelock.py b/tests/test_filelock.py index b071396e..2dba737c 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -616,8 +616,8 @@ def test_soft_errors(tmp_path: Path, mocker: MockerFixture) -> None: def _check_file_read_write(txt_file: Path) -> None: for _ in range(3): uuid = str(uuid4()) - txt_file.write_text(uuid) - assert txt_file.read_text() == uuid + txt_file.write_text(uuid, encoding="utf-8") + assert txt_file.read_text(encoding="utf-8") == uuid @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock]) From b198a096d2bae58596479497d18a82bbeec515c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:27:37 -0700 Subject: [PATCH 57/65] [pre-commit.ci] pre-commit autoupdate (#426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.4 → v0.12.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.4...v0.12.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27567661..cf2bcccb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.4" + rev: "v0.12.5" hooks: - id: ruff-format - id: ruff From 18cdb5d1c78a7a459463480303e9820f33cdf041 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 10:21:02 -0700 Subject: [PATCH 58/65] [pre-commit.ci] pre-commit autoupdate (#427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/tox-dev/tox-ini-fmt: 1.5.0 → 1.6.0](https://github.com/tox-dev/tox-ini-fmt/compare/1.5.0...1.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.12.5 → v0.12.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.5...v0.12.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf2bcccb..fb42fbfb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: codespell additional_dependencies: ["tomli>=2.2.1"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.5.0" + rev: "1.6.0" hooks: - id: tox-ini-fmt args: ["-p", "fix"] @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.5" + rev: "v0.12.7" hooks: - id: ruff-format - id: ruff From 78d02cb5ff42b22a56ad1a36755361a6b4601765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:08:58 -0700 Subject: [PATCH 59/65] Bump actions/download-artifact from 4 to 5 (#428) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index cee62e8a..c5b6daab 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -108,7 +108,7 @@ jobs: env: UV_PYTHON_PREFERENCE: only-managed - name: Download coverage data - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: path: .tox pattern: .coverage.* diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68578959..8590fb98 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,7 +38,7 @@ jobs: id-token: write steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: ${{ env.dists-artifact-name }} path: dist/ From bc972b33bf253bb9f08db32b19ffd4119a74706e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:31:52 -0700 Subject: [PATCH 60/65] [pre-commit.ci] pre-commit autoupdate (#429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.12.7 → v0.12.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.7...v0.12.8) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb42fbfb..0da89b13 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -24,7 +24,7 @@ repos: hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.12.7" + rev: "v0.12.8" hooks: - id: ruff-format - id: ruff From 77d02f5ada3a1a92167b1beee35a7815cbde0fcf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 11:51:18 -0700 Subject: [PATCH 61/65] Bump actions/checkout from 4 to 5 (#430) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index c5b6daab..5f67408c 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -32,7 +32,7 @@ jobs: - macos-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv @@ -86,7 +86,7 @@ jobs: runs-on: ubuntu-latest needs: test steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv @@ -140,7 +140,7 @@ jobs: exclude: - { os: windows-latest, tox_env: readme } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8590fb98..d3a17d54 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Install the latest version of uv From 0c54837e318ebe8a692b529722430cb38134bf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 13 Aug 2025 08:04:51 -0700 Subject: [PATCH 62/65] Add support for 3.14 (#432) --- .github/workflows/check.yaml | 106 ++++++++++------------- .github/workflows/release.yaml | 24 ++---- .pre-commit-config.yaml | 11 ++- .readthedocs.yml | 17 ++-- pyproject.toml | 74 ++++++++++++----- src/filelock/asyncio.py | 3 +- tox.ini | 111 ------------------------- tox.toml | 148 +++++++++++++++++++++++++++++++++ 8 files changed, 266 insertions(+), 228 deletions(-) delete mode 100644 tox.ini create mode 100644 tox.toml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 5f67408c..daed41ee 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -1,4 +1,4 @@ -name: check +name: "🛠️ check" on: workflow_dispatch: push: @@ -14,65 +14,59 @@ concurrency: jobs: test: - name: test ${{ matrix.py }} - ${{ matrix.os }} + name: "🧪 Test ${{ matrix.py }} - ${{ matrix.os }}" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: py: - - "pypy3.10" # ahead to start it earlier because takes longer + - "3.14" - "3.13" - "3.12" - "3.11" - "3.10" - "3.9" + - "pypy3.11" os: - - ubuntu-latest - - windows-latest - - macos-latest + - ubuntu-24.04 + - windows-2025 + - macos-15 + exclude: + - { os: windows-2025, py: pypy3.11 } steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install the latest version of uv + - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - cache-dependency-glob: "pyproject.toml" - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Add .local/bin to Windows PATH - if: runner.os == 'Windows' - shell: bash - run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH - - name: Install tox + - name: "🧪 Install tox" run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv - - name: Install Python + - name: "🐍 Install Python" run: uv python install --python-preference only-managed ${{ matrix.py }} - - name: Setup test suite + - name: "⚙️ Setup test suite" run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }} env: UV_PYTHON_PREFERENCE: only-managed - - name: Run test suite - if: ${{ !startsWith(matrix.py, 'pypy')}} - run: tox run --skip-pkg-install -e ${{ matrix.py }} - env: - PYTEST_ADDOPTS: "-vv --durations=20" - DIFF_AGAINST: HEAD - UV_PYTHON_PREFERENCE: only-managed - - name: Run test suite without coverage - if: ${{ startsWith(matrix.py, 'pypy')}} - run: tox run --skip-pkg-install -e ${{ matrix.py }} -- + - name: "✅ Run test suite" + run: | + if [[ "${{ matrix.py }}" == pypy* ]]; then + tox run --skip-pkg-install -e ${{ matrix.py }} -- + else + tox run --skip-pkg-install -e ${{ matrix.py }} + fi + shell: bash env: PYTEST_ADDOPTS: "-vv --durations=20" UV_PYTHON_PREFERENCE: only-managed - - name: Rename coverage report file + DIFF_AGAINST: HEAD + - name: "📝 Rename coverage report file" if: ${{ !startsWith(matrix.py, 'pypy')}} run: | import os; import sys os.rename(f".tox/.coverage.${{ matrix.py }}", f".tox/.coverage.${{ matrix.py }}-{sys.platform}") shell: python - - name: Upload coverage data + - name: "📦 Upload coverage data" if: ${{ !startsWith(matrix.py, 'pypy')}} uses: actions/upload-artifact@v4 with: @@ -82,84 +76,68 @@ jobs: retention-days: 3 coverage: - name: Combine coverage - runs-on: ubuntu-latest + name: "📊 Combine coverage" + runs-on: ubuntu-24.04 needs: test steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install the latest version of uv + - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - cache-dependency-glob: "pyproject.toml" - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Add .local/bin to Windows PATH - if: runner.os == 'Windows' - shell: bash - run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH - - name: Install hatch + - name: "🧪 Install tox" run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv - - name: Build package to generate version + - name: "📦 Build package to generate version" run: uv build --python 3.13 --python-preference only-managed --wheel . --out-dir dist - - name: Setup coverage tool + - name: "⚙️ Setup coverage tool" run: tox -e coverage --notest env: UV_PYTHON_PREFERENCE: only-managed - - name: Download coverage data + - name: "⬇️ Download coverage data" uses: actions/download-artifact@v5 with: path: .tox pattern: .coverage.* merge-multiple: true - - name: Combine and report coverage + - name: "📊 Combine and report coverage" run: tox -e coverage --skip-pkg-install env: UV_PYTHON_PREFERENCE: only-managed - - name: Upload HTML report + - name: "📤 Upload HTML report" uses: actions/upload-artifact@v4 with: name: html-report path: .tox/htmlcov check: - name: ${{ matrix.tox_env }} - ${{ matrix.os }} + name: "🔎 ${{ matrix.tox_env }} - ${{ matrix.os }}" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: - - ubuntu-latest - - windows-latest + - ubuntu-24.04 + - windows-2025 tox_env: - dev - type - docs - - readme + - pkg_meta exclude: - - { os: windows-latest, tox_env: readme } + - { os: windows-2025, tox_env: pkg_meta } steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install the latest version of uv + - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - cache-dependency-glob: "pyproject.toml" - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Add .local/bin to Windows PATH - if: runner.os == 'Windows' - shell: bash - run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH - - name: Install tox + - name: "🧪 Install tox" run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv - - name: Setup test suite + - name: "⚙️ Setup test suite" run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} env: UV_PYTHON_PREFERENCE: only-managed - - name: Run test suite + - name: "✅ Run test suite" run: tox run --skip-pkg-install -e ${{ matrix.tox_env }} env: UV_PYTHON_PREFERENCE: only-managed diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d3a17d54..a5adf45a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Release to PyPI +name: 🚀Release to PyPI on: push: tags: ["*"] @@ -8,20 +8,16 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - - name: Install the latest version of uv + - name: "🔄 Install the latest version of uv" uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - cache-dependency-glob: "pyproject.toml" - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Build package + - name: "📦 Build package" run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist - - name: Store the distribution packages + - name: "📤 Store the distribution packages" uses: actions/upload-artifact@v4 with: name: ${{ env.dists-artifact-name }} @@ -30,19 +26,17 @@ jobs: release: needs: - build - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 environment: - name: release + name: "🚀 Release to PyPI" url: https://pypi.org/project/filelock/${{ github.ref_name }} permissions: id-token: write steps: - - name: Download all the dists + - name: "⬇️ Download all the dists" uses: actions/download-artifact@v5 with: name: ${{ env.dists-artifact-name }} path: dist/ - - name: Publish to PyPI + - name: "🚀 Publish to PyPI" uses: pypa/gh-action-pypi-publish@v1.12.4 - with: - attestations: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0da89b13..0a80e156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,11 +14,10 @@ repos: hooks: - id: codespell additional_dependencies: ["tomli>=2.2.1"] - - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "1.6.0" + - repo: https://github.com/tox-dev/tox-toml-fmt + rev: "v1.0.0" hooks: - - id: tox-ini-fmt - args: ["-p", "fix"] + - id: tox-toml-fmt - repo: https://github.com/tox-dev/pyproject-fmt rev: "v2.6.0" hooks: @@ -34,8 +33,8 @@ repos: hooks: - id: prettier additional_dependencies: - - prettier@3.4.2 - - "@prettier/plugin-xml@3.4.1" + - prettier@3.6.2 + - "@prettier/plugin-xml@3.4.2" - repo: meta hooks: - id: check-hooks-apply diff --git a/.readthedocs.yml b/.readthedocs.yml index ab301130..af60a61c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,15 +1,10 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-lts-latest tools: python: "3" -python: - install: - - method: pip - path: . - extra_requirements: - - docs -sphinx: - builder: html - configuration: docs/conf.py - fail_on_warning: true + commands: + - pip install uv + - uv venv + - uv pip install tox-uv + - .venv/bin/tox run -e docs -- diff --git a/pyproject.toml b/pyproject.toml index 64a7ef16..d0cefd83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] build-backend = "hatchling.build" requires = [ - "hatch-vcs>=0.4", + "hatch-vcs>=0.5", "hatchling>=1.27", ] @@ -40,30 +40,55 @@ classifiers = [ dynamic = [ "version", ] -optional-dependencies.docs = [ - "furo>=2024.8.6", - "sphinx>=8.1.3", - "sphinx-autodoc-typehints>=3", -] -optional-dependencies.testing = [ - "covdefaults>=2.3", - "coverage>=7.6.10", - "diff-cover>=9.2.1", - "pytest>=8.3.4", - "pytest-asyncio>=0.25.2", - "pytest-cov>=6", - "pytest-mock>=3.14", - "pytest-timeout>=2.3.1", - "virtualenv>=20.28.1", -] -optional-dependencies.typing = [ - "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" urls.Source = "https://github.com/tox-dev/py-filelock" urls.Tracker = "https://github.com/tox-dev/py-filelock/issues" +[dependency-groups] +dev = [ + { include-group = "coverage" }, + { include-group = "docs" }, + { include-group = "fix" }, + { include-group = "pkg-meta" }, + { include-group = "test" }, + { include-group = "type" }, +] + +test = [ + "covdefaults>=2.3", + "diff-cover>=9.6", + "pytest>=8.4.1", + "pytest-asyncio>=1.1", + "pytest-cov>=6.2.1", + "pytest-mock>=3.14.1", + "pytest-timeout>=2.4", + "virtualenv>=20.33.1", +] +type = [ + "mypy>=1.17.1", + "typing-extensions>=4.14.1; python_version<'3.11'", + { include-group = "test" }, +] +docs = [ + "furo>=2025.7.19", + "sphinx>=8.2.3", + "sphinx-autodoc-typehints>=3.2", +] +fix = [ + "pre-commit-uv>=4.1.4", +] +pkg-meta = [ + "check-wheel-contents>=0.6.3", + "twine>=6.1", + "uv>=0.8.5", +] +coverage = [ + "covdefaults>=2.3", + "coverage[toml]>=7.10.2", + "diff-cover>=9.6", +] + [tool.hatch] build.hooks.vcs.version-file = "src/filelock/version.py" build.targets.sdist.include = [ @@ -119,6 +144,15 @@ max_supported_python = "3.13" [tool.pytest.ini_options] asyncio_default_fixture_loop_scope = "session" +testpaths = [ + "tests", +] +verbosity_assertions = 2 +filterwarnings = [ + "error", + "ignore:unclosed database in None: # type: ignore[override] _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename) async def _run_internal_method(self, method: Callable[[], Any]) -> None: - if asyncio.iscoroutinefunction(method): + if iscoroutinefunction(method): await method() elif self.run_in_executor: loop = self.loop or asyncio.get_running_loop() diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 960e01e0..00000000 --- a/tox.ini +++ /dev/null @@ -1,111 +0,0 @@ -[tox] -requires = - tox>=4.23.2 - tox-uv>=1.17 -env_list = - fix - 3.13 - 3.12 - 3.11 - 3.10 - 3.9 - type - coverage - docs - readme -skip_missing_interpreters = true - -[testenv] -description = run tests with {basepython} -package = wheel -wheel_build_env = .pkg -extras = - testing -pass_env = - PYTEST_ADDOPTS -set_env = - COVERAGE_FILE = {toxworkdir}{/}.coverage.{envname} -commands = - pytest {tty:--color=yes} {posargs: \ - --junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}filelock --cov {toxinidir}{/}tests \ - --cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \ - --cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \ - tests - diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}{/}coverage.{envname}.xml} - -[testenv:fix] -description = format the code base to adhere to our styles, and complain about what we cannot do automatically -base_python = python3.10 -skip_install = true -deps = - pre-commit>=4.0.1 -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.14.1 -set_env = - {tty:MYPY_FORCE_COLOR = 1} -commands = - mypy --strict src/filelock - mypy --strict tests - -[testenv:coverage] -description = combine coverage files and generate diff (against DIFF_AGAINST defaulting to origin/main) -skip_install = true -deps = - covdefaults>=2.3 - coverage[toml]>=7.6.10 - diff-cover>=9.2.1 -extras = -parallel_show_output = true -pass_env = - DIFF_AGAINST -set_env = - COVERAGE_FILE = {toxworkdir}/.coverage -commands = - coverage combine - coverage report --skip-covered --show-missing - coverage xml -o {toxworkdir}/coverage.xml - coverage html -d {toxworkdir}/htmlcov - diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml -depends = - 3.13 - 3.12 - 3.11 - 3.10 - 3.9 - 3.8 - -[testenv:docs] -description = build documentation -extras = - docs -commands = - sphinx-build -d "{envtmpdir}{/}doctree" docs "{toxworkdir}{/}docs_out" --color -b html -W {posargs} - python -c 'print(r"documentation available under file://{toxworkdir}{/}docs_out{/}index.html")' - -[testenv:readme] -description = check that the long description is valid -skip_install = true -deps = - check-wheel-contents>=0.6.1 - twine>=6.0.1 - uv>=0.5.18 -commands = - uv build --sdist --wheel --out-dir {envtmpdir} . - twine check {envtmpdir}{/}* - check-wheel-contents --no-config {envtmpdir} - -[testenv:dev] -description = generate a DEV environment -package = editable -extras = - docs - testing -commands = - uv pip tree - python -c 'import sys; print(sys.executable)' diff --git a/tox.toml b/tox.toml new file mode 100644 index 00000000..ad5d3a35 --- /dev/null +++ b/tox.toml @@ -0,0 +1,148 @@ +requires = [ "tox>=4.28.4" ] +env_list = [ "fix", "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "coverage", "type", "docs", "pkg_meta" ] +skip_missing_interpreters = true + +[env_run_base] +description = "run the tests with pytest under {env_name}" +package = "wheel" +wheel_build_env = ".pkg" +dependency_groups = [ "test" ] +pass_env = [ "PYTEST_*", "SSL_CERT_FILE" ] +set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" } +commands = [ + [ + "pytest", + "--durations", + "10", + "--junitxml", + "{env_tmp_dir}{/}junit.xml", + { replace = "posargs", extend = true, default = [ + "--no-cov-on-fail", + "--cov", + "{env_site_packages_dir}{/}filelock", + "--cov", + "{tox_root}{/}tests", + "--cov-config", + "{tox_root}{/}pyproject.toml", + "--cov-context", + "test", + "--cov-report", + "term-missing:skip-covered", + "--cov-report", + "html:{env_tmp_dir}{/}htmlcov", + "--cov-report", + "xml:{env_tmp_dir}{/}coverage.xml", + ] }, + + "tests", + ], + { replace = "posargs", extend = true, default = [ + [ + "diff-cover", + "--compare-branch", + { replace = "env", name = "DIFF_AGAINST", default = "origin/main" }, + "{env_tmp_dir}{/}coverage.xml", + ], + ] }, +] + +[env.coverage] +description = "combine coverage files and generate diff (against DIFF_AGAINST defaulting to origin/main)" +skip_install = true +dependency_groups = [ "coverage" ] +pass_env = [ + { replace = "ref", of = [ + "env_run_base", + "pass_env", + ], extend = true }, + "DIFF_AGAINST", +] +set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage" } +commands = [ + [ "coverage", "combine" ], + [ "coverage", "report", "--skip-covered", "--show-missing" ], + [ "coverage", "xml", "-o", "{env_tmp_dir}{/}coverage.xml" ], + [ "coverage", "html", "-d", "{work_dir}{/}htmlcov" ], + [ + "diff-cover", + "--compare-branch", + { replace = "env", name = "DIFF_AGAINST", default = "origin/main" }, + "{env_tmp_dir}{/}coverage.xml", + ], +] +parallel_show_output = true +depends = [ "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9" ] + +[env.fix] +description = "format the code base to adhere to our styles, and complain about what we cannot do automatically" +skip_install = true +dependency_groups = [ "fix" ] +pass_env = [ + { replace = "ref", of = [ + "env_run_base", + "pass_env", + ], extend = true }, + "PROGRAMDATA", + "DISABLE_PRE_COMMIT_UV_PATCH", +] +commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure", { replace = "posargs", extend = true } ] ] + +[env.type] +description = "run type check on code base" +dependency_groups = [ "type" ] +commands = [ [ "mypy", "src{/}filelock" ], [ "mypy", "tests" ] ] + +[env.docs] +description = "build documentation" +dependency_groups = [ "docs" ] +commands = [ + [ + "sphinx-build", + "-d", + "{env_tmp_dir}{/}docs_tree", + "docs", + "{env:READTHEDOCS_OUTPUT:{work_dir}{/}docs_out}/html", + "--color", + "-b", + "html", + { replace = "posargs", default = [ ], extend = true }, + "-W", + ], + [ + "python", + "-c", + 'print(r"documentation available under file://{work_dir}{/}docs_out{/}index.html")', + ], +] + +[env.pkg_meta] +description = "check that the long description is valid" +skip_install = true +dependency_groups = [ "pkg_meta" ] +commands = [ + [ + "uv", + "build", + "--sdist", + "--wheel", + "--out-dir", + "{env_tmp_dir}", + ".", + ], + [ + "twine", + "check", + "{env_tmp_dir}{/}*", + ], + [ + "check-wheel-contents", + "--no-config", + "{env_tmp_dir}", + ], +] + +[env.dev] +description = "dev environment with all deps at {envdir}" +package = "editable" +dependency_groups = [ "dev" ] +commands = [ [ "uv", "pip", "list", "--format=columns" ], [ "python", "-c", 'print(r"{env_python}")' ] ] From 0dfc86eebd2c76ae959a409bcbc3112cc1ec5890 Mon Sep 17 00:00:00 2001 From: paultiq <104510378+paultiq@users.noreply.github.com> Date: Thu, 14 Aug 2025 00:15:03 -0400 Subject: [PATCH 63/65] add 3.14 to matrix (#433) --- .github/workflows/check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index daed41ee..1277b2ad 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -20,6 +20,7 @@ jobs: fail-fast: false matrix: py: + - "3.14t" - "3.14" - "3.13" - "3.12" From 66a428e97a874b44b0310072f6c974226f55a472 Mon Sep 17 00:00:00 2001 From: paultiq <104510378+paultiq@users.noreply.github.com> Date: Thu, 14 Aug 2025 00:19:34 -0400 Subject: [PATCH 64/65] Increase test coverage (#434) --- tests/test_async_filelock.py | 89 ++++++++++++++++++++++++++++++++++++ tests/test_filelock.py | 24 +++++++++- 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/tests/test_async_filelock.py b/tests/test_async_filelock.py index 643c6677..05062152 100644 --- a/tests/test_async_filelock.py +++ b/tests/test_async_filelock.py @@ -179,3 +179,92 @@ async def _release(self) -> None: # type: ignore[override] await lock.release() assert acquired assert released + + +@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) +@pytest.mark.asyncio +async def test_wait_message_logged( + lock_type: type[BaseAsyncFileLock], tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + caplog.set_level(logging.DEBUG) + lock_path = tmp_path / "a" + first_lock = lock_type(str(lock_path)) + second_lock = lock_type(str(lock_path), timeout=0.2) + + # Hold the lock so second_lock has to wait + await first_lock.acquire() + with pytest.raises(Timeout): + await second_lock.acquire() + assert any("waiting" in msg for msg in caplog.messages) + + +@pytest.mark.parametrize("lock_type", [AsyncSoftFileLock, AsyncFileLock]) +@pytest.mark.asyncio +async def test_attempting_to_acquire_branch( + lock_type: type[BaseAsyncFileLock], tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + caplog.set_level(logging.DEBUG) + + lock = lock_type(str(tmp_path / "a")) + await lock.acquire() + assert any("Attempting to acquire lock" in m for m in caplog.messages) + await lock.release() + + +@pytest.mark.asyncio +async def test_thread_local_run_in_executor(tmp_path: Path) -> None: # noqa: RUF029 + with pytest.raises(ValueError, match="run_in_executor is not supported when thread_local is True"): + AsyncSoftFileLock(str(tmp_path / "a"), thread_local=True, run_in_executor=True) + + +@pytest.mark.parametrize("lock_type", [AsyncSoftFileLock, AsyncFileLock]) +@pytest.mark.asyncio +async def test_attempting_to_acquire( + lock_type: type[BaseAsyncFileLock], tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + caplog.set_level(logging.DEBUG) + lock = lock_type(str(tmp_path / "a.lock"), run_in_executor=False) + await lock.acquire(timeout=0.1) + assert any("Attempting to acquire lock" in m for m in caplog.messages) + await lock.release() + + +@pytest.mark.parametrize("lock_type", [AsyncSoftFileLock, AsyncFileLock]) +@pytest.mark.asyncio +async def test_attempting_to_release( + lock_type: type[BaseAsyncFileLock], tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + caplog.set_level(logging.DEBUG) + lock = lock_type(str(tmp_path / "a.lock"), run_in_executor=False) + + await lock.acquire(timeout=0.1) # lock_counter = 1, is_locked = True + await lock.acquire(timeout=0.1) # lock_counter = 2 (reentrant) + await lock.release(force=True) + + assert any("Attempting to release lock" in m for m in caplog.messages) + assert any("released" in m for m in caplog.messages) + + +@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) +@pytest.mark.asyncio +async def test_release_early_exit_when_unlocked(lock_type: type[BaseAsyncFileLock], tmp_path: Path) -> None: + lock = lock_type(str(tmp_path / "a.lock"), run_in_executor=False) + assert not lock.is_locked + await lock.release() + assert not lock.is_locked + + +@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock]) +@pytest.mark.asyncio +async def test_release_nonzero_counter_exit( + lock_type: type[BaseAsyncFileLock], tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + caplog.set_level(logging.DEBUG) + lock = lock_type(str(tmp_path / "a.lock"), run_in_executor=False) + await lock.acquire() + await lock.acquire() + await lock.release() # counter goes 2→1 + assert lock.lock_counter == 1 + assert lock.is_locked + assert not any("Attempting to release" in m for m in caplog.messages) + await lock.release() diff --git a/tests/test_filelock.py b/tests/test_filelock.py index 2dba737c..91f7682e 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -691,7 +691,8 @@ def __init__( my_param: int = 0, **kwargs: dict[str, Any], # noqa: ARG002 ) -> None: - super().__init__(lock_file, timeout, mode, thread_local, blocking=True, is_singleton=True) + super().__init__(lock_file, timeout, mode, thread_local, is_singleton=True) + self.blocking = True self.my_param = my_param lock_path = tmp_path / "a" @@ -814,3 +815,24 @@ def __init__(self, file_path: str) -> None: lock_path = tmp_path / "a" lock = FilePathLock(str(lock_path)) assert lock.lock_file == str(lock_path) + ".lock" + + +@pytest.mark.parametrize( + ("lock_type", "expected_exc"), + [ + (SoftFileLock, TimeoutError), + (FileLock, TimeoutError) if sys.platform == "win32" else (FileLock, PermissionError), + ], +) +def test_mtime_zero_exit_branch( + lock_type: type[BaseFileLock], expected_exc: type[BaseException], tmp_path: Path +) -> None: + p = tmp_path / "z.lock" + p.touch() + Path(p).chmod(0o444) + os.utime(p, (0, 0)) + + lock = lock_type(str(p)) + + with pytest.raises(expected_exc): + lock.acquire(timeout=0) From 8d1009f08a6a64624fad91d1079062ef31b8c2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 14 Aug 2025 09:53:22 -0700 Subject: [PATCH 65/65] Update release.yaml --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a5adf45a..2bc16d46 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: - build runs-on: ubuntu-24.04 environment: - name: "🚀 Release to PyPI" + name: "Release to PyPI" url: https://pypi.org/project/filelock/${{ github.ref_name }} permissions: id-token: write