| 1 |
[build-system] |
| 2 |
build-backend = "hatchling.build" |
| 3 |
requires = [ |
| 4 |
"hatch-vcs>=0.5", |
| 5 |
"hatchling>=1.29", |
| 6 |
] |
| 7 |
|
| 8 |
[project] |
| 9 |
name = "filelock" |
| 10 |
description = "A platform independent file lock." |
| 11 |
readme = "README.md" |
| 12 |
keywords = [ |
| 13 |
"application", |
| 14 |
"cache", |
| 15 |
"directory", |
| 16 |
"log", |
| 17 |
"user", |
| 18 |
] |
| 19 |
license = "MIT" |
| 20 |
maintainers = [ |
| 21 |
{ name = "Bernát Gábor", email = "[email protected]" }, |
| 22 |
] |
| 23 |
requires-python = ">=3.10" |
| 24 |
classifiers = [ |
| 25 |
"Development Status :: 5 - Production/Stable", |
| 26 |
"Intended Audience :: Developers", |
| 27 |
"License :: OSI Approved :: MIT License", |
| 28 |
"Operating System :: OS Independent", |
| 29 |
"Programming Language :: Python", |
| 30 |
"Programming Language :: Python :: 3 :: Only", |
| 31 |
"Programming Language :: Python :: 3.10", |
| 32 |
"Programming Language :: Python :: 3.11", |
| 33 |
"Programming Language :: Python :: 3.12", |
| 34 |
"Programming Language :: Python :: 3.13", |
| 35 |
"Programming Language :: Python :: 3.14", |
| 36 |
"Programming Language :: Python :: 3.15", |
| 37 |
"Topic :: Internet", |
| 38 |
"Topic :: Software Development :: Libraries", |
| 39 |
"Topic :: System", |
| 40 |
] |
| 41 |
dynamic = [ |
| 42 |
"version", |
| 43 |
] |
| 44 |
urls.Documentation = "https://py-filelock.readthedocs.io" |
| 45 |
urls.Homepage = "https://github.com/tox-dev/py-filelock" |
| 46 |
urls.Source = "https://github.com/tox-dev/py-filelock" |
| 47 |
urls.Tracker = "https://github.com/tox-dev/py-filelock/issues" |
| 48 |
|
| 49 |
[dependency-groups] |
| 50 |
dev = [ |
| 51 |
{ include-group = "coverage" }, |
| 52 |
{ include-group = "docs" }, |
| 53 |
{ include-group = "fix" }, |
| 54 |
{ include-group = "pkg-meta" }, |
| 55 |
{ include-group = "release" }, |
| 56 |
{ include-group = "test" }, |
| 57 |
{ include-group = "type" }, |
| 58 |
] |
| 59 |
test = [ |
| 60 |
"covdefaults>=2.3", |
| 61 |
"diff-cover>=10.2", |
| 62 |
"exceptiongroup>=1.2; python_version<'3.11'", |
| 63 |
"pytest>=9.0.3", |
| 64 |
"pytest-asyncio>=1.3", |
| 65 |
"pytest-cov>=7.1", |
| 66 |
"pytest-mock>=3.15.1", |
| 67 |
"pytest-randomly>=3.16", |
| 68 |
"pytest-timeout>=2.4", |
| 69 |
"virtualenv>=21.2", |
| 70 |
] |
| 71 |
type = [ |
| 72 |
"ty>=0.0.30", |
| 73 |
{ include-group = "docs" }, |
| 74 |
{ include-group = "release" }, |
| 75 |
{ include-group = "test" }, |
| 76 |
] |
| 77 |
docs = [ |
| 78 |
"furo>=2025.12.19", |
| 79 |
"sphinx>=9.1", |
| 80 |
"sphinx-autodoc-typehints>=3.9.11", |
| 81 |
"sphinx-copybutton>=0.5.2", |
| 82 |
"sphinx-design>=0.7", |
| 83 |
"sphinx-llm>=0.4.1", |
| 84 |
"sphinx-sitemap>=2.9", |
| 85 |
"sphinxcontrib-mermaid>=2.0.1", |
| 86 |
"sphinxcontrib-towncrier>=0.5.0a0", |
| 87 |
"sphinxext-opengraph>=0.13", |
| 88 |
"towncrier>=24.8", |
| 89 |
] |
| 90 |
coverage = [ |
| 91 |
"covdefaults>=2.3", |
| 92 |
"coverage[toml]>=7.13.5", |
| 93 |
"diff-cover>=10.2", |
| 94 |
] |
| 95 |
fix = [ |
| 96 |
"pre-commit-uv>=4.2.1", |
| 97 |
] |
| 98 |
pkg-meta = [ |
| 99 |
"check-wheel-contents>=0.6.3", |
| 100 |
"twine>=6.2", |
| 101 |
"uv>=0.11.5", |
| 102 |
] |
| 103 |
release = [ |
| 104 |
"towncrier>=24.8", |
| 105 |
] |
| 106 |
|
| 107 |
[tool.hatch] |
| 108 |
version.source = "vcs" |
| 109 |
build.hooks.vcs.version-file = "src/filelock/version.py" |
| 110 |
build.targets.sdist.include = [ |
| 111 |
"/src", |
| 112 |
"/tasks", |
| 113 |
"/tests", |
| 114 |
"/tox.toml", |
| 115 |
] |
| 116 |
|
| 117 |
[tool.ruff] |
| 118 |
line-length = 120 |
| 119 |
format.preview = true |
| 120 |
format.docstring-code-line-length = 100 |
| 121 |
format.docstring-code-format = true |
| 122 |
lint.select = [ |
| 123 |
"ALL", |
| 124 |
] |
| 125 |
lint.ignore = [ |
| 126 |
"CPY", # No copyright statements |
| 127 |
"DOC", # no support yet |
| 128 |
"escape-sequence-in-docstring", # Use `r"""` if any backslashes in a docstring |
| 129 |
"hardcoded-bind-all-interfaces", # Possible binding to all interface |
| 130 |
"incorrect-blank-line-before-class", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible |
| 131 |
"missing-blank-line-after-summary", # 1 blank line required between summary line and description |
| 132 |
"missing-trailing-comma", # Conflict with formatter |
| 133 |
"multi-line-summary-first-line", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible |
| 134 |
"non-empty-init-module", # `__init__` module should only contain docstrings and re-exports |
| 135 |
"non-imperative-mood", # First line of docstring should be in imperative mood |
| 136 |
"single-line-implicit-string-concatenation", # Conflict with formatter |
| 137 |
] |
| 138 |
lint.per-file-ignores."tasks/**/*.py" = [ |
| 139 |
"assert", # asserts state the platform a Windows-only script already refuses to run outside of, narrowing it for ty |
| 140 |
"D", # don't care about documentation in tasks scripts |
| 141 |
"implicit-namespace-package", # no implicit namespace |
| 142 |
"print", # print allowed in scripts |
| 143 |
"subprocess-without-shell-equals-true", # `subprocess` call: check for execution of untrusted input |
| 144 |
] |
| 145 |
lint.per-file-ignores."tests/**/*.py" = [ |
| 146 |
"assert", # asserts allowed in tests |
| 147 |
"blind-except", # blind exception catching acceptable in test helpers |
| 148 |
"D", # don't care about documentation in tests |
| 149 |
"FBT", # don't care about booleans as positional arguments in tests |
| 150 |
"implicit-namespace-package", # no implicit namespace |
| 151 |
"import-outside-top-level", # import should be at top-level |
| 152 |
"import-private-name", # private name import from external module |
| 153 |
"magic-value-comparison", # Magic value used in comparison, consider replacing with a constant variable |
| 154 |
"non-lowercase-variable-in-function", # variable in function should be lowercase |
| 155 |
"private-member-access", # accessing private members acceptable in tests |
| 156 |
"pytest-fixture-autouse", # shared setup fixtures are meant to apply to every test |
| 157 |
"subprocess-without-shell-equals-true", # `subprocess` call: check for execution of untrusted input |
| 158 |
"too-many-arguments", # too many arguments in function definition |
| 159 |
"too-many-positional-arguments", # too many positional arguments |
| 160 |
"too-many-statements-in-try-clause", # try/finally cleanup blocks in tests legitimately hold many statements |
| 161 |
] |
| 162 |
lint.isort = { known-first-party = [ |
| 163 |
"filelock", |
| 164 |
], required-imports = [ |
| 165 |
"from __future__ import annotations", |
| 166 |
] } |
| 167 |
lint.preview = true |
| 168 |
|
| 169 |
[tool.codespell] |
| 170 |
builtin = "clear,usage,en-GB_to_en-US" |
| 171 |
ignore-words-list = "master" |
| 172 |
count = true |
| 173 |
quiet-level = 3 |
| 174 |
|
| 175 |
[tool.pyproject-fmt] |
| 176 |
max_supported_python = "3.15" |
| 177 |
|
| 178 |
[tool.ty] |
| 179 |
src.exclude = [] |
| 180 |
# Mirrors pytest's pythonpath so the tests' `coverage_pragmas` import resolves here too. |
| 181 |
environment.extra-paths = [ |
| 182 |
".", |
| 183 |
"tasks", |
| 184 |
] |
| 185 |
environment.python-version = "3.14" |
| 186 |
|
| 187 |
[tool.pytest] |
| 188 |
ini_options.testpaths = [ |
| 189 |
"tests", |
| 190 |
] |
| 191 |
# The project root lets the tests import each other as tests.*; tasks holds coverage_pragmas, whose CAPABILITIES probes |
| 192 |
# drive both the coverage exclusions and the skipif gates, so a test can never be skipped while coverage still demands |
| 193 |
# its lines. coverage imports that plugin by name in the subprocesses it patches, so it stays a top-level module. |
| 194 |
ini_options.pythonpath = [ |
| 195 |
".", |
| 196 |
"tasks", |
| 197 |
] |
| 198 |
ini_options.markers = [ |
| 199 |
"requires_hard_links: exercises StrictSoftFileLock, which needs os.link; skipped where it is missing (Termux/Android)", |
| 200 |
] |
| 201 |
ini_options.filterwarnings = [ |
| 202 |
"error", |
| 203 |
# CPython's resource tracker refuses to unregister a semaphore while it is already cleaning up, and warns instead. |
| 204 |
# multiprocessing.Event and Value expose no close, so only the collector frees them, and it picks the moment. Seen |
| 205 |
# on 3.12 alone. Filtering the tracker's own warning keeps the finalizer from raising rather than hiding the raise. |
| 206 |
"ignore:ResourceTracker called reentrantly for resource cleanup:UserWarning", |
| 207 |
] |
| 208 |
ini_options.verbosity_assertions = 2 |
| 209 |
ini_options.asyncio_default_fixture_loop_scope = "session" |
| 210 |
ini_options.timeout = 20 |
| 211 |
|
| 212 |
[tool.coverage] |
| 213 |
# The pragma plugin configures the run; measuring it would report the tooling alongside the package under test. |
| 214 |
run.omit = [ |
| 215 |
"*/tasks/*", |
| 216 |
] |
| 217 |
run.concurrency = [ |
| 218 |
"multiprocessing", |
| 219 |
"thread", |
| 220 |
] |
| 221 |
run.parallel = true |
| 222 |
run.plugins = [ |
| 223 |
"covdefaults", |
| 224 |
"coverage_pragmas", |
| 225 |
] |
| 226 |
run.patch = [ |
| 227 |
"_exit", |
| 228 |
"subprocess", |
| 229 |
] |
| 230 |
run.sigterm = true |
| 231 |
paths.other = [ |
| 232 |
".", |
| 233 |
"*/filelock", |
| 234 |
"*\\filelock", |
| 235 |
] |
| 236 |
paths.source = [ |
| 237 |
"src", |
| 238 |
"*/.tox/*/lib/*/site-packages", |
| 239 |
"*/.tox/*/Lib/site-packages", |
| 240 |
"**/src", |
| 241 |
"**\\src", |
| 242 |
] |
| 243 |
report.fail_under = 100 |
| 244 |
html.skip_covered = false |
| 245 |
|
| 246 |
[tool.towncrier] |
| 247 |
name = "filelock" |
| 248 |
directory = "docs/changelog" |
| 249 |
filename = "docs/changelog.rst" |
| 250 |
template = "docs/changelog/template.jinja2" |
| 251 |
title_format = false |
| 252 |
issue_format = ":pr:`{issue}`" |
| 253 |
type = [ |
| 254 |
{ directory = "breaking", name = "Backward incompatible changes", showcontent = true }, |
| 255 |
{ directory = "feature", name = "Features", showcontent = true }, |
| 256 |
{ directory = "bugfix", name = "Bug fixes", showcontent = true }, |
| 257 |
{ directory = "doc", name = "Improved documentation", showcontent = true }, |
| 258 |
{ directory = "packaging", name = "Packaging updates", showcontent = true }, |
| 259 |
] |