Skip to content

Commit bb0f808

Browse files
[pre-commit.ci] pre-commit autoupdate (#259)
updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](astral-sh/ruff-pre-commit@v0.0.282...v0.0.284) - [github.com/tox-dev/pyproject-fmt: 0.13.0 → 0.13.1](tox-dev/pyproject-fmt@0.13.0...0.13.1) Signed-off-by: Bernát Gábor <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a4ac0b0 commit bb0f808

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
py:
21-
- "3.12.0-beta.2"
21+
- "3.12.0-rc.1"
2222
- "3.11"
2323
- "3.10"
2424
- "3.9"
2525
- "3.8"
26-
- "3.7"
2726
- "pypy3.9"
2827
- "pypy3.8"
29-
- "pypy3.7"
3028
os:
3129
- ubuntu-latest
3230
- windows-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: "v0.0.282"
8+
rev: "v0.0.284"
99
hooks:
1010
- id: ruff
1111
args: [--fix, --exit-non-zero-on-fix]
@@ -19,10 +19,10 @@ repos:
1919
- id: tox-ini-fmt
2020
args: ["-p", "fix"]
2121
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: "0.13.0"
22+
rev: "0.13.1"
2323
hooks:
2424
- id: pyproject-fmt
25-
additional_dependencies: ["tox>=4.6.4"]
25+
additional_dependencies: ["tox>=4.8"]
2626
- repo: https://github.com/pre-commit/mirrors-prettier
2727
rev: "v3.0.1"
2828
hooks:

pyproject.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.3",
5-
"hatchling>=1.17.1",
5+
"hatchling>=1.18",
66
]
77

88
[project]
@@ -18,15 +18,14 @@ keywords = [
1818
]
1919
license = "Unlicense"
2020
maintainers = [{ name = "Bernát Gábor", email = "[email protected]" }]
21-
requires-python = ">=3.7"
21+
requires-python = ">=3.8"
2222
classifiers = [
2323
"Development Status :: 5 - Production/Stable",
2424
"Intended Audience :: Developers",
2525
"License :: OSI Approved :: The Unlicense (Unlicense)",
2626
"Operating System :: OS Independent",
2727
"Programming Language :: Python",
2828
"Programming Language :: Python :: 3 :: Only",
29-
"Programming Language :: Python :: 3.7",
3029
"Programming Language :: Python :: 3.8",
3130
"Programming Language :: Python :: 3.9",
3231
"Programming Language :: Python :: 3.10",
@@ -39,15 +38,18 @@ classifiers = [
3938
dynamic = [
4039
"version",
4140
]
41+
dependencies = [
42+
'typing-extensions>=4.7.1; python_version < "3.11"',
43+
]
4244
optional-dependencies.docs = [
43-
"furo>=2023.5.20",
44-
"sphinx>=7.0.1",
45-
"sphinx-autodoc-typehints!=1.23.4,>=1.23.3",
45+
"furo>=2023.7.26",
46+
"sphinx>=7.1.2",
47+
"sphinx-autodoc-typehints!=1.23.4,>=1.24",
4648
]
4749
optional-dependencies.testing = [
4850
"covdefaults>=2.3",
49-
"coverage>=7.2.7",
50-
"diff-cover>=7.6",
51+
"coverage>=7.3",
52+
"diff-cover>=7.7",
5153
"pytest>=7.4",
5254
"pytest-cov>=4.1",
5355
"pytest-mock>=3.11.1",
@@ -69,7 +71,7 @@ line-length = 120
6971
[tool.ruff]
7072
select = ["ALL"]
7173
line-length = 120
72-
target-version = "py37"
74+
target-version = "py38"
7375
isort = {known-first-party = ["filelock"], required-imports = ["from __future__ import annotations"]}
7476
ignore = [
7577
"ANN101", # Missing type annotation for `self` in method

src/filelock/_api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
from ._error import Timeout
1414

1515
if TYPE_CHECKING:
16+
import sys
1617
from types import TracebackType
1718

19+
if sys.version_info >= (3, 11): # pragma: no cover (py311+)
20+
from typing import Self
21+
else: # pragma: no cover (<py311)
22+
from typing_extensions import Self
23+
24+
1825
_LOGGER = logging.getLogger("filelock")
1926

2027

@@ -246,7 +253,7 @@ def release(self, force: bool = False) -> None: # noqa: FBT001, FBT002
246253
self._context.lock_counter = 0
247254
_LOGGER.debug("Lock %s released on %s", lock_id, lock_filename)
248255

249-
def __enter__(self) -> BaseFileLock:
256+
def __enter__(self) -> Self:
250257
"""
251258
Acquire the lock.
252259

tests/test_filelock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
@pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
2929
def test_simple(
3030
lock_type: type[BaseFileLock],
31-
path_type: type[str] | type[Path],
31+
path_type: type[str | Path],
3232
filename: str,
3333
tmp_path: Path,
3434
caplog: pytest.LogCaptureFixture,

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ commands =
4646
[testenv:type]
4747
description = run type check on code base
4848
deps =
49-
mypy==1.4.1
49+
mypy==1.5
5050
set_env =
5151
{tty:MYPY_FORCE_COLOR = 1}
5252
commands =
@@ -58,8 +58,8 @@ description = combine coverage files and generate diff (against DIFF_AGAINST def
5858
skip_install = true
5959
deps =
6060
covdefaults>=2.3
61-
coverage[toml]>=7.2.7
62-
diff-cover>=7.6
61+
coverage[toml]>=7.3
62+
diff-cover>=7.7
6363
extras =
6464
parallel_show_output = true
6565
pass_env =

0 commit comments

Comments
 (0)