topmark 0.6.0__tar.gz → 0.6.2__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 (81) hide show
  1. {topmark-0.6.0/src/topmark.egg-info → topmark-0.6.2}/PKG-INFO +3 -3
  2. {topmark-0.6.0 → topmark-0.6.2}/README.md +1 -1
  3. {topmark-0.6.0 → topmark-0.6.2}/pyproject.toml +2 -2
  4. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/api/__init__.py +5 -5
  5. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/console_helpers.py +4 -4
  6. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli_shared/utils.py +1 -1
  7. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/processors/base.py +2 -2
  8. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/registry/__init__.py +3 -3
  9. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/registry/filetypes.py +10 -10
  10. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/registry/registry.py +5 -5
  11. {topmark-0.6.0 → topmark-0.6.2/src/topmark.egg-info}/PKG-INFO +3 -3
  12. {topmark-0.6.0 → topmark-0.6.2}/src/topmark.egg-info/requires.txt +1 -1
  13. {topmark-0.6.0 → topmark-0.6.2}/LICENSE +0 -0
  14. {topmark-0.6.0 → topmark-0.6.2}/setup.cfg +0 -0
  15. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/__init__.py +0 -0
  16. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/api/public_types.py +0 -0
  17. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/api/types.py +0 -0
  18. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/__init__.py +0 -0
  19. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/cli_types.py +0 -0
  20. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/cmd_common.py +0 -0
  21. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/__init__.py +0 -0
  22. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/check.py +0 -0
  23. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/dump_config.py +0 -0
  24. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/filetypes.py +0 -0
  25. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/init_config.py +0 -0
  26. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/processors.py +0 -0
  27. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/show_defaults.py +0 -0
  28. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/strip.py +0 -0
  29. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/commands/version.py +0 -0
  30. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/config_resolver.py +0 -0
  31. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/console.py +0 -0
  32. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/console_std.py +0 -0
  33. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/errors.py +0 -0
  34. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/io.py +0 -0
  35. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/main.py +0 -0
  36. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/options.py +0 -0
  37. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli/utils.py +0 -0
  38. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli_shared/__init__.py +0 -0
  39. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli_shared/console_api.py +0 -0
  40. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/cli_shared/exit_codes.py +0 -0
  41. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/config/__init__.py +0 -0
  42. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/config/io.py +0 -0
  43. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/config/logging.py +0 -0
  44. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/config/topmark-default.toml +0 -0
  45. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/constants.py +0 -0
  46. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/file_resolver.py +0 -0
  47. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/filetypes/__init__.py +0 -0
  48. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/filetypes/base.py +0 -0
  49. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/filetypes/instances.py +0 -0
  50. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/filetypes/policy.py +0 -0
  51. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/filetypes/registry.py +0 -0
  52. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/__init__.py +0 -0
  53. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/context.py +0 -0
  54. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/contracts.py +0 -0
  55. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/pipelines.py +0 -0
  56. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/processors/__init__.py +0 -0
  57. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/processors/pound.py +0 -0
  58. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/processors/slash.py +0 -0
  59. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/processors/xml.py +0 -0
  60. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/runner.py +0 -0
  61. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/__init__.py +0 -0
  62. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/builder.py +0 -0
  63. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/comparer.py +0 -0
  64. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/patcher.py +0 -0
  65. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/reader.py +0 -0
  66. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/renderer.py +0 -0
  67. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/resolver.py +0 -0
  68. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/scanner.py +0 -0
  69. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/stripper.py +0 -0
  70. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/pipeline/steps/updater.py +0 -0
  71. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/py.typed +0 -0
  72. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/registry/processors.py +0 -0
  73. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/rendering/api.py +0 -0
  74. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/rendering/formats.py +0 -0
  75. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/utils/__init__.py +0 -0
  76. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/utils/diff.py +0 -0
  77. {topmark-0.6.0 → topmark-0.6.2}/src/topmark/utils/file.py +0 -0
  78. {topmark-0.6.0 → topmark-0.6.2}/src/topmark.egg-info/SOURCES.txt +0 -0
  79. {topmark-0.6.0 → topmark-0.6.2}/src/topmark.egg-info/dependency_links.txt +0 -0
  80. {topmark-0.6.0 → topmark-0.6.2}/src/topmark.egg-info/entry_points.txt +0 -0
  81. {topmark-0.6.0 → topmark-0.6.2}/src/topmark.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topmark
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: A Python CLI to inspect, validate, and manage license and copyright headers.
5
5
  Author-email: Olivier Biot <olivier.biot@gmail.com>
6
6
  License-Expression: MIT
@@ -43,7 +43,7 @@ Requires-Dist: pymdown-extensions>=10.8; extra == "docs"
43
43
  Requires-Dist: mkdocs-gen-files<0.6,>=0.5; extra == "docs"
44
44
  Requires-Dist: ruff; extra == "docs"
45
45
  Provides-Extra: test
46
- Requires-Dist: pytest; extra == "test"
46
+ Requires-Dist: pytest>=8.0; extra == "test"
47
47
  Requires-Dist: pytest-xdist; extra == "test"
48
48
  Provides-Extra: typing
49
49
  Requires-Dist: types-toml; extra == "typing"
@@ -289,7 +289,7 @@ topmark check --apply src/
289
289
  ```
290
290
 
291
291
  > For full details, options, examples, and exit codes, see the dedicated guide:
292
- > **[Adding & updating headers with `topmark`](docs/usage/commands/topmark.md)**
292
+ > **[Adding & updating headers with `topmark`](docs/usage/commands/check.md)**
293
293
 
294
294
  ### Removing headers with `strip`
295
295
 
@@ -238,7 +238,7 @@ topmark check --apply src/
238
238
  ```
239
239
 
240
240
  > For full details, options, examples, and exit codes, see the dedicated guide:
241
- > **[Adding & updating headers with `topmark`](docs/usage/commands/topmark.md)**
241
+ > **[Adding & updating headers with `topmark`](docs/usage/commands/check.md)**
242
242
 
243
243
  ### Removing headers with `strip`
244
244
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  [project]
12
12
  name = "topmark"
13
- version = "0.6.0"
13
+ version = "0.6.2"
14
14
  description = "A Python CLI to inspect, validate, and manage license and copyright headers."
15
15
  authors = [{ name = "Olivier Biot", email = "olivier.biot@gmail.com" }]
16
16
  license = "MIT"
@@ -95,7 +95,7 @@ docs = [
95
95
  ]
96
96
  test = [
97
97
  # Unit testing framework:
98
- "pytest",
98
+ "pytest>=8.0",
99
99
  # Parallel test execution:
100
100
  "pytest-xdist",
101
101
  ]
@@ -39,9 +39,9 @@ Notes:
39
39
  Configuration contract
40
40
  ----------------------
41
41
  - Public functions accept either a plain **mapping** (mirroring the TOML shape) or a frozen
42
- `topmark.config.Config`. We normalize/merge internally and run the pipeline against an
42
+ [`topmark.config.Config`][]. We normalize/merge internally and run the pipeline against an
43
43
  **immutable snapshot**.
44
- - The internal `topmark.config.MutableConfig` builder is **not part of the public API**.
44
+ - The internal [`topmark.config.MutableConfig`][] builder is **not part of the public API**.
45
45
  It exists to perform discovery/merging and then ``freeze()`` to a `Config` just before
46
46
  execution. This keeps runtime deterministic and avoids accidental mutation.
47
47
  - To "update config" programmatically, pass a mapping to the function call:
@@ -456,7 +456,7 @@ def check(
456
456
  to narrow discovery.
457
457
  add_only (bool): Only add missing headers; do not update existing ones.
458
458
  update_only (bool): Only update non-compliant headers; do not add new ones.
459
- skip_compliant (bool) : Exclude already-compliant files from the returned view.
459
+ skip_compliant (bool): Exclude already-compliant files from the returned view.
460
460
  skip_unsupported (bool): Exclude unsupported files from the returned view.
461
461
 
462
462
  Returns:
@@ -617,7 +617,7 @@ def get_filetype_info(long: bool = False) -> list[FileTypeInfo]:
617
617
 
618
618
  Notes:
619
619
  For object-level access, prefer `FileTypeRegistry` from
620
- `topmark.registry`. This function returns metadata (not the objects).
620
+ [`topmark.registry`][]. This function returns metadata (not the objects).
621
621
  """
622
622
  proc_reg = Registry.processors()
623
623
 
@@ -658,7 +658,7 @@ def get_processor_info(long: bool = False) -> list[ProcessorInfo]:
658
658
 
659
659
  Notes:
660
660
  For object-level access, prefer `HeaderProcessorRegistry` from
661
- `topmark.registry`. This function returns metadata (not the objects).
661
+ [`topmark.registry`][]. This function returns metadata (not the objects).
662
662
  """
663
663
  # Ensure all processors are registered before listing (idempotent)
664
664
  Registry.ensure_processors_registered()
@@ -10,9 +10,9 @@
10
10
 
11
11
  """Utilities for obtaining a program-output console independent of Click.
12
12
 
13
- This module exposes `get_console_safely` which returns the project’s
14
- console for user-facing output when running under a Click context, and a
15
- no-dependency stdlib fallback (`StdConsole`) when no context is active
13
+ This module exposes `get_console_safely` which returns the project’s console
14
+ for user-facing output when running under a Click context, and a no-dependency
15
+ stdlib fallback ([`topmark.cli.console_std.StdConsole`][]) when no context is active
16
16
  (e.g., when the API is invoked directly from tests).
17
17
  """
18
18
 
@@ -33,7 +33,7 @@ def get_console_safely() -> ConsoleLike:
33
33
 
34
34
  If an active Click context exists and a console instance is stored in
35
35
  ``ctx.obj["console"]``, that console is returned. Otherwise, a
36
- [`topmark.cli.console_std.StdConsole`][topmark.cli.console_std.StdConsole] is returned to avoid
36
+ [`topmark.cli.console_std.StdConsole`][] is returned to avoid
37
37
  raising ``RuntimeError: There is no active click context`` when the
38
38
  library is used programmatically (e.g., via pytest).
39
39
  """
@@ -46,7 +46,7 @@ class OutputFormat(str, Enum):
46
46
 
47
47
  Notes:
48
48
  - Machine formats (``JSON`` and ``NDJSON``) must not include ANSI color or diffs.
49
- - Use with [`EnumChoiceParam`][topmark.cli.cli_types.EnumChoiceParam] to parse ``--format``
49
+ - Use with [`topmark.cli.cli_types.EnumChoiceParam`][] to parse ``--format``
50
50
  from Click.
51
51
  """
52
52
 
@@ -38,7 +38,7 @@ class HeaderProcessor:
38
38
  """Base class for header processors that handle specific file types.
39
39
 
40
40
  A *header processor* knows how to **find**, **render**, and **modify** TopMark
41
- headers for one concrete [`topmark.filetypes.base.FileType`][topmark.filetypes.base.FileType].
41
+ headers for one concrete [`topmark.filetypes.base.FileType`][].
42
42
  The registry binds a processor instance to a file type at runtime (``proc.file_type = ft``),
43
43
  and TopMark uses that pairing during scanning and updates.
44
44
 
@@ -59,7 +59,7 @@ class HeaderProcessor:
59
59
 
60
60
  What this class does **not** do:
61
61
  - **Content‑based recognition.** Deciding *which* file type a path belongs
62
- to is the role of [`topmark.filetypes.base.FileType`][topmark.filetypes.base.FileType] via
62
+ to is the role of [`topmark.filetypes.base.FileType`][] via
63
63
  `FileType.content_matcher`. The processor assumes it is already
64
64
  associated with the correct file type.
65
65
 
@@ -12,9 +12,9 @@
12
12
 
13
13
  This package exposes:
14
14
 
15
- * [`Registry`][topmark.registry.Registry] – the **stable, read-only facade** for integrators.
16
- * [`FileTypeRegistry`][topmark.registry.FileTypeRegistry] and
17
- [`HeaderProcessorRegistry`][topmark.registry.HeaderProcessorRegistry] – advanced,
15
+ * [`topmark.registry.Registry`][] – the **stable, read-only facade** for integrators.
16
+ * [`topmark.registry.FileTypeRegistry`][] and
17
+ [`topmark.registry.HeaderProcessorRegistry`][] – advanced,
18
18
  low-level registries intended for plugins and tests (no semver stability guarantee).
19
19
 
20
20
  Most users should import from here:
@@ -59,10 +59,10 @@ class FileTypeRegistry:
59
59
  Returns:
60
60
  tuple[str, ...]: Sorted file type names.
61
61
  """
62
- from topmark.filetypes.instances import get_file_type_registry as _get
62
+ from topmark.filetypes.instances import get_file_type_registry as _get_ft
63
63
 
64
64
  with cls._lock:
65
- return tuple(sorted(_get().keys()))
65
+ return tuple(sorted(_get_ft().keys()))
66
66
 
67
67
  @classmethod
68
68
  def supported_names(cls) -> tuple[str, ...]:
@@ -92,10 +92,10 @@ class FileTypeRegistry:
92
92
  Returns:
93
93
  FileType | None: The `FileType` object if found, else None.
94
94
  """
95
- from topmark.filetypes.instances import get_file_type_registry as _get
95
+ from topmark.filetypes.instances import get_file_type_registry as _get_ft
96
96
 
97
97
  with cls._lock:
98
- return _get().get(name)
98
+ return _get_ft().get(name)
99
99
 
100
100
  @classmethod
101
101
  def as_mapping(cls) -> Mapping[str, FileType]:
@@ -107,10 +107,10 @@ class FileTypeRegistry:
107
107
  Notes:
108
108
  The returned mapping is a `MappingProxyType` and must not be mutated.
109
109
  """
110
- from topmark.filetypes.instances import get_file_type_registry as _get
110
+ from topmark.filetypes.instances import get_file_type_registry as _get_ft
111
111
 
112
112
  with cls._lock:
113
- return MappingProxyType(_get())
113
+ return MappingProxyType(_get_ft())
114
114
 
115
115
  @classmethod
116
116
  def iter_meta(cls) -> Iterator[FileTypeMeta]:
@@ -119,10 +119,10 @@ class FileTypeRegistry:
119
119
  Yields:
120
120
  FileTypeMeta: Serializable metadata about each file type.
121
121
  """
122
- from topmark.filetypes.instances import get_file_type_registry as _get
122
+ from topmark.filetypes.instances import get_file_type_registry as _get_ft
123
123
 
124
124
  with cls._lock:
125
- for name, ft in _get().items():
125
+ for name, ft in _get_ft().items():
126
126
  yield FileTypeMeta(
127
127
  name=name,
128
128
  description=getattr(ft, "description", "") or "",
@@ -191,8 +191,8 @@ class FileTypeRegistry:
191
191
  - Thread safe via RLock; process-global state; do not mutate in long-lived
192
192
  multi-tenant processes.
193
193
  """
194
- from topmark.filetypes.instances import get_file_type_registry as _get
194
+ from topmark.filetypes.instances import get_file_type_registry as _get_ft
195
195
 
196
196
  with cls._lock:
197
- reg: MutableMapping[str, FileType] = _get()
197
+ reg: MutableMapping[str, FileType] = _get_ft()
198
198
  return reg.pop(name, None) is not None
@@ -15,11 +15,11 @@ This module exposes structured, read-only oriented registries plus optional
15
15
  mutation hooks. It is part of the public API and provides stable, serializable
16
16
  metadata views without exposing internal implementation details.
17
17
 
18
- The [`Registry`][topmark.registry.Registry] facade is the **stable public surface**
18
+ The [`topmark.registry.Registry`][] facade is the **stable public surface**
19
19
  for read-only operations; the concrete registries remain available for advanced scenarios
20
20
  and tests but are not part of the semver stability promise.
21
21
 
22
- A FileType can be recognized (present in [`FileTypeRegistry`][topmark.registry.FileTypeRegistry])
22
+ A FileType can be recognized (present in [`topmark.registry.FileTypeRegistry`][])
23
23
  but unsupported (no processor registered).
24
24
 
25
25
  Typical usage:
@@ -43,8 +43,8 @@ Typical usage:
43
43
 
44
44
  Warning:
45
45
  Mutations operate on global registries shared across the process. Use them
46
- sparingly in production; in tests, wrap them in try/finally or a dedicated
47
- context manager to ensure cleanup.
46
+ sparingly in production; in tests, wrap them in ``try``/``finally``
47
+ or a dedicated context manager to ensure cleanup.
48
48
  """
49
49
 
50
50
  from __future__ import annotations
@@ -81,7 +81,7 @@ def iter_bindings() -> Iterator[Binding]:
81
81
  Binding: A pair containing file type metadata and the optionally
82
82
  bound processor metadata (``None`` for unsupported types).
83
83
  """
84
- proc = {m.name: m for m in HeaderProcessorRegistry.iter_meta()}
84
+ proc: dict[str, ProcessorMeta] = {m.name: m for m in HeaderProcessorRegistry.iter_meta()}
85
85
  for ft in FileTypeRegistry.iter_meta():
86
86
  yield Binding(filetype=ft, processor=proc.get(ft.name))
87
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topmark
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: A Python CLI to inspect, validate, and manage license and copyright headers.
5
5
  Author-email: Olivier Biot <olivier.biot@gmail.com>
6
6
  License-Expression: MIT
@@ -43,7 +43,7 @@ Requires-Dist: pymdown-extensions>=10.8; extra == "docs"
43
43
  Requires-Dist: mkdocs-gen-files<0.6,>=0.5; extra == "docs"
44
44
  Requires-Dist: ruff; extra == "docs"
45
45
  Provides-Extra: test
46
- Requires-Dist: pytest; extra == "test"
46
+ Requires-Dist: pytest>=8.0; extra == "test"
47
47
  Requires-Dist: pytest-xdist; extra == "test"
48
48
  Provides-Extra: typing
49
49
  Requires-Dist: types-toml; extra == "typing"
@@ -289,7 +289,7 @@ topmark check --apply src/
289
289
  ```
290
290
 
291
291
  > For full details, options, examples, and exit codes, see the dedicated guide:
292
- > **[Adding & updating headers with `topmark`](docs/usage/commands/topmark.md)**
292
+ > **[Adding & updating headers with `topmark`](docs/usage/commands/check.md)**
293
293
 
294
294
  ### Removing headers with `strip`
295
295
 
@@ -28,7 +28,7 @@ mkdocs-gen-files<0.6,>=0.5
28
28
  ruff
29
29
 
30
30
  [test]
31
- pytest
31
+ pytest>=8.0
32
32
  pytest-xdist
33
33
 
34
34
  [typing]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes