depsight 0.4.0__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 (31) hide show
  1. depsight-0.4.0/LICENSE +201 -0
  2. depsight-0.4.0/PKG-INFO +173 -0
  3. depsight-0.4.0/README.md +150 -0
  4. depsight-0.4.0/pyproject.toml +56 -0
  5. depsight-0.4.0/setup.cfg +4 -0
  6. depsight-0.4.0/src/depsight/__init__.py +3 -0
  7. depsight-0.4.0/src/depsight/cli.py +99 -0
  8. depsight-0.4.0/src/depsight/commands/__init__.py +0 -0
  9. depsight-0.4.0/src/depsight/commands/scan/__init__.py +3 -0
  10. depsight-0.4.0/src/depsight/commands/scan/scan.py +55 -0
  11. depsight-0.4.0/src/depsight/commands/scan/scan_widgets.py +71 -0
  12. depsight-0.4.0/src/depsight/core/__init__.py +0 -0
  13. depsight-0.4.0/src/depsight/core/dispatcher.py +69 -0
  14. depsight-0.4.0/src/depsight/core/plugins/__init__.py +3 -0
  15. depsight-0.4.0/src/depsight/core/plugins/base.py +65 -0
  16. depsight-0.4.0/src/depsight/core/plugins/dependency.py +42 -0
  17. depsight-0.4.0/src/depsight/core/plugins/factory.py +53 -0
  18. depsight-0.4.0/src/depsight/core/plugins/uv/__init__.py +0 -0
  19. depsight-0.4.0/src/depsight/core/plugins/uv/uv.py +153 -0
  20. depsight-0.4.0/src/depsight/core/plugins/vsce/__init__.py +0 -0
  21. depsight-0.4.0/src/depsight/core/plugins/vsce/vsce.py +108 -0
  22. depsight-0.4.0/src/depsight/utils/__init__.py +0 -0
  23. depsight-0.4.0/src/depsight/utils/constants.py +58 -0
  24. depsight-0.4.0/src/depsight/utils/logger.py +97 -0
  25. depsight-0.4.0/src/depsight/utils/utils.py +76 -0
  26. depsight-0.4.0/src/depsight.egg-info/PKG-INFO +173 -0
  27. depsight-0.4.0/src/depsight.egg-info/SOURCES.txt +29 -0
  28. depsight-0.4.0/src/depsight.egg-info/dependency_links.txt +1 -0
  29. depsight-0.4.0/src/depsight.egg-info/entry_points.txt +6 -0
  30. depsight-0.4.0/src/depsight.egg-info/requires.txt +3 -0
  31. depsight-0.4.0/src/depsight.egg-info/top_level.txt +1 -0
depsight-0.4.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: depsight
3
+ Version: 0.4.0
4
+ Summary: A modular dependency analysis framework
5
+ Author: Depsight Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/depsight/depsight-dependency-manager
8
+ Project-URL: Repository, https://github.com/depsight/depsight-dependency-manager
9
+ Project-URL: Issues, https://github.com/depsight/depsight-dependency-manager/issues
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Build Tools
16
+ Requires-Python: >=3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: click>=8.1.7
20
+ Requires-Dist: rich>=13.7.0
21
+ Requires-Dist: rich-click>=1.7.0
22
+ Dynamic: license-file
23
+
24
+ # Depsight - Dependency Analysis Framework
25
+
26
+ ## Usage
27
+
28
+ ### Installation
29
+
30
+ #### Via pip
31
+
32
+ ```bash
33
+ pip install depsight
34
+ ```
35
+
36
+ #### Via uv
37
+
38
+ ```bash
39
+ uv tool install depsight
40
+ ```
41
+
42
+ #### Via Docker
43
+
44
+ ```bash
45
+ docker pull <your-dockerhub-user>/depsight
46
+ ```
47
+
48
+ ### Getting Started
49
+
50
+ Read the docs.
51
+
52
+ ## Development
53
+
54
+ ### System Requirements
55
+
56
+ - **IDE with DevContainer support** — either of the following:
57
+ - [Visual Studio Code](https://code.visualstudio.com/) with the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension
58
+ - [JetBrains Gateway](https://www.jetbrains.com/remote-development/gateway/) (supports Dev Containers via the Remote Development plugin)
59
+ - **Container manager** — any one of the following:
60
+ - [Docker Desktop](https://www.docker.com/products/docker-desktop/) (macOS, Windows, Linux) (**RECOMMENDED**)
61
+ - [Docker Engine](https://docs.docker.com/engine/install/) (Linux)
62
+ - [Podman](https://podman.io/) with the Podman Desktop or CLI
63
+
64
+ ### Setup Locally
65
+
66
+ - Open Visual Studio Code at the project root directory
67
+ - When prompted, click **Reopen in Container** (or use Command Palette: `Dev Containers: Reopen in Container`)
68
+
69
+ <img src="./images/reopen_in_container.png" alt="Logo" width="400"/>
70
+
71
+ - Wait for the containers to build and start
72
+ - Once ready, you'll have a fully configured development environment with all dependencies installed
73
+ - Open a terminal inside the DevContainer and run `depsight --help`
74
+
75
+ ### Build Container Image
76
+
77
+ - Open a terminal inside the DevContainer (Docker-in-Docker is available)
78
+ - Build the image:
79
+
80
+ ```bash
81
+ docker build -t depsight .
82
+ ```
83
+
84
+ - Optionally override the Python or uv version via build args:
85
+
86
+ ```bash
87
+ docker build -t depsight --build-arg PYTHON_VERSION=3.13 --build-arg UV_VERSION=0.10.9 .
88
+ ```
89
+
90
+ - Verify the image works:
91
+
92
+ ```bash
93
+ docker run --rm depsight --help
94
+ ```
95
+
96
+ ### Run Tests
97
+
98
+ - Open a terminal inside the DevContainer
99
+ - Activate the virtual environment:
100
+
101
+ ```bash
102
+ source .venv/bin/activate
103
+ ```
104
+
105
+ - Run all tests:
106
+
107
+ ```bash
108
+ pytest tests/ -v
109
+ ```
110
+
111
+ ### Lint & Type Check
112
+
113
+ - Run the Ruff linter:
114
+
115
+ ```bash
116
+ ruff check src/ tests/
117
+ ```
118
+
119
+ - Run the Mypy type checker:
120
+
121
+ ```bash
122
+ mypy src/
123
+ ```
124
+
125
+ ### Build Docs
126
+
127
+ - Open a terminal inside the DevContainer
128
+ - Activate the virtual environment:
129
+
130
+ ```bash
131
+ source .venv/bin/activate
132
+ ```
133
+
134
+ - Serve the documentation locally with live reload:
135
+
136
+ ```bash
137
+ mkdocs serve
138
+ ```
139
+
140
+ The site will be available at `http://127.0.0.1:8000`.
141
+
142
+ - Alternatively, build the static site as a `site/` directory:
143
+
144
+ ```bash
145
+ mkdocs build
146
+ ```
147
+
148
+ ## Build
149
+
150
+ ### Pre-release
151
+
152
+ Use this to trigger a build manually at any time without creating a release.
153
+
154
+ - Navigate to your repository on GitHub and click the **Actions** tab
155
+ - Select the **Manual Dispatch** workflow from the left sidebar
156
+ - Click **Run workflow**
157
+ - Enter the `depsight_version` (must match the `version` field in `pyproject.toml`, e.g. `0.1.0`)
158
+ - Select the desired `python_version` (`3.12` or `3.13`, defaults to `3.12`)
159
+ - Optionally set `uv_version` (defaults to `0.10.9`)
160
+ - Optionally check **Upload wheel as artifact** to download the built `.whl` after the run
161
+ - Click **Run workflow**
162
+ - Once the run completes, the wheel is available under the run's **Artifacts** section (if enabled)
163
+
164
+ ### Release
165
+
166
+ Use this to publish an official versioned build. The wheel is automatically attached to the GitHub Release.
167
+
168
+ - Bump the `version` field in `pyproject.toml` to the desired version (e.g. `1.2.3`)
169
+ - Commit and push the change to `main`
170
+ - Navigate to your repository on GitHub and click **Releases** → **Draft a new release**
171
+ - Create a new tag matching the version in `pyproject.toml` exactly (e.g. `1.2.3`)
172
+ - Click **Publish release**
173
+ - The **On Release** workflow triggers automatically, runs the full CI pipeline, and uploads the `.whl` to the release assets
@@ -0,0 +1,150 @@
1
+ # Depsight - Dependency Analysis Framework
2
+
3
+ ## Usage
4
+
5
+ ### Installation
6
+
7
+ #### Via pip
8
+
9
+ ```bash
10
+ pip install depsight
11
+ ```
12
+
13
+ #### Via uv
14
+
15
+ ```bash
16
+ uv tool install depsight
17
+ ```
18
+
19
+ #### Via Docker
20
+
21
+ ```bash
22
+ docker pull <your-dockerhub-user>/depsight
23
+ ```
24
+
25
+ ### Getting Started
26
+
27
+ Read the docs.
28
+
29
+ ## Development
30
+
31
+ ### System Requirements
32
+
33
+ - **IDE with DevContainer support** — either of the following:
34
+ - [Visual Studio Code](https://code.visualstudio.com/) with the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension
35
+ - [JetBrains Gateway](https://www.jetbrains.com/remote-development/gateway/) (supports Dev Containers via the Remote Development plugin)
36
+ - **Container manager** — any one of the following:
37
+ - [Docker Desktop](https://www.docker.com/products/docker-desktop/) (macOS, Windows, Linux) (**RECOMMENDED**)
38
+ - [Docker Engine](https://docs.docker.com/engine/install/) (Linux)
39
+ - [Podman](https://podman.io/) with the Podman Desktop or CLI
40
+
41
+ ### Setup Locally
42
+
43
+ - Open Visual Studio Code at the project root directory
44
+ - When prompted, click **Reopen in Container** (or use Command Palette: `Dev Containers: Reopen in Container`)
45
+
46
+ <img src="./images/reopen_in_container.png" alt="Logo" width="400"/>
47
+
48
+ - Wait for the containers to build and start
49
+ - Once ready, you'll have a fully configured development environment with all dependencies installed
50
+ - Open a terminal inside the DevContainer and run `depsight --help`
51
+
52
+ ### Build Container Image
53
+
54
+ - Open a terminal inside the DevContainer (Docker-in-Docker is available)
55
+ - Build the image:
56
+
57
+ ```bash
58
+ docker build -t depsight .
59
+ ```
60
+
61
+ - Optionally override the Python or uv version via build args:
62
+
63
+ ```bash
64
+ docker build -t depsight --build-arg PYTHON_VERSION=3.13 --build-arg UV_VERSION=0.10.9 .
65
+ ```
66
+
67
+ - Verify the image works:
68
+
69
+ ```bash
70
+ docker run --rm depsight --help
71
+ ```
72
+
73
+ ### Run Tests
74
+
75
+ - Open a terminal inside the DevContainer
76
+ - Activate the virtual environment:
77
+
78
+ ```bash
79
+ source .venv/bin/activate
80
+ ```
81
+
82
+ - Run all tests:
83
+
84
+ ```bash
85
+ pytest tests/ -v
86
+ ```
87
+
88
+ ### Lint & Type Check
89
+
90
+ - Run the Ruff linter:
91
+
92
+ ```bash
93
+ ruff check src/ tests/
94
+ ```
95
+
96
+ - Run the Mypy type checker:
97
+
98
+ ```bash
99
+ mypy src/
100
+ ```
101
+
102
+ ### Build Docs
103
+
104
+ - Open a terminal inside the DevContainer
105
+ - Activate the virtual environment:
106
+
107
+ ```bash
108
+ source .venv/bin/activate
109
+ ```
110
+
111
+ - Serve the documentation locally with live reload:
112
+
113
+ ```bash
114
+ mkdocs serve
115
+ ```
116
+
117
+ The site will be available at `http://127.0.0.1:8000`.
118
+
119
+ - Alternatively, build the static site as a `site/` directory:
120
+
121
+ ```bash
122
+ mkdocs build
123
+ ```
124
+
125
+ ## Build
126
+
127
+ ### Pre-release
128
+
129
+ Use this to trigger a build manually at any time without creating a release.
130
+
131
+ - Navigate to your repository on GitHub and click the **Actions** tab
132
+ - Select the **Manual Dispatch** workflow from the left sidebar
133
+ - Click **Run workflow**
134
+ - Enter the `depsight_version` (must match the `version` field in `pyproject.toml`, e.g. `0.1.0`)
135
+ - Select the desired `python_version` (`3.12` or `3.13`, defaults to `3.12`)
136
+ - Optionally set `uv_version` (defaults to `0.10.9`)
137
+ - Optionally check **Upload wheel as artifact** to download the built `.whl` after the run
138
+ - Click **Run workflow**
139
+ - Once the run completes, the wheel is available under the run's **Artifacts** section (if enabled)
140
+
141
+ ### Release
142
+
143
+ Use this to publish an official versioned build. The wheel is automatically attached to the GitHub Release.
144
+
145
+ - Bump the `version` field in `pyproject.toml` to the desired version (e.g. `1.2.3`)
146
+ - Commit and push the change to `main`
147
+ - Navigate to your repository on GitHub and click **Releases** → **Draft a new release**
148
+ - Create a new tag matching the version in `pyproject.toml` exactly (e.g. `1.2.3`)
149
+ - Click **Publish release**
150
+ - The **On Release** workflow triggers automatically, runs the full CI pipeline, and uploads the `.whl` to the release assets
@@ -0,0 +1,56 @@
1
+ [project]
2
+ name = "depsight"
3
+ version = "0.4.0"
4
+ description = "A modular dependency analysis framework"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.12"
8
+ authors = [
9
+ { name = "Depsight Contributors" },
10
+ ]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Intended Audience :: Developers",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.12",
16
+ "Programming Language :: Python :: 3.13",
17
+ "Topic :: Software Development :: Build Tools",
18
+ ]
19
+ dependencies = [
20
+ "click>=8.1.7",
21
+ "rich>=13.7.0",
22
+ "rich-click>=1.7.0",
23
+ ]
24
+
25
+ [dependency-groups]
26
+ dev = [
27
+ "mypy>=1.10",
28
+ "pytest>=8.0",
29
+ "ruff>=0.4",
30
+ ]
31
+ docs = [
32
+ "mkdocs>=1.6",
33
+ "mkdocs-material>=9.5",
34
+ "mkdocs-mermaid2-plugin>=1.1",
35
+ ]
36
+
37
+ [project.scripts]
38
+ depsight = "depsight.cli:main"
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/depsight/depsight-dependency-manager"
42
+ Repository = "https://github.com/depsight/depsight-dependency-manager"
43
+ Issues = "https://github.com/depsight/depsight-dependency-manager/issues"
44
+
45
+ # Plugin support
46
+ [project.entry-points."depsight.plugins"]
47
+ uv = "depsight.core.plugins.uv.uv:UVPlugin"
48
+ vsce = "depsight.core.plugins.vsce.vsce:VSCEPlugin"
49
+
50
+ [build-system]
51
+ requires = ["setuptools>=61.0"]
52
+ build-backend = "setuptools.build_meta"
53
+
54
+ [tool.pytest.ini_options]
55
+ testpaths = ["tests"]
56
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("depsight")
@@ -0,0 +1,99 @@
1
+ import sys
2
+
3
+ # third-party imports
4
+ import rich_click as click
5
+
6
+ from depsight import __version__
7
+ from depsight.core.dispatcher import dispatch_command
8
+ from depsight.utils.constants import APP_BANNER, COLOR_DIM_ORANGE, COLOR_PEACH, SUPPORTED_PLUGINS
9
+
10
+ # rich-click styling
11
+ click.rich_click.USE_RICH_MARKUP = True
12
+ click.rich_click.GROUP_ARGUMENTS_OPTIONS = True
13
+ click.rich_click.STYLE_COMMANDS_TABLE_COLUMN_WIDTH_RATIO = (1, 2)
14
+ click.rich_click.HEADER_TEXT = APP_BANNER
15
+ click.rich_click.STYLE_COMMAND = COLOR_DIM_ORANGE
16
+ click.rich_click.STYLE_OPTION = COLOR_DIM_ORANGE
17
+ click.rich_click.STYLE_SWITCH = COLOR_PEACH
18
+ click.rich_click.STYLE_USAGE = f"bold {COLOR_PEACH}"
19
+ click.rich_click.STYLE_USAGE_COMMAND = f"bold {COLOR_DIM_ORANGE}"
20
+ click.rich_click.STYLE_USAGE_SEPARATOR = COLOR_DIM_ORANGE
21
+ click.rich_click.STYLE_METAVAR = COLOR_PEACH
22
+ click.rich_click.STYLE_METAVAR_APPEND = COLOR_PEACH
23
+ click.rich_click.STYLE_ARGUMENT = COLOR_PEACH
24
+ click.rich_click.COMMAND_GROUPS = {
25
+ "depsight": [{"name": "Package Managers", "commands": list(SUPPORTED_PLUGINS.keys())}]
26
+ }
27
+
28
+
29
+ @click.group()
30
+ @click.version_option(__version__, "--version", "-V", prog_name="depsight")
31
+ def main():
32
+ """A modern TUI framework for scanning local project dependencies."""
33
+ pass
34
+
35
+
36
+ def _register_plugin(plugin_name: str):
37
+ """Register a plugin as a Click subgroup with its commands.
38
+
39
+ Creates a new :func:`click.Group` attached to :func:`main` and registers
40
+ all available sub-commands (e.g. `scan`) under it. This function is
41
+ called at **module import time** for every key in
42
+ :data:`~depsight.core.registry.SUPPORTED_PLUGINS` so that the commands are
43
+ available before Click parses the CLI arguments.
44
+
45
+ Parameters
46
+ ----------
47
+ plugin_name : str
48
+ Key in `SUPPORTED_PLUGINS` identifying the plugin (e.g. `"uv"`).
49
+ """
50
+
51
+ @main.group(plugin_name, help=f"Commands for the '{plugin_name}' package manager.")
52
+ @click.pass_context
53
+ def plugin_group(ctx):
54
+ """Entry point for a plugin subgroup that stores the plugin name in the context."""
55
+ ctx.ensure_object(dict)
56
+ ctx.obj["plugin_name"] = plugin_name
57
+
58
+
59
+ #
60
+ # SCAN COMMAND
61
+ # # # # # # # #
62
+ @plugin_group.command("scan")
63
+ @click.option(
64
+ "--project-dir",
65
+ type=click.Path(exists=True),
66
+ required=True,
67
+ help="Path to the project."
68
+ )
69
+ @click.option(
70
+ "--verbose",
71
+ is_flag=True,
72
+ help="Enable verbose logging."
73
+ )
74
+ @click.option(
75
+ "--as-csv",
76
+ is_flag=True,
77
+ help="Export scan results to a CSV file."
78
+ )
79
+ @click.pass_context
80
+ def scan(ctx, project_dir, verbose, as_csv):
81
+ """Scan project dependencies using the selected plugin."""
82
+ options = {
83
+ "plugin_name": ctx.obj["plugin_name"],
84
+ "project_dir": project_dir,
85
+ "verbose": verbose,
86
+ "as_csv": as_csv,
87
+ }
88
+ sys.exit(dispatch_command("scan", options))
89
+
90
+
91
+ #
92
+ # PLUGIN REGISTRATION
93
+ # # # # # # # # #
94
+ for _name in SUPPORTED_PLUGINS:
95
+ _register_plugin(_name)
96
+
97
+
98
+ if __name__ == "__main__":
99
+ main()
File without changes