Skip to content

fix(pipenv): omit PURL for local VCS dependencies - #1160

Draft
ZerirlKeou wants to merge 1 commit into
CycloneDX:mainfrom
ZerirlKeou:fix/pipenv-local-vcs-purl
Draft

ZerirlKeou wants to merge 1 commit into
CycloneDX:mainfrom
ZerirlKeou:fix/pipenv-local-vcs-purl

Conversation

@ZerirlKeou

Copy link
Copy Markdown

Description

Pipenv lockfiles can describe a dependency as a VCS URL pointing to a local repository, e.g. git+file:///home/user/projects/my-project. PipenvBB.__is_local() only looked at file and path entries, so these dependencies ended up with a PyPI PURL even though they are not published packages.

This PR checks the VCS URL first, matching the existing git+file:// handling in the schema check. I also added a local-vcs fixture and snapshots for all supported schema/output formats.

Resolves or fixes issue: #1152

Testing

  • python -m unittest tests.integration.test_cli_pipenv — 185 tests passed
  • python -m unittest discover -t . -s tests/unit — 38 tests passed
  • python -m flake8 cyclonedx_py/_internal/pipenv.py — clean

AI Tool Disclosure

Affirmation

Pipenv lockfiles may describe a dependency as a VCS URL that points to a local repository, e.g. `git+file:///home/user/projects/my-project`. `PipenvBB.__is_local()` only inspected `file` and `path` entries, so such dependencies received a PyPI PURL even though they are not published packages. Inspect the VCS URL first, matching the existing handling of `git+file://` in the schema check.

Fixes CycloneDX#1152

Signed-off-by: Liu Ao <zerirl_keou@outlook.com>
@ZerirlKeou
ZerirlKeou requested a review from a team as a code owner November 27, 2026 13:11
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity ✅ 0 (≤ 20 complexity)
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jkowalleck

Copy link
Copy Markdown
Member

#1159 and ##1160
Please collaborate on a common solution.

@jkowalleck

Copy link
Copy Markdown
Member

putting this on DRAFT mode - lets discusss the expected solution first:
#1152 (comment)

@jkowalleck
jkowalleck marked this pull request as draft November 30, 2026 11:30
@ZerirlKeou

Copy link
Copy Markdown
Author

Thanks for the clarification. I understand the agreed direction now: keep the PURL for local VCS dependencies, but do not add the vcs_url qualifier when the VCS location is local (file: / +file:). I will align this PR with that behavior once the testbed data from #1163 lands. If #1159 is the common PR you want to take forward, I am happy to close this one to avoid duplicate work — just say which you prefer.

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.

pipenv subcommand emits insufficient VCS PURLs for affected dependencies in Pipfile.lock

2 participants