Skip to content

Python lockfiles: drop the uv editable project from the SBOM and pin poetry/uv/Pipfile edge cases #511

Closed

Description

@vibgrate-team

Context

src/engine/lockfile.ts reads Python pins from poetry.lock, uv.lock and Pipfile.lock. The happy paths are tested in test/lib-version.test.ts ("python lockfile resolution"). Two things are not yet covered or are wrong:

1. The project itself shows up in the SBOM when it uses uv.

uv.lock lists the project as its own [[package]] with an editable (or virtual) source:

version = 1
requires-python = ">=3.11"

[[package]]
name = "app"
version = "0.1.0"
source = { editable = "." }

[[package]]
name = "click"
version = "8.1.7"
source = { registry = "https://pypi.org/simple" }

Today vg scan followed by vg sbom export on that tree emits pkg:pypi/app@0.1.0 as a component next to pkg:pypi/click@8.1.7. app is not on PyPI. Expected: only click.

2. Edge cases with no test. Each of these already behaves correctly but nothing pins it:

  • pypiLockVersion precedence: poetry.lock, then uv.lock, then Pipfile.lock
  • PEP 503 names: Flask_Cors in the lockfile matches flask-cors and Flask.Cors
  • Pipfile develop entries resolve ("==8.0.0" becomes 8.0.0)
  • Pipfile path and git entries ({"path": "."}, {"git": "…"}) have no version, so they return undefined rather than a guess

What to do

  1. In poetryLikeLockTree, skip a [[package]] block whose source is { editable = … } or { virtual = … }.
  2. Add a describe('Python lockfiles') block to src/engine/lockfile.test.ts covering the fix and the four edge cases above. Use the write() helper. No network.

Acceptance

  • fullDependencyGraph(root)?.components for the uv fixture above is exactly [{ package: 'click', version: '8.1.7' }]
  • A test fails if precedence or PEP 503 matching changes
  • Pipfile path and git entries return undefined
  • pnpm test is green, and commits are signed off (git commit -s)

Out of scope

Pipfile.lock is not read by fullDependencyGraph today, so Pipenv projects get direct dependencies only in the SBOM. That is a bigger change. Open a separate issue if you want to take it on.

Pointers

Replaces #252, #272 and #284.

Activity

  1. added
    bug
    good first issue
    on Oct 29, 2026
  2. vibgrate-team commented on Oct 29, 2026

    @vibgrate-team
    ContributorAuthor

    This one is still open to claim. A few pointers if you take it: in poetryLikeLockTree, the source line in uv.lock is an inline table, so match source = { editable and source = { virtual rather than parsing full TOML. poetry.lock uses the same function and has no editable/virtual sources for registry packages, so check its existing fixtures still pass. For the PEP 503 test, normalise by lower-casing and collapsing runs of -, _ and . to -, which is what pypiLockVersion should already do. Leave a comment here to claim it so nobody duplicates the work.

  3. glaucusec commented on Oct 30, 2026

    @glaucusec
    Contributor

    I'm working on it.

  4. added a commit that references this issue on Oct 31, 2026
    8627b8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions