filelock 3.29.3__tar.gz → 4.2.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. {filelock-3.29.3 → filelock-4.2.7}/.gitignore +1 -0
  2. {filelock-3.29.3 → filelock-4.2.7}/PKG-INFO +10 -10
  3. filelock-4.2.7/docs/_static/custom.css +175 -0
  4. filelock-4.2.7/docs/api.rst +15 -0
  5. filelock-4.2.7/docs/changelog.rst +2616 -0
  6. filelock-4.2.7/docs/concepts.rst +1159 -0
  7. filelock-4.2.7/docs/conf.py +132 -0
  8. filelock-4.2.7/docs/example.gif +0 -0
  9. filelock-4.2.7/docs/how-to.rst +1563 -0
  10. filelock-4.2.7/docs/index.rst +179 -0
  11. filelock-4.2.7/docs/license.rst +7 -0
  12. filelock-4.2.7/docs/logo.svg +21 -0
  13. filelock-4.2.7/docs/tutorials.rst +465 -0
  14. filelock-4.2.7/pyproject.toml +320 -0
  15. filelock-4.2.7/src/filelock/__init__.py +177 -0
  16. filelock-4.2.7/src/filelock/_api.py +2272 -0
  17. filelock-4.2.7/src/filelock/_async.py +507 -0
  18. filelock-4.2.7/src/filelock/_async_read_write.py +413 -0
  19. filelock-4.2.7/src/filelock/_descriptor.py +76 -0
  20. filelock-4.2.7/src/filelock/_error.py +90 -0
  21. filelock-4.2.7/src/filelock/_identity.py +334 -0
  22. filelock-4.2.7/src/filelock/_lease.py +407 -0
  23. filelock-4.2.7/src/filelock/_marker.py +189 -0
  24. filelock-4.2.7/src/filelock/_read_write.py +1518 -0
  25. filelock-4.2.7/src/filelock/_soft.py +660 -0
  26. filelock-4.2.7/src/filelock/_soft_protocol.py +11 -0
  27. filelock-4.2.7/src/filelock/_soft_rw/__init__.py +14 -0
  28. filelock-4.2.7/src/filelock/_soft_rw/_async.py +373 -0
  29. filelock-4.2.7/src/filelock/_soft_rw/_protocol.py +638 -0
  30. filelock-4.2.7/src/filelock/_soft_rw/_storage.py +278 -0
  31. filelock-4.2.7/src/filelock/_soft_rw/_sync.py +793 -0
  32. filelock-4.2.7/src/filelock/_strict.py +1284 -0
  33. filelock-4.2.7/src/filelock/_unix.py +218 -0
  34. filelock-4.2.7/src/filelock/_util.py +431 -0
  35. filelock-4.2.7/src/filelock/_windows.py +780 -0
  36. filelock-4.2.7/src/filelock/asyncio.py +929 -0
  37. {filelock-3.29.3 → filelock-4.2.7}/src/filelock/version.py +2 -2
  38. filelock-4.2.7/tasks/benchmark.py +221 -0
  39. filelock-4.2.7/tasks/capabilities.py +391 -0
  40. filelock-4.2.7/tasks/capability/assert_fallback.py +26 -0
  41. filelock-4.2.7/tasks/capability/sitecustomize.py +15 -0
  42. filelock-4.2.7/tasks/coverage_pragmas.py +87 -0
  43. filelock-4.2.7/tasks/deny_symlink.py +167 -0
  44. filelock-4.2.7/tasks/termux/Dockerfile +7 -0
  45. filelock-4.2.7/tasks/verify_filesystem.py +180 -0
  46. filelock-4.2.7/tests/async_filelock_cancellation_helpers.py +68 -0
  47. filelock-4.2.7/tests/capability_marks.py +145 -0
  48. filelock-4.2.7/tests/conftest.py +337 -0
  49. filelock-4.2.7/tests/descriptor_helpers.py +31 -0
  50. filelock-4.2.7/tests/fork_helpers.py +71 -0
  51. filelock-4.2.7/tests/pid_namespace_helpers.py +54 -0
  52. filelock-4.2.7/tests/process_helpers.py +73 -0
  53. filelock-4.2.7/tests/read_write_helpers.py +111 -0
  54. filelock-4.2.7/tests/soft_rw/conftest.py +16 -0
  55. filelock-4.2.7/tests/soft_rw/test_soft_rw_async.py +831 -0
  56. filelock-4.2.7/tests/soft_rw/test_soft_rw_protocol.py +1318 -0
  57. filelock-4.2.7/tests/soft_rw/test_soft_rw_storage.py +239 -0
  58. filelock-4.2.7/tests/soft_rw/test_soft_rw_sync.py +1890 -0
  59. filelock-4.2.7/tests/test_async_filelock.py +1596 -0
  60. filelock-4.2.7/tests/test_async_filelock_acquire_cancellation.py +519 -0
  61. filelock-4.2.7/tests/test_async_filelock_release_cancellation.py +228 -0
  62. filelock-4.2.7/tests/test_async_filelock_rollback_agnostic.py +235 -0
  63. filelock-4.2.7/tests/test_async_filelock_runner_shutdown.py +188 -0
  64. filelock-4.2.7/tests/test_async_filelock_transition_admission.py +219 -0
  65. filelock-4.2.7/tests/test_async_read_write.py +927 -0
  66. filelock-4.2.7/tests/test_async_read_write_cancel_wait.py +157 -0
  67. filelock-4.2.7/tests/test_async_read_write_cancellation.py +593 -0
  68. filelock-4.2.7/tests/test_async_read_write_worker_ownership.py +111 -0
  69. filelock-4.2.7/tests/test_async_soft_contracts.py +83 -0
  70. filelock-4.2.7/tests/test_async_transition_gate.py +214 -0
  71. filelock-4.2.7/tests/test_default_mode.py +219 -0
  72. filelock-4.2.7/tests/test_descriptor_helpers.py +31 -0
  73. filelock-4.2.7/tests/test_error.py +149 -0
  74. filelock-4.2.7/tests/test_filelock.py +4070 -0
  75. filelock-4.2.7/tests/test_fork_backends.py +503 -0
  76. filelock-4.2.7/tests/test_fork_coordination.py +1386 -0
  77. filelock-4.2.7/tests/test_fork_ownership.py +502 -0
  78. filelock-4.2.7/tests/test_fork_registries.py +175 -0
  79. filelock-4.2.7/tests/test_host_name_grammar.py +49 -0
  80. filelock-4.2.7/tests/test_lazy_import.py +226 -0
  81. filelock-4.2.7/tests/test_lifetime_validation.py +132 -0
  82. filelock-4.2.7/tests/test_lock_expiry.py +226 -0
  83. filelock-4.2.7/tests/test_marker_records.py +318 -0
  84. filelock-4.2.7/tests/test_process_identity.py +326 -0
  85. filelock-4.2.7/tests/test_read_write.py +1387 -0
  86. filelock-4.2.7/tests/test_read_write_fork.py +1263 -0
  87. filelock-4.2.7/tests/test_read_write_private_link.py +454 -0
  88. filelock-4.2.7/tests/test_read_write_unit.py +1038 -0
  89. filelock-4.2.7/tests/test_soft_lease.py +1024 -0
  90. filelock-4.2.7/tests/test_soft_lifetime_warning.py +250 -0
  91. filelock-4.2.7/tests/test_soft_stale.py +1892 -0
  92. filelock-4.2.7/tests/test_strict_soft.py +456 -0
  93. filelock-4.2.7/tests/test_strict_soft_compat.py +144 -0
  94. filelock-4.2.7/tests/test_strict_soft_failures.py +2378 -0
  95. filelock-4.2.7/tests/test_strict_soft_paths.py +173 -0
  96. filelock-4.2.7/tests/test_strict_soft_races.py +310 -0
  97. filelock-4.2.7/tests/test_strict_soft_recovery.py +144 -0
  98. filelock-4.2.7/tests/test_strict_soft_stress.py +102 -0
  99. filelock-4.2.7/tests/test_subclass_options.py +418 -0
  100. filelock-4.2.7/tests/test_unix_fallback.py +367 -0
  101. filelock-4.2.7/tests/test_util.py +696 -0
  102. {filelock-3.29.3 → filelock-4.2.7}/tox.toml +63 -6
  103. filelock-3.29.3/README.md +0 -9
  104. filelock-3.29.3/pyproject.toml +0 -212
  105. filelock-3.29.3/src/filelock/__init__.py +0 -93
  106. filelock-3.29.3/src/filelock/_api.py +0 -609
  107. filelock-3.29.3/src/filelock/_async_read_write.py +0 -216
  108. filelock-3.29.3/src/filelock/_error.py +0 -28
  109. filelock-3.29.3/src/filelock/_read_write.py +0 -369
  110. filelock-3.29.3/src/filelock/_soft.py +0 -243
  111. filelock-3.29.3/src/filelock/_soft_rw/__init__.py +0 -12
  112. filelock-3.29.3/src/filelock/_soft_rw/_async.py +0 -213
  113. filelock-3.29.3/src/filelock/_soft_rw/_sync.py +0 -851
  114. filelock-3.29.3/src/filelock/_unix.py +0 -116
  115. filelock-3.29.3/src/filelock/_util.py +0 -82
  116. filelock-3.29.3/src/filelock/_windows.py +0 -111
  117. filelock-3.29.3/src/filelock/asyncio.py +0 -407
  118. filelock-3.29.3/tests/conftest.py +0 -24
  119. filelock-3.29.3/tests/soft_rw/test_soft_rw_async.py +0 -137
  120. filelock-3.29.3/tests/soft_rw/test_soft_rw_sync.py +0 -925
  121. filelock-3.29.3/tests/test_async_filelock.py +0 -357
  122. filelock-3.29.3/tests/test_async_read_write.py +0 -311
  123. filelock-3.29.3/tests/test_default_mode.py +0 -139
  124. filelock-3.29.3/tests/test_error.py +0 -35
  125. filelock-3.29.3/tests/test_filelock.py +0 -1189
  126. filelock-3.29.3/tests/test_lock_expiry.py +0 -145
  127. filelock-3.29.3/tests/test_read_write.py +0 -562
  128. filelock-3.29.3/tests/test_read_write_unit.py +0 -595
  129. filelock-3.29.3/tests/test_self_deadlock.py +0 -139
  130. filelock-3.29.3/tests/test_soft_stale.py +0 -283
  131. filelock-3.29.3/tests/test_unix_fallback.py +0 -113
  132. filelock-3.29.3/tests/test_util.py +0 -47
  133. {filelock-3.29.3 → filelock-4.2.7}/LICENSE +0 -0
  134. {filelock-3.29.3 → filelock-4.2.7}/src/filelock/py.typed +0 -0
  135. {filelock-3.29.3 → filelock-4.2.7}/tests/test_virtualenv.py +0 -0
@@ -17,3 +17,4 @@ venv*
17
17
  test.lock
18
18
  .coverage.*
19
19
  test.softlock
20
+ /uv.lock
@@ -1,30 +1,30 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: filelock
3
- Version: 3.29.3
3
+ Version: 4.2.7
4
+ Import-Name: filelock
4
5
  Summary: A platform independent file lock.
6
+ Project-URL: Changelog, https://py-filelock.readthedocs.io/en/latest/changelog.html
5
7
  Project-URL: Documentation, https://py-filelock.readthedocs.io
6
- Project-URL: Homepage, https://github.com/tox-dev/py-filelock
7
- Project-URL: Source, https://github.com/tox-dev/py-filelock
8
- Project-URL: Tracker, https://github.com/tox-dev/py-filelock/issues
8
+ Project-URL: Homepage, https://github.com/tox-dev/filelock
9
+ Project-URL: Source, https://github.com/tox-dev/filelock
10
+ Project-URL: Tracker, https://github.com/tox-dev/filelock/issues
9
11
  Maintainer-email: Bernát Gábor <gaborjbernat@gmail.com>
10
12
  License-Expression: MIT
11
13
  License-File: LICENSE
12
- Keywords: application,cache,directory,log,user
14
+ Keywords: file,lock,synchronization
13
15
  Classifier: Development Status :: 5 - Production/Stable
14
16
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: MIT License
16
17
  Classifier: Operating System :: OS Independent
17
18
  Classifier: Programming Language :: Python
18
19
  Classifier: Programming Language :: Python :: 3 :: Only
19
- Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
23
  Classifier: Programming Language :: Python :: 3.14
24
- Classifier: Topic :: Internet
24
+ Classifier: Programming Language :: Python :: 3.15
25
25
  Classifier: Topic :: Software Development :: Libraries
26
26
  Classifier: Topic :: System
27
- Requires-Python: >=3.10
27
+ Requires-Python: >=3.11
28
28
  Description-Content-Type: text/markdown
29
29
 
30
30
  # filelock
@@ -0,0 +1,175 @@
1
+ /* Widen furo's body column, and keep both tables of contents on screen while doing it.
2
+
3
+ Furo compiles its layout from SASS: `.content { width: 46em }`, 15em drawers either side, and breakpoints derived
4
+ from their sum ($full-width = 82em). A media query resolves `em` against the *initial* font size, which is always
5
+ 16px, while the layout resolves the same unit against the root font size the reader's browser actually applies. The
6
+ two only agree at a 16px default. Widening the body by re-setting those fixed widths therefore pushes the layout
7
+ past the viewport for anyone reading at a larger font: the columns grow, the breakpoint does not move, and the
8
+ right-hand table of contents is clipped off the edge before anything folds it away.
9
+
10
+ So do not restate a width the breakpoints depend on. Pin the two drawers, cap the body, and let the body alone take
11
+ up the slack. The layout then fits at any font size, and the reader keeps both tables of contents. */
12
+
13
+ .content {
14
+ width: auto;
15
+ max-width: 69em;
16
+ min-width: 0;
17
+ flex: 1 1 auto;
18
+ }
19
+
20
+ /* A flex item refuses to shrink below its content's intrinsic width unless told otherwise, and the body's widest
21
+ token is a line of code. Without this the row holding the body and the right drawer stops shrinking at whatever the
22
+ longest code line measures, and pushes the drawer off the edge instead. Let the row shrink: a long line then scrolls
23
+ inside its own code block, which furo already handles, rather than scrolling the whole page sideways. */
24
+ .main {
25
+ min-width: 0;
26
+ }
27
+
28
+ /* The drawers share a flex row with the body, so an unpinned drawer donates its width to a growing body: the table of
29
+ contents stays on screen but shrinks until its entries wrap into an unreadable ribbon. Hold both at 15em. */
30
+ .toc-drawer {
31
+ flex: 0 0 15em;
32
+ }
33
+
34
+ /* min-width keeps the navigation at 15em once the gutter runs out, so the body absorbs the remainder rather than the
35
+ drawer collapsing. The calc centers the wider block on a roomy screen: half the padded body (69em + 2*3em) is 37.5em.
36
+ Furo does the same around its own narrower column. */
37
+ .sidebar-drawer {
38
+ width: calc(50% - 37.5em);
39
+ min-width: 15em;
40
+ flex: 0 0 auto;
41
+ }
42
+
43
+ /* Furo folds the right-hand table of contents into an icon below 82em, which on a normal desktop is width the reader
44
+ still has. Keep it down to the mobile breakpoint (63em), where furo turns the navigation into an overlay and the
45
+ drawers genuinely have nowhere to sit. Restoring the desktop rules means undoing furo's fold in full: static flow,
46
+ no fixed panel off the right edge, and the desktop type scale rather than the larger mobile one. */
47
+ @media (min-width: 63.0625em) {
48
+ .toc-content-icon {
49
+ display: none;
50
+ }
51
+ .toc-drawer {
52
+ position: static;
53
+ top: auto;
54
+ right: auto;
55
+ height: auto;
56
+ border-left: none;
57
+ }
58
+ .toc-tree {
59
+ border-left: 1px solid var(--color-background-border);
60
+ font-size: var(--toc-font-size);
61
+ }
62
+ }
63
+
64
+ /* Center each diagram and let a wide flowchart scroll on its own. */
65
+ .mermaid {
66
+ text-align: center;
67
+ overflow-x: auto;
68
+ }
69
+
70
+ /* The diagrams carry no colors of their own: sphinxcontrib-mermaid renders them in the browser and re-renders them on
71
+ every theme toggle, so a palette written into the diagram source would be baked at whichever theme happened to load
72
+ first and then stay light on a dark page. The source names a role (`class default recommended`), mermaid copies that
73
+ name onto the node, and the two palettes below fill it in. Keep a tint's meaning consistent across diagrams: blue is
74
+ the caller's own code, orange is the lock coordinating it, green is the data under the lock, purple the way out.
75
+
76
+ Mermaid scopes its own rules under the generated SVG's id, which outranks anything selectable from here, so these
77
+ declarations need !important to land. */
78
+ body {
79
+ --diagram-green-bg: #e8f5e9;
80
+ --diagram-green-line: #2e7d32;
81
+ --diagram-green-ink: #1b5e20;
82
+ --diagram-orange-bg: #fff3e0;
83
+ --diagram-orange-line: #e65100;
84
+ --diagram-orange-ink: #bf360c;
85
+ --diagram-blue-bg: #e3f2fd;
86
+ --diagram-blue-line: #1565c0;
87
+ --diagram-blue-ink: #0d47a1;
88
+ --diagram-purple-bg: #ede7f6;
89
+ --diagram-purple-line: #4527a0;
90
+ --diagram-purple-ink: #311b92;
91
+ }
92
+
93
+ /* Dark tints hold their hue at roughly a tenth of the light fill's lightness, and lift the ink to the same hue's pale
94
+ end: every pair clears 7:1, which the light palette's orange does not quite manage. Mirror furo's own two-selector
95
+ split so an explicit toggle and an untouched "auto" both land. */
96
+ @media not print {
97
+ body[data-theme="dark"] {
98
+ --diagram-green-bg: #1b3a24;
99
+ --diagram-green-line: #66bb6a;
100
+ --diagram-green-ink: #c8e6c9;
101
+ --diagram-orange-bg: #3d2a14;
102
+ --diagram-orange-line: #ffa726;
103
+ --diagram-orange-ink: #ffe0b2;
104
+ --diagram-blue-bg: #12304d;
105
+ --diagram-blue-line: #42a5f5;
106
+ --diagram-blue-ink: #bbdefb;
107
+ --diagram-purple-bg: #272040;
108
+ --diagram-purple-line: #9575cd;
109
+ --diagram-purple-ink: #d1c4e9;
110
+ }
111
+
112
+ @media (prefers-color-scheme: dark) {
113
+ body:not([data-theme="light"]) {
114
+ --diagram-green-bg: #1b3a24;
115
+ --diagram-green-line: #66bb6a;
116
+ --diagram-green-ink: #c8e6c9;
117
+ --diagram-orange-bg: #3d2a14;
118
+ --diagram-orange-line: #ffa726;
119
+ --diagram-orange-ink: #ffe0b2;
120
+ --diagram-blue-bg: #12304d;
121
+ --diagram-blue-line: #42a5f5;
122
+ --diagram-blue-ink: #bbdefb;
123
+ --diagram-purple-bg: #272040;
124
+ --diagram-purple-line: #9575cd;
125
+ --diagram-purple-ink: #d1c4e9;
126
+ }
127
+ }
128
+ }
129
+
130
+ .mermaid g.node.recommended > rect,
131
+ .mermaid g.node.store > rect {
132
+ fill: var(--diagram-green-bg) !important;
133
+ stroke: var(--diagram-green-line) !important;
134
+ }
135
+
136
+ .mermaid g.node.recommended .nodeLabel,
137
+ .mermaid g.node.store .nodeLabel {
138
+ color: var(--diagram-green-ink) !important;
139
+ }
140
+
141
+ .mermaid g.node.alternative > rect,
142
+ .mermaid g.node.counter > rect {
143
+ fill: var(--diagram-orange-bg) !important;
144
+ stroke: var(--diagram-orange-line) !important;
145
+ }
146
+
147
+ .mermaid g.node.alternative .nodeLabel,
148
+ .mermaid g.node.counter .nodeLabel {
149
+ color: var(--diagram-orange-ink) !important;
150
+ }
151
+
152
+ .mermaid g.node.special > rect,
153
+ .mermaid g.node.thread > rect {
154
+ fill: var(--diagram-blue-bg) !important;
155
+ stroke: var(--diagram-blue-line) !important;
156
+ }
157
+
158
+ .mermaid g.node.special .nodeLabel,
159
+ .mermaid g.node.thread .nodeLabel {
160
+ color: var(--diagram-blue-ink) !important;
161
+ }
162
+
163
+ .mermaid g.node.escape > rect {
164
+ fill: var(--diagram-purple-bg) !important;
165
+ stroke: var(--diagram-purple-line) !important;
166
+ }
167
+
168
+ .mermaid g.node.escape .nodeLabel {
169
+ color: var(--diagram-purple-ink) !important;
170
+ }
171
+
172
+ /* A sequence diagram's `box` renders as a bare `rect.rect` with no per-box hook, so the tints above cannot reach it and
173
+ the group colors stay in the diagram source. They are translucent for that reason: an alpha over the hue composites
174
+ against whichever background the theme paints, reading pale on white and deep on the dark page, and it shifts the
175
+ lightness too little to strand the title text mermaid draws on top in the theme's own ink. */
@@ -0,0 +1,15 @@
1
+ ###############
2
+ API Reference
3
+ ###############
4
+
5
+ This section documents all public classes, exceptions, and attributes. For usage examples and task-oriented guidance,
6
+ see :doc:`tutorials` and :doc:`how-to`.
7
+
8
+ :class:`~filelock.FileLock` and :class:`~filelock.AsyncFileLock` are platform aliases: at import time they resolve to
9
+ :class:`~filelock.UnixFileLock` or :class:`~filelock.WindowsFileLock` (and their async peers), or to the soft backends on
10
+ a build without ``fcntl``. The shared ``acquire`` / ``release`` / ``timeout`` interface they expose lives on
11
+ :class:`~filelock.BaseFileLock` and :class:`~filelock.BaseAsyncFileLock` below.
12
+
13
+ .. automodule:: filelock
14
+ :members:
15
+ :show-inheritance: