sphinx-codelinks 1.4.0__tar.gz → 2.0.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 (45) hide show
  1. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/PKG-INFO +25 -8
  2. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/README.md +4 -2
  3. sphinx_codelinks-2.0.1/pyproject.toml +97 -0
  4. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/__init__.py +1 -1
  5. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/__init__.py +0 -0
  6. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/analyse.py +874 -0
  7. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/models.py +139 -0
  8. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/multiline_parser.py +656 -0
  9. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/oneline_parser.py +450 -0
  10. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/analyse/preproc/libclang_parser.py +8 -3
  11. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/analyse/preproc/loader.py +4 -4
  12. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/projects.py +33 -0
  13. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/references.py +188 -0
  14. sphinx_codelinks-2.0.1/src/sphinx_codelinks/analyse/utils.py +681 -0
  15. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/cmd.py +69 -28
  16. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/config.py +396 -94
  17. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/logger.py +8 -7
  18. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/needextend_write.py +28 -10
  19. sphinx_codelinks-2.0.1/src/sphinx_codelinks/py.typed +0 -0
  20. sphinx_codelinks-2.0.1/src/sphinx_codelinks/source_discover/__init__.py +0 -0
  21. sphinx_codelinks-2.0.1/src/sphinx_codelinks/source_discover/config.py +204 -0
  22. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/source_discover/source_discover.py +79 -10
  23. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/__init__.py +0 -0
  24. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/sphinx_extension/debug.py +56 -18
  25. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/directives/__init__.py +0 -0
  26. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/directives/src_trace.py +771 -0
  27. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/sphinx_extension/html_wrapper.py +16 -8
  28. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/need_id_refs.py +236 -0
  29. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/project_analysis.py +257 -0
  30. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/rediscovery.py +728 -0
  31. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/source_tracing.py +470 -0
  32. sphinx_codelinks-2.0.1/src/sphinx_codelinks/sphinx_extension/string_links.py +126 -0
  33. sphinx_codelinks-1.4.0/pyproject.toml +0 -182
  34. sphinx_codelinks-1.4.0/src/sphinx_codelinks/analyse/analyse.py +0 -524
  35. sphinx_codelinks-1.4.0/src/sphinx_codelinks/analyse/models.py +0 -86
  36. sphinx_codelinks-1.4.0/src/sphinx_codelinks/analyse/oneline_parser.py +0 -206
  37. sphinx_codelinks-1.4.0/src/sphinx_codelinks/analyse/projects.py +0 -78
  38. sphinx_codelinks-1.4.0/src/sphinx_codelinks/analyse/utils.py +0 -523
  39. sphinx_codelinks-1.4.0/src/sphinx_codelinks/source_discover/config.py +0 -122
  40. sphinx_codelinks-1.4.0/src/sphinx_codelinks/sphinx_extension/directives/src_trace.py +0 -343
  41. sphinx_codelinks-1.4.0/src/sphinx_codelinks/sphinx_extension/source_tracing.py +0 -269
  42. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/LICENSE +0 -0
  43. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/analyse/preproc/__init__.py +0 -0
  44. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/analyse/preproc/compile_db.py +1 -1
  45. {sphinx_codelinks-1.4.0 → sphinx_codelinks-2.0.1}/src/sphinx_codelinks/sphinx_extension/ub_sct.css +0 -0
@@ -1,33 +1,48 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sphinx-codelinks
3
- Version: 1.4.0
3
+ Version: 2.0.1
4
4
  Summary: Fast Source Code Traceability for Sphinx-Needs
5
5
  Author-email: team useblocks <info@useblocks.com>
6
6
  Maintainer-email: Marco Heinemann <marco.heinemann@useblocks.com>, Jui-Wen Chen <jui-wen.chen@useblocks.com>
7
- Requires-Python: >= 3.12
7
+ Requires-Python: >=3.11,<4
8
8
  Description-Content-Type: text/markdown
9
+ Classifier: Typing :: Typed
9
10
  License-File: LICENSE
10
11
  Requires-Dist: comment-parser>=1.2.4
11
12
  Requires-Dist: ignore-python>=0.3.3
12
- Requires-Dist: typer>=0.16.0,<0.26.8
13
- Requires-Dist: click < 8.2
13
+ Requires-Dist: typer>=0.16.0
14
14
  Requires-Dist: jsonschema
15
15
  Requires-Dist: sphinx>=7.4,<10
16
- Requires-Dist: sphinx-needs>=5,<9
16
+ Requires-Dist: sphinx-needs>=9.1.0,<10
17
+ Requires-Dist: ub-project>=1.1.0,<2
17
18
  Requires-Dist: jinja2
18
19
  Requires-Dist: pygments
19
- Requires-Dist: docutils
20
+ Requires-Dist: docutils>=0.21
20
21
  Requires-Dist: tree-sitter-cpp>=0.23.4
21
22
  Requires-Dist: giturlparse>=0.12.0
22
23
  Requires-Dist: tree-sitter-python>=0.23.6
23
24
  Requires-Dist: tree-sitter~=0.25.1
24
25
  Requires-Dist: tree-sitter-c-sharp>=0.23.1
26
+ Requires-Dist: tree-sitter-typescript>=0.23.2
25
27
  Requires-Dist: tree-sitter-yaml>=0.7.1
26
28
  Requires-Dist: tree-sitter-rust>=0.23.0
27
29
  Requires-Dist: tree-sitter-go>=0.23.0
28
30
  Requires-Dist: tree-sitter-json>=0.24.8
29
31
  Requires-Dist: tree-sitter-bash>=0.25.1
32
+ Requires-Dist: furo>=2025.12.19 ; extra == "docs"
33
+ Requires-Dist: myst-parser>=4.0.0 ; extra == "docs"
34
+ Requires-Dist: sphinx-ai-index>=1.0.0,<2 ; extra == "docs"
35
+ Requires-Dist: sphinx-design>=0.6.1 ; extra == "docs"
36
+ Requires-Dist: sphinx-code-tabs>=0.5.5 ; extra == "docs"
37
+ Requires-Dist: sphinxcontrib-typer>=0.9.1 ; extra == "docs"
38
+ Requires-Dist: sphinxcontrib-video>=0.4.1 ; extra == "docs"
30
39
  Requires-Dist: libclang>=16 ; extra == "libclang"
40
+ Project-URL: Changelog, https://github.com/useblocks/sphinx-needs/blob/master/packages/sphinx-codelinks/docs/changelog.rst
41
+ Project-URL: Documentation, https://codelinks.useblocks.com
42
+ Project-URL: Homepage, https://codelinks.useblocks.com
43
+ Project-URL: Issues, https://github.com/useblocks/sphinx-needs/issues
44
+ Project-URL: Repository, https://github.com/useblocks/sphinx-needs
45
+ Provides-Extra: docs
31
46
  Provides-Extra: libclang
32
47
 
33
48
  # Sphinx CodeLinks
@@ -51,9 +66,11 @@ Add to your `conf.py`:
51
66
 
52
67
  ```python
53
68
  extensions = ['sphinx_needs', 'sphinx_codelinks']
54
- src_trace_config_from_toml = "codelinks.toml"
55
69
  ```
56
70
 
71
+ Sphinx-CodeLinks reads its configuration from an `ubproject.toml` file next to
72
+ `conf.py` by default (configurable via `src_trace_config_from_toml`).
73
+
57
74
  ## Documentation
58
75
 
59
76
  Full documentation: https://codelinks.useblocks.com
@@ -67,5 +84,5 @@ Full documentation: https://codelinks.useblocks.com
67
84
 
68
85
  ## Development
69
86
 
70
- See [Development Guide](docs/source/development/) for contributing guidelines.
87
+ See [Development Guide](docs/development/) for contributing guidelines.
71
88
 
@@ -19,9 +19,11 @@ Add to your `conf.py`:
19
19
 
20
20
  ```python
21
21
  extensions = ['sphinx_needs', 'sphinx_codelinks']
22
- src_trace_config_from_toml = "codelinks.toml"
23
22
  ```
24
23
 
24
+ Sphinx-CodeLinks reads its configuration from an `ubproject.toml` file next to
25
+ `conf.py` by default (configurable via `src_trace_config_from_toml`).
26
+
25
27
  ## Documentation
26
28
 
27
29
  Full documentation: https://codelinks.useblocks.com
@@ -35,4 +37,4 @@ Full documentation: https://codelinks.useblocks.com
35
37
 
36
38
  ## Development
37
39
 
38
- See [Development Guide](docs/source/development/) for contributing guidelines.
40
+ See [Development Guide](docs/development/) for contributing guidelines.
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "sphinx-codelinks"
3
+ version = "2.0.1"
4
+ description = "Fast Source Code Traceability for Sphinx-Needs"
5
+ authors = [{ name = "team useblocks", email = "info@useblocks.com" }]
6
+ maintainers = [
7
+ { name = "Marco Heinemann", email = "marco.heinemann@useblocks.com" },
8
+ { name = "Jui-Wen Chen", email = "jui-wen.chen@useblocks.com" },
9
+ ]
10
+ license = { file = "LICENSE" }
11
+ readme = "README.md"
12
+ # EQUAL to the sphinx-needs workspace root's `requires-python`, deliberately: on import
13
+ # `tools/src/sn_tools/check_workspace.py` check (3) compares the two strings for equality,
14
+ # because uv resolves one lock against the root and a member out of step with it still
15
+ # locks, builds and publishes -- the gap shows up only as an install failure for a user on
16
+ # an interpreter inside it.
17
+ requires-python = ">=3.11,<4"
18
+ classifiers = ["Typing :: Typed"]
19
+ dependencies = [
20
+ "comment-parser>=1.2.4",
21
+ "ignore-python>=0.3.3",
22
+ "typer>=0.16.0",
23
+ "jsonschema",
24
+ "sphinx>=7.4,<10",
25
+ # TIGHT tracking, not a compatibility range: sphinx-needs is a sibling in the workspace
26
+ # this package is being imported into, and `check_workspace.py` check (4) requires
27
+ # `>=<the sibling's current version>,<<its next major>` on every intra-workspace runtime
28
+ # edge. uv never validates a specifier it resolves through `workspace = true` (uv#9811),
29
+ # so the floor is the only statement of what was actually tested, and the cap is what
30
+ # stops a future major being co-installed with a wheel written against this one.
31
+ "sphinx-needs>=9.1.0,<10",
32
+ "ub-project>=1.1.0,<2",
33
+ "jinja2",
34
+ "pygments",
35
+ "docutils>=0.21", # the `typing` group's series
36
+ "tree-sitter-cpp>=0.23.4",
37
+ "giturlparse>=0.12.0",
38
+ "tree-sitter-python>=0.23.6",
39
+ # >=0.25.1: 0.25.0 segfaulted on linux-arm, https://github.com/tree-sitter/py-tree-sitter/issues/386
40
+ # Not 0.26.0: its Point getters return a borrowed ref, corrupting the heap past row 256 (py-tree-sitter#472,
41
+ # fixed by #466, unreleased at 2026-09-29). Once 0.26.1 ships: `>=0.25.1,!=0.26.0,<0.27`, proven by test_analyse_long_source.py
42
+ "tree-sitter~=0.25.1",
43
+ "tree-sitter-c-sharp>=0.23.1",
44
+ "tree-sitter-typescript>=0.23.2",
45
+ "tree-sitter-yaml>=0.7.1",
46
+ "tree-sitter-rust>=0.23.0",
47
+ "tree-sitter-go>=0.23.0",
48
+ "tree-sitter-json>=0.24.8",
49
+ "tree-sitter-bash>=0.25.1",
50
+ ]
51
+
52
+ [project.optional-dependencies]
53
+ # libclang enables the preprocessor-aware C/C++ engine (skips comments inside
54
+ # inactive #if/#ifdef regions). Plain tree-sitter C/C++ extraction needs none of
55
+ # this, so libclang stays optional. Named after the backend, not "cpp": the
56
+ # engine handles C and Objective-C too, and tree-sitter already covers C++.
57
+ # Floor 16 (not 18): the extraction snapshots are byte-identical on libclang 16,
58
+ # 17 and 18 (the engine only uses get_all_skipped_ranges + comment tokenization,
59
+ # stable since long before 16), so support older toolchains too. No upper bound.
60
+ libclang = ["libclang>=16"]
61
+
62
+ # An EXTRA, not a dependency group, because Read the Docs installs extras and cannot install
63
+ # groups: its `python.install` block takes `extra_requirements`, and there is no equivalent
64
+ # for PEP 735 groups. It is also the shape a member of the sphinx-needs workspace has --
65
+ # the root there re-exports each member's extra (`docs-mounts = ["sphinx-mounts[docs]"]`),
66
+ # because `uv sync --extra` resolves against the workspace root rather than the member.
67
+ docs = [
68
+ "furo>=2025.12.19",
69
+ "myst-parser>=4.0.0",
70
+ "sphinx-ai-index>=1.0.0,<2",
71
+ "sphinx-design>=0.6.1",
72
+ "sphinx-code-tabs>=0.5.5",
73
+ "sphinxcontrib-typer>=0.9.1", # tracks typer's rich_utils internals: 0.9.1+ needs typer>=0.26.8 and declares it; older releases break on it
74
+ "sphinxcontrib-video>=0.4.1",
75
+ ]
76
+
77
+ [project.urls]
78
+ Homepage = "https://codelinks.useblocks.com"
79
+ Documentation = "https://codelinks.useblocks.com"
80
+ Repository = "https://github.com/useblocks/sphinx-needs"
81
+ Issues = "https://github.com/useblocks/sphinx-needs/issues"
82
+ Changelog = "https://github.com/useblocks/sphinx-needs/blob/master/packages/sphinx-codelinks/docs/changelog.rst"
83
+
84
+ [build-system]
85
+ requires = ["flit_core >=3.4,<4"]
86
+ build-backend = "flit_core.buildapi"
87
+
88
+ # Deliberately NO `[tool.flit.sdist]`: this distribution carries nothing outside the module
89
+ # (its `py.typed` marker included, which flit ships as part of it), so flit's module-only
90
+ # sdist is the shape already published on PyPI, and nothing downstream builds from it --
91
+ # the git pins in the wild clone the repository.
92
+ # Everything else -- ruff, ty, pytest and the dependency groups -- is the ROOT's, and
93
+ # `tools/src/sn_tools/check_workspace.py` check (7) refuses those tables here: a member
94
+ # `[tool.ruff]` does not extend the root's configuration, it replaces it.
95
+
96
+ [project.scripts]
97
+ codelinks = "sphinx_codelinks.cmd:app"
@@ -2,7 +2,7 @@
2
2
 
3
3
  from sphinx_codelinks.sphinx_extension.source_tracing import setup
4
4
 
5
- __version__ = "0.1.0"
5
+ __version__ = "2.0.1"
6
6
 
7
7
  __all__ = [
8
8
  "__version__",