Repository navigation
fix(pipenv): omit PURL for local VCS dependencies - #1160
Open
ZerirlKeou wants to merge 1 commit into
Open
ZerirlKeou wants to merge 1 commit into
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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