-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(python): add support for uv #8080
Conversation
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
49610b8
to
4db5a1b
Compare
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
205d504
to
ea1ac4a
Compare
@knqyf263 @DmitriyLewen Many package managers are now moving towards PEP-735 support, which introduces the concept of dependency groups, and uv is no exception. I have now implemented skipping all groups except from the dependencies field, as groups can include dependencies for testing, linting or building documentation. Here's what it might look like: [dependency-groups]
test = ["pytest", "coverage"]
docs = ["sphinx", "sphinx-rtd-theme"]
typing = ["mypy", "types-requests"] The uv documentation mentions dev dependencies separately from dependency groups, but dev dependencies just belong to a
Is it worth skipping the dev group exclusively? BTW, I did some tests with poetry (1.8.5). I added a dev dependency [tool.poetry.group.dev.dependencies]
pytest = "^8.3.4" But Trivy didn't skip it because now the package in the lockfile doesn't contain the ❯ trivy fs . -f json --list-all-pkgs | grep pytest
2024-12-12-12T17:03:28+06:00 INFO [vuln] Vulnerability scanning is enabled
2024-12-12-12T17:03:28+06:00 INFO [secret] Secret scanning is enabled
2024-12-12-12T17:03:28+06:00 INFO [secret] INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2024-12-12-12T17:03:28+06:00 INFO [secret] Please see also https://aquasecurity.github.io/trivy/v0.58/docs/scanner/secret#recommendation for faster secret detection
2024-12-12-12T17:03:03:28+06:00 INFO Number of language-specific files num=1
2024-12-12-12T17:03:28+06:00 INFO [poetry] Detecting vulnerabilities...
“ID": ‘pytest@8.3.4’,
“Name": ‘pytest’,
“PURL": ‘pkg:pypi/pytest@8.3.4’,
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth skipping the dev group exclusively?
I think we also need to skip dev
group.
But Trivy didn't skip it because now the package in the lockfile doesn't contain the category field as before
Create new issue for this case. please
@nikpivkin i left comments, take a look, please
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Created #8096 |
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
left small comments
Does the |
Here's an example:
|
IIUC your logic skips these (doc, test, development etc) dependencies . |
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
b4f3191
to
fed629a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cc. @knqyf263
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left small comments.
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
Is this about |
@knqyf263 This is about [package.dev-dependencies]
docs = [
{ name = "mkdocs" },
]
test = [
{ name = "pytest" },
] For |
Isn't Does it mean |
That's right, it's the same dependency groups |
Thanks for clarifying. Is it possible to identify the dependency graph for development dependencies? We can do that in another PR, though. |
Yes, I've already started working on this so we can implement support in this PR. |
It's better to keep the PR small. Please let me merge this one. |
@knqyf263 OK |
Description
This PR adds support for retrieving the dependency list from
uv.lock
of the uv package manager.Example:
Related issues
Checklist