Skip to content

feat(pipenv): omit PURL for local VCS dependencies - #1159

Draft
pinsara23 wants to merge 2 commits into
CycloneDX:mainfrom
pinsara23:feat/pipenv-local-vcs
Draft

pinsara23 wants to merge 2 commits into
CycloneDX:mainfrom
pinsara23:feat/pipenv-local-vcs

Conversation

@pinsara23

Copy link
Copy Markdown

Local VCS dependencies in Pipfile.lock (e.g. "git": "git+file:///…") got a pkg:pypi/ PURL, unlike local file/path dependencies, which correctly get none.

PipenvBB.__is_local() returned False before checking VCS keys. It now falls through to the VCS URL (via __package_vcs()) when there's no file/path key, so the existing file/+file scheme check applies. Remote VCS dependencies (e.g. git+https://…) keep their PURL.

Adds a pipenv/local-vcs test fixture covering both cases: a local git+file dependency (no PURL) and a remote git+https dependency (PURL kept). No existing snapshots changed.

Closes #1152

Signed-off-by: Pinsara Sarathchandra <113714@foe.sjp.ac.lk>
@pinsara23
pinsara23 requested a review from a team as a code owner November 26, 2026 19:10
@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.

Signed-off-by: Pinsara Sarathchandra <113714@foe.sjp.ac.lk>
@jkowalleck

Copy link
Copy Markdown
Member

@pinsara23 thanks for working on this topic.

Could move those newly added test beds into a new pull request, that introduces them and builds test snapshots with the current behavior?
After the new PR that introduces these test beds was merged, this PR will show the behavioral changes manifest in changes in the snapshots.

This would make a review much easier and would show the effect of the changes clearer.

@jkowalleck

Copy link
Copy Markdown
Member

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

@pinsara23

Copy link
Copy Markdown
Author

Thanks for the suggestion! I've opened #1163 with the testbed and current-behavior snapshots. Once that's merged, I'll rebase this PR so the snapshot diffs show the change.

@jkowalleck

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
Author

@jkowalleck I agree with the proposed solution: keep the PURL for local VCS dependencies but don't add the vcs_url qualifier; remote VCS dependencies keep vcs_url as today.

I've prototyped this: factor the scheme check out of __is_local() into a __is_local_location() helper, and in __purl_qualifiers4lock() skip vcs_url when the VCS location is local. Results on a test lockfile:

  • git+file:///… → pkg:pypi/a
  • file:///… → pkg:pypi/b
  • git+https://github.com/… → pkg:pypi/six?vcs_url=… (unchanged)
  • local file/path deps → no PURL (unchanged)

@ZerirlKeou happy to collaborate. The testbed in #1163 (current-behavior snapshots) covers git+file, plain file, and remote git+https. Once it's merged, I can update #1159 with the above and add you as co-author, or if you'd prefer to take it in #1160, I'm fine with that too. What works for you?

@pinsara23
pinsara23 marked this pull request as ready for review November 30, 2026 11:46
@pinsara23
pinsara23 marked this pull request as draft November 30, 2026 11:48
@pinsara23

Copy link
Copy Markdown
Author

Sorry, I marked this ready by mistake. Back to draft until the approach in #1152 and the testbeds in #1163 are settled.

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