Skip to content

Commit 5a34f28

Browse files
committed
feat: Add Uv Python package manager
Signed-off-by: Helio Chissini de Castro <[email protected]>
1 parent fd5fb3a commit 5a34f28

File tree

16 files changed

+810
-92
lines changed

16 files changed

+810
-92
lines changed

analyzer/src/funTest/kotlin/PackageManagerFunTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class PackageManagerFunTest : WordSpec({
6969
"spdx-project/project.spdx.yml",
7070
"spm-app/Package.resolved",
7171
"spm-lib/Package.swift",
72-
"stack/stack.yaml"
72+
"stack/stack.yaml",
73+
"uv/uv.lock"
7374
)
7475

7576
val projectDir = tempdir()

helper-cli/src/main/kotlin/commands/repoconfig/GenerateScopeExcludesCommand.kt

+7
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ private fun getScopeExcludesForPackageManager(packageManagerName: String): List<
291291
comment = "Packages for testing only."
292292
)
293293
)
294+
"Uv" -> listOf(
295+
ScopeExclude(
296+
pattern = "dev",
297+
reason = ScopeExcludeReason.DEV_DEPENDENCY_OF,
298+
comment = "Packages for development only."
299+
)
300+
)
294301
"SBT" -> listOf(
295302
ScopeExclude(
296303
pattern = "provided",

integrations/schemas/package-managers-schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"Stack",
2929
"SwiftPM",
3030
"Unmanaged",
31+
"Uv",
3132
"Yarn",
3233
"Yarn2"
3334
]

model/src/main/kotlin/config/AnalyzerConfiguration.kt

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ data class AnalyzerConfiguration(
6363
"SwiftPM",
6464
"Tycho",
6565
"Unmanaged",
66+
"Uv",
6667
"Yarn",
6768
"Yarn2"
6869
),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
---
2+
project:
3+
id: "Uv::src/funTest/assets/projects/synthetic/uv/uv.lock:<REPLACE_REVISION>"
4+
definition_file_path: "plugins/package-managers/python/src/funTest/assets/projects/synthetic/uv/uv.lock"
5+
declared_licenses: []
6+
declared_licenses_processed: {}
7+
vcs:
8+
type: ""
9+
url: ""
10+
revision: ""
11+
path: ""
12+
vcs_processed:
13+
type: "Git"
14+
url: "<REPLACE_URL_PROCESSED>"
15+
revision: "<REPLACE_REVISION>"
16+
path: "<REPLACE_PATH>"
17+
homepage_url: ""
18+
scopes:
19+
- name: "main"
20+
dependencies:
21+
- id: "PyPI::graphviz:0.20.3"
22+
- id: "PyPI::jinja2:3.1.6"
23+
dependencies:
24+
- id: "PyPI::markupsafe:3.0.2"
25+
- id: "PyPI::pytest:8.3.5"
26+
dependencies:
27+
- id: "PyPI::iniconfig:2.0.0"
28+
- id: "PyPI::packaging:24.2"
29+
- id: "PyPI::pluggy:1.5.0"
30+
- id: "PyPI::ruff:0.9.10"
31+
packages:
32+
- id: "PyPI::graphviz:0.20.3"
33+
purl: "pkg:pypi/[email protected]"
34+
authors:
35+
- "Sebastian Bank <[email protected]>"
36+
declared_licenses:
37+
- "MIT"
38+
- "MIT License"
39+
declared_licenses_processed:
40+
spdx_expression: "MIT"
41+
mapped:
42+
MIT License: "MIT"
43+
description: "Simple Python interface for Graphviz"
44+
homepage_url: "https://github.com/xflr6/graphviz"
45+
binary_artifact:
46+
url: "https://files.pythonhosted.org/packages/00/be/d59db2d1d52697c6adc9eacaf50e8965b6345cc143f671e1ed068818d5cf/graphviz-0.20.3-py3-none-any.whl"
47+
hash:
48+
value: "81f848f2904515d8cd359cc611faba817598d2feaac4027b266aa3eda7b3dde5"
49+
algorithm: "SHA-256"
50+
source_artifact:
51+
url: "https://files.pythonhosted.org/packages/fa/83/5a40d19b8347f017e417710907f824915fba411a9befd092e52746b63e9f/graphviz-0.20.3.zip"
52+
hash:
53+
value: "09d6bc81e6a9fa392e7ba52135a9d49f1ed62526f96499325930e87ca1b5925d"
54+
algorithm: "SHA-256"
55+
vcs:
56+
type: ""
57+
url: ""
58+
revision: ""
59+
path: ""
60+
vcs_processed:
61+
type: "Git"
62+
url: "https://github.com/xflr6/graphviz.git"
63+
revision: ""
64+
path: ""
65+
- id: "PyPI::iniconfig:2.0.0"
66+
purl: "pkg:pypi/[email protected]"
67+
authors:
68+
- "Ronny Pfannschmidt <[email protected]>, Holger Krekel <[email protected]>"
69+
declared_licenses:
70+
- "MIT License"
71+
declared_licenses_processed:
72+
spdx_expression: "MIT"
73+
mapped:
74+
MIT License: "MIT"
75+
description: "brain-dead simple config-ini parsing"
76+
homepage_url: ""
77+
binary_artifact:
78+
url: "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl"
79+
hash:
80+
value: "b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"
81+
algorithm: "SHA-256"
82+
source_artifact:
83+
url: "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz"
84+
hash:
85+
value: "2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"
86+
algorithm: "SHA-256"
87+
vcs:
88+
type: ""
89+
url: ""
90+
revision: ""
91+
path: ""
92+
vcs_processed:
93+
type: ""
94+
url: ""
95+
revision: ""
96+
path: ""
97+
- id: "PyPI::jinja2:3.1.6"
98+
purl: "pkg:pypi/[email protected]"
99+
declared_licenses:
100+
- "BSD License"
101+
declared_licenses_processed:
102+
unmapped:
103+
- "BSD License"
104+
description: "A very fast and expressive template engine."
105+
homepage_url: ""
106+
binary_artifact:
107+
url: "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl"
108+
hash:
109+
value: "85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"
110+
algorithm: "SHA-256"
111+
source_artifact:
112+
url: "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz"
113+
hash:
114+
value: "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"
115+
algorithm: "SHA-256"
116+
vcs:
117+
type: ""
118+
url: ""
119+
revision: ""
120+
path: ""
121+
vcs_processed:
122+
type: "Git"
123+
url: "https://github.com/pallets/jinja.git"
124+
revision: ""
125+
path: ""
126+
- id: "PyPI::markupsafe:3.0.2"
127+
purl: "pkg:pypi/[email protected]"
128+
declared_licenses:
129+
- "BSD License"
130+
declared_licenses_processed:
131+
unmapped:
132+
- "BSD License"
133+
description: "Safely add untrusted strings to HTML/XML markup."
134+
homepage_url: ""
135+
binary_artifact:
136+
url: "https://files.pythonhosted.org/packages/f1/a4/aefb044a2cd8d7334c8a47d3fb2c9f328ac48cb349468cc31c20b539305f/MarkupSafe-3.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
137+
hash:
138+
value: "a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84"
139+
algorithm: "SHA-256"
140+
source_artifact:
141+
url: "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz"
142+
hash:
143+
value: "ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"
144+
algorithm: "SHA-256"
145+
vcs:
146+
type: ""
147+
url: ""
148+
revision: ""
149+
path: ""
150+
vcs_processed:
151+
type: "Git"
152+
url: "https://github.com/pallets/markupsafe.git"
153+
revision: ""
154+
path: ""
155+
- id: "PyPI::packaging:24.2"
156+
purl: "pkg:pypi/[email protected]"
157+
authors:
158+
- "Donald Stufft <[email protected]>"
159+
declared_licenses:
160+
- "Apache Software License"
161+
- "BSD License"
162+
declared_licenses_processed:
163+
spdx_expression: "Apache-2.0"
164+
mapped:
165+
Apache Software License: "Apache-2.0"
166+
unmapped:
167+
- "BSD License"
168+
description: "Core utilities for Python packages"
169+
homepage_url: ""
170+
binary_artifact:
171+
url: "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl"
172+
hash:
173+
value: "09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"
174+
algorithm: "SHA-256"
175+
source_artifact:
176+
url: "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz"
177+
hash:
178+
value: "c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"
179+
algorithm: "SHA-256"
180+
vcs:
181+
type: ""
182+
url: ""
183+
revision: ""
184+
path: ""
185+
vcs_processed:
186+
type: "Git"
187+
url: "https://github.com/pypa/packaging.git"
188+
revision: ""
189+
path: ""
190+
- id: "PyPI::pluggy:1.5.0"
191+
purl: "pkg:pypi/[email protected]"
192+
authors:
193+
- "Holger Krekel <[email protected]>"
194+
declared_licenses:
195+
- "MIT"
196+
- "MIT License"
197+
declared_licenses_processed:
198+
spdx_expression: "MIT"
199+
mapped:
200+
MIT License: "MIT"
201+
description: "plugin and hook calling mechanisms for python"
202+
homepage_url: "https://github.com/pytest-dev/pluggy"
203+
binary_artifact:
204+
url: "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl"
205+
hash:
206+
value: "44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"
207+
algorithm: "SHA-256"
208+
source_artifact:
209+
url: "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz"
210+
hash:
211+
value: "2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"
212+
algorithm: "SHA-256"
213+
vcs:
214+
type: ""
215+
url: ""
216+
revision: ""
217+
path: ""
218+
vcs_processed:
219+
type: "Git"
220+
url: "https://github.com/pytest-dev/pluggy.git"
221+
revision: ""
222+
path: ""
223+
- id: "PyPI::pytest:8.3.5"
224+
purl: "pkg:pypi/[email protected]"
225+
authors:
226+
- "Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna\
227+
\ Laugher, Florian Bruhin, Others (See AUTHORS)"
228+
declared_licenses:
229+
- "MIT"
230+
- "MIT License"
231+
declared_licenses_processed:
232+
spdx_expression: "MIT"
233+
mapped:
234+
MIT License: "MIT"
235+
description: "pytest: simple powerful testing with Python"
236+
homepage_url: ""
237+
binary_artifact:
238+
url: "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl"
239+
hash:
240+
value: "c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"
241+
algorithm: "SHA-256"
242+
source_artifact:
243+
url: "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz"
244+
hash:
245+
value: "f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"
246+
algorithm: "SHA-256"
247+
vcs:
248+
type: ""
249+
url: ""
250+
revision: ""
251+
path: ""
252+
vcs_processed:
253+
type: "Git"
254+
url: "https://github.com/pytest-dev/pytest.git"
255+
revision: ""
256+
path: ""
257+
- id: "PyPI::ruff:0.9.10"
258+
purl: "pkg:pypi/[email protected]"
259+
authors:
260+
- "Charlie Marsh <[email protected]> <\"Astral Software Inc.\" <[email protected]>>"
261+
declared_licenses:
262+
- "MIT"
263+
- "MIT License"
264+
declared_licenses_processed:
265+
spdx_expression: "MIT"
266+
mapped:
267+
MIT License: "MIT"
268+
description: "<!-- Begin section: Overview -->"
269+
homepage_url: "https://docs.astral.sh/ruff"
270+
binary_artifact:
271+
url: "https://files.pythonhosted.org/packages/5e/a6/cc472161cd04d30a09d5c90698696b70c169eeba2c41030344194242db45/ruff-0.9.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
272+
hash:
273+
value: "b60dec7201c0b10d6d11be00e8f2dbb6f40ef1828ee75ed739923799513db24c"
274+
algorithm: "SHA-256"
275+
source_artifact:
276+
url: "https://files.pythonhosted.org/packages/20/8e/fafaa6f15c332e73425d9c44ada85360501045d5ab0b81400076aff27cf6/ruff-0.9.10.tar.gz"
277+
hash:
278+
value: "9bacb735d7bada9cfb0f2c227d3658fc443d90a727b47f206fb33f52f3c0eac7"
279+
algorithm: "SHA-256"
280+
vcs:
281+
type: ""
282+
url: ""
283+
revision: ""
284+
path: ""
285+
vcs_processed:
286+
type: ""
287+
url: ""
288+
revision: ""
289+
path: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[project]
2+
name = "lixo"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"graphviz>=0.20.3",
9+
"jinja2>=3.1.6",
10+
]
11+
12+
[dependency-groups]
13+
dev = [
14+
"pytest>=8.3.5",
15+
"ruff>=0.9.10",
16+
]
17+
18+
[tool.ruff]
19+
fix = true
20+
line-length = 120
21+
22+
[tool.ruff.lint]
23+
extend-select = [
24+
"E", # pycodestyle error
25+
"W", # pycodestyle warning
26+
"F", # pyflakes
27+
"A", # flakes8-builtins
28+
"COM", # flakes8-commas
29+
"C4", # flake8-comprehensions
30+
"Q", # flake8-quotes
31+
"SIM", # flake8-simplify
32+
"PTH", # flake8-use-pathlib
33+
"I", # isort
34+
"N", # pep8 naming
35+
"UP", # pyupgrade
36+
"S", # bandit
37+
]
38+
ignore = [
39+
'N802', # function name should be lowercase
40+
'SIM105', # Suggest contextlib instead of try/except with pass
41+
'COM812', # missing-trailing-comma from flake8-commas
42+
]
43+
# Allow unused variables when underscore-prefixed.
44+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
45+
flake8-tidy-imports.ban-relative-imports = "all"
46+
isort.required-imports = ["from __future__ import annotations"]
47+
# Unlike Flake8, default to a complexity level of 10.
48+
mccabe.max-complexity = 10
49+
per-file-ignores = {}

0 commit comments

Comments
 (0)