Repository navigation
fix(pipenv): omit PURL for local VCS dependencies - #1160
ZerirlKeou wants to merge 1 commit into
Conversation
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>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | ✅ 0 (≤ 20 complexity) |
| Duplication | 0 |
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.
|
putting this on DRAFT mode - lets discusss the expected solution first: |
|
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. |
you are welcome.
we have test beds for some inputs, but we still don't have a test bed for pipenv local VCS, yet.
|
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 atfileandpathentries, 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 alocal-vcsfixture and snapshots for all supported schema/output formats.Resolves or fixes issue: #1152
Testing
python -m unittest tests.integration.test_cli_pipenv— 185 tests passedpython -m unittest discover -t . -s tests/unit— 38 tests passedpython -m flake8 cyclonedx_py/_internal/pipenv.py— cleanAI Tool Disclosure
Affirmation