Skip to content

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

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

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

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:

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.

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 VCS PURLs for affected dependencies in Pipfile.lock

1 participant