Skip to content
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: support extracting from uv.lock #314

Merged
merged 10 commits into from
Jan 21, 2025

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Dec 1, 2024

This adds support for parsing uv.lock files which are TOML based and overall seem pretty straightforward - the main gotcha I came across was that they nest their "groups" table (called optional-dependencies) in the package array of tables (I think those are the right TOML terms), meaning it actually ends up getting stuck on the last "package" entry even though it is not package specific.

Beyond that, I think the main two areas that could do with expanding are:

  • support for more exoitc dependencies such as git (I figured this out)
  • support groups - it looks like uv only tracks the direct dependency that has been grouped, but does not mark transitive dependencies; however because it captures both top-level dependencies (in package.metadata) and package dependencies (in [[package]].dependencies) I think in theory we should be able to walk the tree ourselves to determine what dependencies belong in what group
    • I've not done that for now as I'm not 100% sure that'd be correct in every situation, and it feels like it should be fine to tackle in a dedicated PR (I also figure deps.dev can probably help here, which might be a more accurate or preferred alternative)

Resolves google/osv-scanner#1406

@G-Rath G-Rath force-pushed the extractor/support-uv branch from a064497 to 029837e Compare January 20, 2025 18:12
@copybara-service copybara-service bot merged commit 8748276 into google:main Jan 21, 2025
8 checks passed
@G-Rath G-Rath deleted the extractor/support-uv branch January 21, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REQUEST: Support uv.lock lockfile used by uv
3 participants