python-constricter 0.3.5__tar.gz → 0.4.1__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 (184) hide show
  1. python_constricter-0.4.1/.gitignore +107 -0
  2. {python_constricter-0.3.5 → python_constricter-0.4.1}/LICENSE.md +1 -1
  3. {python_constricter-0.3.5 → python_constricter-0.4.1}/PKG-INFO +17 -9
  4. {python_constricter-0.3.5 → python_constricter-0.4.1}/README.md +16 -8
  5. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/__init__.py +1 -1
  6. python_constricter-0.4.1/constricter/_version.py +4 -0
  7. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/collecting.py +8 -1
  8. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/command.py +28 -226
  9. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/config.py +2 -1
  10. python_constricter-0.4.1/constricter/cli/lsp/__init__.py +2 -0
  11. python_constricter-0.3.5/constricter/cli/hints.py → python_constricter-0.4.1/constricter/cli/lsp/connection.py +17 -363
  12. {python_constricter-0.3.5/constricter/cli → python_constricter-0.4.1/constricter/cli/lsp}/edits.py +1 -1
  13. {python_constricter-0.3.5/constricter/cli → python_constricter-0.4.1/constricter/cli/lsp}/guard.py +5 -1
  14. python_constricter-0.4.1/constricter/cli/lsp/hints.py +391 -0
  15. python_constricter-0.4.1/constricter/cli/lsp/remembered.py +81 -0
  16. python_constricter-0.4.1/constricter/cli/lsp/stored.py +200 -0
  17. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/options.py +60 -7
  18. python_constricter-0.4.1/constricter/cli/paths.py +151 -0
  19. python_constricter-0.4.1/constricter/cli/reading.py +36 -0
  20. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/report.py +5 -2
  21. python_constricter-0.4.1/constricter/cli/rounds.py +328 -0
  22. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/schedule.py +84 -36
  23. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/workers.py +78 -8
  24. python_constricter-0.4.1/constricter/empty.py +66 -0
  25. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/fixes.py +26 -1
  26. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/imports.py +110 -8
  27. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/inherited.py +2 -1
  28. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/known.py +101 -34
  29. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/signatures.py +14 -7
  30. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/beyond.py +3 -2
  31. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/callers.py +3 -2
  32. python_constricter-0.4.1/constricter/fix/index/crossed.py +327 -0
  33. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/decorated.py +29 -10
  34. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/loose.py +11 -6
  35. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/modules.py +90 -192
  36. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/offers.py +123 -9
  37. python_constricter-0.4.1/constricter/fix/index/origins.py +238 -0
  38. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/own_methods.py +31 -7
  39. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/own_overloads.py +2 -2
  40. python_constricter-0.4.1/constricter/fix/index/own_types.py +330 -0
  41. python_constricter-0.4.1/constricter/fix/index/params.py +81 -0
  42. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/plain.py +109 -13
  43. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/project.py +86 -273
  44. python_constricter-0.4.1/constricter/fix/index/stubs/__init__.py +2 -0
  45. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/atoms.py +3 -3
  46. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/chained.py +2 -2
  47. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/classnames.py +2 -2
  48. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/declared.py +8 -6
  49. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/installed.py +84 -7
  50. python_constricter-0.4.1/constricter/fix/index/stubs/names.py +200 -0
  51. {python_constricter-0.3.5/constricter/fix/index → python_constricter-0.4.1/constricter/fix/index/stubs}/read.py +2 -2
  52. python_constricter-0.3.5/constricter/fix/index/stubbed.py → python_constricter-0.4.1/constricter/fix/index/stubs/signatures.py +28 -372
  53. python_constricter-0.4.1/constricter/fix/index/stubs/stubbed.py +208 -0
  54. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/library.py +60 -14
  55. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/overloads.py +315 -323
  56. python_constricter-0.4.1/constricter/fix/libraries/receivers.py +274 -0
  57. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/stdlib.py +14 -2
  58. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/attributes.json +8 -8
  59. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/functions.json +15 -0
  60. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/method_overloads.json +91 -91
  61. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/method_signatures.json +60 -2
  62. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/overloads.json +5 -2
  63. python_constricter-0.4.1/constricter/fix/tables/platform.json +37 -0
  64. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/source.json +5 -3
  65. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/variables.json +3 -0
  66. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/aliased.py +9 -4
  67. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/callables.py +4 -2
  68. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/called.py +89 -1
  69. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/classvars.py +100 -12
  70. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/decided.py +39 -6
  71. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/displays.py +19 -5
  72. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/doubts.py +21 -6
  73. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/entered.py +2 -1
  74. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/fills.py +21 -9
  75. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/guesses.py +11 -5
  76. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/hinted.py +175 -9
  77. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/inference.py +24 -320
  78. python_constricter-0.4.1/constricter/fix/values/loops.py +335 -0
  79. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/members.py +21 -7
  80. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/operated.py +10 -8
  81. python_constricter-0.4.1/constricter/fix/values/returned.py +479 -0
  82. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/shapes.py +192 -32
  83. python_constricter-0.3.5/constricter/fix/values/returned.py → python_constricter-0.4.1/constricter/fix/values/stored.py +47 -450
  84. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/targets.py +49 -13
  85. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/unchecked.py +119 -3
  86. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/notebook.py +6 -8
  87. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/offences.py +121 -3
  88. python_constricter-0.4.1/constricter/overrides.py +24 -0
  89. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/plugins/pylint.py +20 -17
  90. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/recording.py +109 -20
  91. python_constricter-0.4.1/constricter/rules/annotations.py +296 -0
  92. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/binding.py +14 -8
  93. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/calls.py +3 -2
  94. python_constricter-0.4.1/constricter/rules/checker.py +536 -0
  95. python_constricter-0.3.5/constricter/rules/annotations.py → python_constricter-0.4.1/constricter/rules/declarations.py +42 -286
  96. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/decorators.py +158 -28
  97. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/keys.py +1 -1
  98. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/late.py +331 -25
  99. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/parsed.py +9 -3
  100. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/quoted.py +21 -0
  101. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/rebinding.py +5 -3
  102. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/recorded.py +13 -12
  103. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/scope.py +48 -240
  104. python_constricter-0.4.1/constricter/rules/scoped.py +232 -0
  105. python_constricter-0.4.1/constricter/rules/scoping.py +346 -0
  106. python_constricter-0.4.1/constricter/rules/settings.py +189 -0
  107. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/tables.py +1 -1
  108. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/widened.py +1 -1
  109. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/trace.py +5 -9
  110. {python_constricter-0.3.5 → python_constricter-0.4.1}/hatch_build.py +6 -7
  111. python_constricter-0.4.1/mypyc.txt +280 -0
  112. {python_constricter-0.3.5 → python_constricter-0.4.1}/pyproject.toml +111 -28
  113. python_constricter-0.3.5/stdlib_tables/overloads.py → python_constricter-0.4.1/stdlib_tables/accepting.py +118 -472
  114. python_constricter-0.4.1/stdlib_tables/configured.py +464 -0
  115. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/elements.py +2 -1
  116. python_constricter-0.4.1/stdlib_tables/forms.py +222 -0
  117. python_constricter-0.4.1/stdlib_tables/generate.py +552 -0
  118. python_constricter-0.4.1/stdlib_tables/overloads.py +507 -0
  119. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/partial.json +0 -1
  120. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/reading.py +46 -229
  121. python_constricter-0.4.1/stdlib_tables/shed.py +95 -0
  122. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/stubs.py +77 -249
  123. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/templates.py +2 -1
  124. python_constricter-0.4.1/stdlib_tables/written.py +98 -0
  125. python_constricter-0.3.5/.gitignore +0 -48
  126. python_constricter-0.3.5/constricter/cli/paths.py +0 -82
  127. python_constricter-0.3.5/constricter/cli/remembered.py +0 -52
  128. python_constricter-0.3.5/constricter/fix/index/own_types.py +0 -161
  129. python_constricter-0.3.5/constricter/rules/checker.py +0 -992
  130. python_constricter-0.3.5/stdlib_tables/generate.py +0 -996
  131. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/__main__.py +0 -0
  132. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/__init__.py +0 -0
  133. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/baseline.py +0 -0
  134. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/explain.py +0 -0
  135. {python_constricter-0.3.5/constricter/cli → python_constricter-0.4.1/constricter/cli/lsp}/protocol.py +0 -0
  136. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/runs.py +0 -0
  137. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/cli/traced.py +0 -0
  138. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/__init__.py +0 -0
  139. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/__init__.py +0 -0
  140. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/core/asked.py +0 -0
  141. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/__init__.py +0 -0
  142. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/awaits.py +0 -0
  143. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/fixtures.py +0 -0
  144. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/linked.py +0 -0
  145. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/managed.py +0 -0
  146. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/order.py +0 -0
  147. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/sides.py +0 -0
  148. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/strings.py +0 -0
  149. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/taken.py +0 -0
  150. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/index/tuples.py +0 -0
  151. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/__init__.py +0 -0
  152. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/opened.py +0 -0
  153. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/libraries/walks.py +0 -0
  154. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/aliases.json +0 -0
  155. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/awaited.json +0 -0
  156. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/awaited_overloads.json +0 -0
  157. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/bases.json +0 -0
  158. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/classes.json +0 -0
  159. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/elements.json +0 -0
  160. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/generic_attributes.json +0 -0
  161. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/methods.json +0 -0
  162. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/returns.json +0 -0
  163. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/scalar_members.json +0 -0
  164. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/scalars.json +0 -0
  165. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/subscriptable.json +0 -0
  166. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/tables/type_parameters.json +0 -0
  167. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/__init__.py +0 -0
  168. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/bodies.py +0 -0
  169. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/narrowed.py +0 -0
  170. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/ordered.py +0 -0
  171. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/fix/values/returns.py +0 -0
  172. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/jsonc.py +0 -0
  173. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/noqa.py +0 -0
  174. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/plugins/__init__.py +0 -0
  175. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/plugins/flake8.py +0 -0
  176. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/py.typed +0 -0
  177. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/__init__.py +0 -0
  178. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/flow.py +0 -0
  179. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/narrowing.py +0 -0
  180. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/redundant.py +0 -0
  181. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/syntax.py +0 -0
  182. {python_constricter-0.3.5 → python_constricter-0.4.1}/constricter/rules/walked.py +0 -0
  183. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/__init__.py +0 -0
  184. {python_constricter-0.3.5 → python_constricter-0.4.1}/stdlib_tables/__main__.py +0 -0
@@ -0,0 +1,107 @@
1
+ # SPDX-License-Identifier: MIT
2
+
3
+ # Everything generated on this machine (scratch, tool caches, local builds).
4
+ local/
5
+
6
+ # npm installs, the pinned CI Markdown tools' (.github/package.json) included.
7
+ node_modules/
8
+
9
+ # Claude Code: personal overrides, agent worktrees and host-specific agent
10
+ # notes stay local.
11
+ .claude/settings.local.json
12
+ .claude/worktrees/
13
+ CLAUDE.local.md
14
+ # Claude Code's sandbox bind-mounts /dev/null over these denied paths while a
15
+ # session runs; none is a file of this repo
16
+ /.bash_profile
17
+ /.bashrc
18
+ /.gitconfig
19
+ /.gitmodules
20
+ /.idea
21
+ /.mcp.json
22
+ /.profile
23
+ /.ripgreprc
24
+ /.zprofile
25
+ /.zshrc
26
+ /.claude/agents
27
+ /.claude/commands
28
+ /.claude/hooks
29
+ /.claude/launch.json
30
+ /.claude/loop.md
31
+ /.claude/output-styles
32
+ /.claude/routines
33
+ /.claude/scheduled_tasks.json
34
+ /.claude/skills
35
+ /.claude/workflows
36
+ /.claude/.cc-writes
37
+ # .claude/settings.json too: where it is tracked the ignore changes nothing,
38
+ # and where it is not the device would show as untracked
39
+ /.claude/settings.json
40
+
41
+ # Secrets and local environment. A .env.example is a template with no real
42
+ # values, so it stays tracked.
43
+ .env
44
+ .env.*
45
+ !.env.example
46
+ .envrc
47
+ .direnv/
48
+ *.key
49
+ *.pem
50
+ *.pfx
51
+ *.crt
52
+ *.cert
53
+ *.pub
54
+ *.rsa
55
+ *.priv
56
+ secret/
57
+ secrets/
58
+ private/
59
+ keys/
60
+
61
+ # Editor and OS droppings, and the backups merge tools leave beside a conflict.
62
+ .DS_Store
63
+ *.swp
64
+ *.swo
65
+ *~
66
+ *.orig
67
+
68
+ # Logs.
69
+ *.log
70
+
71
+ # Python's bytecode caches and packaging metadata, and Hypothesis's example
72
+ # database.
73
+ __pycache__/
74
+ *.pyc
75
+ *.egg-info/
76
+ .hypothesis/
77
+ .import_linter_cache/
78
+ # Packaging output at the root; a build/ deeper in the tree is source.
79
+ /build/
80
+ /dist/
81
+ # Rust build output.
82
+ /target
83
+ **/*.rs.bk
84
+ # A local Jekyll build of the docs site; CI builds the real one.
85
+ _site/
86
+ .jekyll-cache/
87
+ # Not used in this project; kept out so stray editor or tooling output isn't
88
+ # committed by accident.
89
+ *.js
90
+ *.ts
91
+ *.bat
92
+ *.cmd
93
+ *.ps
94
+ *.ps1
95
+ *.ps2
96
+ *.psd
97
+ *.doc
98
+ *.docx
99
+ *.id
100
+ # Generated by a build (hatch_build.py, or `python -m stdlib_tables`): the
101
+ # standard-library tables, and the tests' list of what only some platforms and
102
+ # Pythons have.
103
+ constricter/fix/tables/
104
+ stdlib_tables/partial.json
105
+
106
+ # The version the build writes from the git tag (pyproject.toml, [tool.hatch.build.hooks.vcs]).
107
+ /constricter/_version.py
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright (c) 2026 Ivy Duggan
3
+ Copyright (c) 2026 Ivy Duggan <https://ivylikethevine.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: python-constricter
3
- Version: 0.3.5
3
+ Version: 0.4.1
4
4
  Import-Name: constricter
5
5
  Summary: Lint rules: every local variable is typed where it's first bound. A flake8 plugin, a pylint plugin and a standalone CLI.
6
6
  Author: Ivy Duggan
@@ -185,7 +185,7 @@ Options:
185
185
  | vague | `--vague LEVEL` (LVA005, and the fixes offered): -1 none (the default), 0 one `Any` inside a type that says the rest (`tuple[str, Any]`), N from 1 N + 1, or one alone | `vague` | `--constricter-vague` | `constricter-vague` |
186
186
  | min python | `--min-python VERSION` (the oldest Python the code runs on, whose syntax `--fix` writes; default: `requires-python`'s) | `min-python` | - | - |
187
187
  | type hierarchy | - | `narrower` (a table) | `--constricter-narrower` | `constricter-narrower` |
188
- | fix | `--fix` (`--unsafe-fixes` for guesses), `--diff` to preview | - | - | - |
188
+ | fix | `--fix` (`--unsafe-fixes` for guesses, `--likely` for those measured to hold), `--diff` to preview | - | - | - |
189
189
  | infer with | `--infer-with CHECKERS` (`basedpyright`, `ty`, `pyrefly`, several: inferred types, as guesses) | `infer-with` | - | - |
190
190
  | infer from | `--infer-from FILE` (the types `python -m constricter.trace -m pytest` recorded from a run, as guesses) | `infer-from` | - | - |
191
191
  | show fixes | `--show-fixes` (each fix and how it was decided; with `--fix`, those made too) | - | - | - |
@@ -245,8 +245,10 @@ ignore = ["LVA003"]
245
245
  `count: int = 0`), a container whose elements agree, a constructor or a function that declares its
246
246
  return type or whose `return`s agree (in another checked file too), a copy, subscript, attribute or
247
247
  method call of a local whose type is known, and values computed from those; a loop's target or an
248
- unpacking's names get a declaration on the line before. `--unsafe-fixes` adds guesses, and
249
- `--show-fixes` lists each fix and how its value decided it, and after `--fix` each one made.
248
+ unpacking's names get a declaration on the line before. `--unsafe-fixes` adds guesses, `--likely`
249
+ only those measured to hold as often as a certain fix
250
+ ([docs/LIKELY.md](https://github.com/ivylikethevine/python-constricter/blob/main/docs/LIKELY.md)),
251
+ and `--show-fixes` lists each fix and how its value decided it, and after `--fix` each one made.
250
252
  `--infer-with basedpyright` (or `ty`, or `pyrefly`, or several: `basedpyright,ty`; each installed
251
253
  alongside) asks those type checkers for what `--fix` can't type itself, as guesses;
252
254
  `--infer-from FILE` takes the types a run bound each name to, recorded by
@@ -261,6 +263,9 @@ uvx --from python-constricter constricter # or run it without installing: uv's t
261
263
  pipx run --spec python-constricter constricter # or pipx's
262
264
  ```
263
265
 
266
+ On CPython 3.11 to 3.14 for Linux, macOS and Windows, pip installs a build compiled with mypyc,
267
+ about a fifth faster; anywhere else, the pure Python one, which finds and fixes the same.
268
+
264
269
  Tools that run flake8 or pylint (VS Code's extensions, python-lsp-server, prospector, MegaLinter,
265
270
  Trunk) pick the plugin up once it's installed alongside them.
266
271
 
@@ -268,15 +273,18 @@ Without `lint.external`, ruff flags `# noqa: LVA00x` (RUF102) and `--fix` delete
268
273
 
269
274
  The CLI defaults to `.`, checks `*.py` and `*.ipynb`, and skips hidden dirs, `__pycache__`, `venv`,
270
275
  `site-packages`, `build`, `dist` and `node_modules` by directory name; `--exclude` adds more
271
- directory names (or globs) to skip the same way, on top of matching whole paths and file names. Exit
272
- codes: `0` no errors, `1` errors, `2` an unreadable or unparsable file, a `--fix` its encoding can't
273
- hold, or a bad `pyproject.toml`. A module is read in its PEP 263 declaration's encoding.
276
+ directory names (or globs) to skip the same way, on top of matching whole paths and file names.
277
+ Under a directory in a git checkout it checks only what git tracks or would, so nothing a
278
+ `.gitignore` names (a file named on the command line is checked regardless); `--no-gitignore`, or
279
+ `gitignore = false`, walks the directory whole. Exit codes: `0` no errors, `1` errors, `2` an
280
+ unreadable or unparsable file, a `--fix` its encoding can't hold, or a bad `pyproject.toml`. A
281
+ module is read in its PEP 263 declaration's encoding.
274
282
 
275
283
  pre-commit, after ruff's hooks (or `constricter-fix`, which runs `--fix` first):
276
284
 
277
285
  ```yaml
278
286
  - repo: https://github.com/ivylikethevine/python-constricter
279
- rev: v0.3.5
287
+ rev: vX.Y.Z # the latest release; `pre-commit autoupdate` sets it
280
288
  hooks:
281
289
  - id: constricter
282
290
  ```
@@ -361,7 +369,7 @@ it to code scanning (the job needs `security-events: write`; the
361
369
  ```yaml
362
370
  - run: constricter --format=sarif src > constricter.sarif
363
371
  - if: ${{ !cancelled() }} # upload the findings even when the step above failed on them
364
- uses: github/codeql-action/upload-sarif@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
372
+ uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
365
373
  with:
366
374
  sarif_file: constricter.sarif
367
375
  category: constricter
@@ -158,7 +158,7 @@ Options:
158
158
  | vague | `--vague LEVEL` (LVA005, and the fixes offered): -1 none (the default), 0 one `Any` inside a type that says the rest (`tuple[str, Any]`), N from 1 N + 1, or one alone | `vague` | `--constricter-vague` | `constricter-vague` |
159
159
  | min python | `--min-python VERSION` (the oldest Python the code runs on, whose syntax `--fix` writes; default: `requires-python`'s) | `min-python` | - | - |
160
160
  | type hierarchy | - | `narrower` (a table) | `--constricter-narrower` | `constricter-narrower` |
161
- | fix | `--fix` (`--unsafe-fixes` for guesses), `--diff` to preview | - | - | - |
161
+ | fix | `--fix` (`--unsafe-fixes` for guesses, `--likely` for those measured to hold), `--diff` to preview | - | - | - |
162
162
  | infer with | `--infer-with CHECKERS` (`basedpyright`, `ty`, `pyrefly`, several: inferred types, as guesses) | `infer-with` | - | - |
163
163
  | infer from | `--infer-from FILE` (the types `python -m constricter.trace -m pytest` recorded from a run, as guesses) | `infer-from` | - | - |
164
164
  | show fixes | `--show-fixes` (each fix and how it was decided; with `--fix`, those made too) | - | - | - |
@@ -218,8 +218,10 @@ ignore = ["LVA003"]
218
218
  `count: int = 0`), a container whose elements agree, a constructor or a function that declares its
219
219
  return type or whose `return`s agree (in another checked file too), a copy, subscript, attribute or
220
220
  method call of a local whose type is known, and values computed from those; a loop's target or an
221
- unpacking's names get a declaration on the line before. `--unsafe-fixes` adds guesses, and
222
- `--show-fixes` lists each fix and how its value decided it, and after `--fix` each one made.
221
+ unpacking's names get a declaration on the line before. `--unsafe-fixes` adds guesses, `--likely`
222
+ only those measured to hold as often as a certain fix
223
+ ([docs/LIKELY.md](https://github.com/ivylikethevine/python-constricter/blob/main/docs/LIKELY.md)),
224
+ and `--show-fixes` lists each fix and how its value decided it, and after `--fix` each one made.
223
225
  `--infer-with basedpyright` (or `ty`, or `pyrefly`, or several: `basedpyright,ty`; each installed
224
226
  alongside) asks those type checkers for what `--fix` can't type itself, as guesses;
225
227
  `--infer-from FILE` takes the types a run bound each name to, recorded by
@@ -234,6 +236,9 @@ uvx --from python-constricter constricter # or run it without installing: uv's t
234
236
  pipx run --spec python-constricter constricter # or pipx's
235
237
  ```
236
238
 
239
+ On CPython 3.11 to 3.14 for Linux, macOS and Windows, pip installs a build compiled with mypyc,
240
+ about a fifth faster; anywhere else, the pure Python one, which finds and fixes the same.
241
+
237
242
  Tools that run flake8 or pylint (VS Code's extensions, python-lsp-server, prospector, MegaLinter,
238
243
  Trunk) pick the plugin up once it's installed alongside them.
239
244
 
@@ -241,15 +246,18 @@ Without `lint.external`, ruff flags `# noqa: LVA00x` (RUF102) and `--fix` delete
241
246
 
242
247
  The CLI defaults to `.`, checks `*.py` and `*.ipynb`, and skips hidden dirs, `__pycache__`, `venv`,
243
248
  `site-packages`, `build`, `dist` and `node_modules` by directory name; `--exclude` adds more
244
- directory names (or globs) to skip the same way, on top of matching whole paths and file names. Exit
245
- codes: `0` no errors, `1` errors, `2` an unreadable or unparsable file, a `--fix` its encoding can't
246
- hold, or a bad `pyproject.toml`. A module is read in its PEP 263 declaration's encoding.
249
+ directory names (or globs) to skip the same way, on top of matching whole paths and file names.
250
+ Under a directory in a git checkout it checks only what git tracks or would, so nothing a
251
+ `.gitignore` names (a file named on the command line is checked regardless); `--no-gitignore`, or
252
+ `gitignore = false`, walks the directory whole. Exit codes: `0` no errors, `1` errors, `2` an
253
+ unreadable or unparsable file, a `--fix` its encoding can't hold, or a bad `pyproject.toml`. A
254
+ module is read in its PEP 263 declaration's encoding.
247
255
 
248
256
  pre-commit, after ruff's hooks (or `constricter-fix`, which runs `--fix` first):
249
257
 
250
258
  ```yaml
251
259
  - repo: https://github.com/ivylikethevine/python-constricter
252
- rev: v0.3.5
260
+ rev: vX.Y.Z # the latest release; `pre-commit autoupdate` sets it
253
261
  hooks:
254
262
  - id: constricter
255
263
  ```
@@ -334,7 +342,7 @@ it to code scanning (the job needs `security-events: write`; the
334
342
  ```yaml
335
343
  - run: constricter --format=sarif src > constricter.sarif
336
344
  - if: ${{ !cancelled() }} # upload the findings even when the step above failed on them
337
- uses: github/codeql-action/upload-sarif@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
345
+ uses: github/codeql-action/upload-sarif@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
338
346
  with:
339
347
  sarif_file: constricter.sarif
340
348
  category: constricter
@@ -1,6 +1,7 @@
1
1
  # SPDX-License-Identifier: MIT
2
2
  """Every local variable typed where it's first bound."""
3
3
 
4
+ from constricter._version import __version__ # written by the build, from the git tag
4
5
  from constricter.offences import (
5
6
  COMMENT_TYPED_TARGET,
6
7
  DEFAULT_CHECKS,
@@ -25,7 +26,6 @@ from constricter.offences import (
25
26
  )
26
27
  from constricter.rules.checker import Coverage, annotation_coverage, check_source, check_tree
27
28
 
28
- __version__ = "0.3.5"
29
29
  __all__ = [
30
30
  "COMMENT_TYPED_TARGET",
31
31
  "DEFAULT_CHECKS",
@@ -0,0 +1,4 @@
1
+ # SPDX-License-Identifier: MIT
2
+ """The version this was built as, from its git tag (written by the build, not tracked)."""
3
+
4
+ __version__ = "0.4.1"
@@ -6,15 +6,21 @@ cyclic. Left to itself, the collector looked through the kept trees again and ag
6
6
  allocated: a third of the standard library's check (34s, 21s without). So while the command runs,
7
7
  it's off: what indexing built is frozen (never looked through again), and after each file, only
8
8
  what's been allocated since (the young generations) is collected, which bounds what a cycle can hold.
9
+ Not on a free-threaded build, whose collector has no generations: each collection there looks through
10
+ everything, and one after every file made a check several times as long. Its cycles wait for the run's
11
+ end (a check of pandas held 2.9 GB so, to 2.7 GB).
9
12
  """
10
13
 
11
14
  import contextlib
12
15
  import gc
16
+ import sysconfig
13
17
  from collections.abc import Generator
14
18
  from typing import Final
15
19
 
16
20
  _YOUNG: Final = 1 # the generations collected after each file: 0 and 1, never the frozen or the old
17
21
  _FREEZES: Final = hasattr(gc, "freeze") # PyPy's collector has no freezing
22
+ # Whether the collector has generations: a free-threaded build's has none, its GIL on or off.
23
+ _YOUNGER: Final = not sysconfig.get_config_var("Py_GIL_DISABLED")
18
24
 
19
25
 
20
26
  @contextlib.contextmanager
@@ -44,4 +50,5 @@ def indexed() -> None:
44
50
 
45
51
  def sweep() -> None:
46
52
  """Collect what the file just checked left behind (see the module docstring)."""
47
- _ = gc.collect(_YOUNG)
53
+ if _YOUNGER:
54
+ _ = gc.collect(_YOUNG)