feat(manager/pep621): extract locked versions from pdm.lock #27694
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.
Changes
Adds parsing capabilities for
pdm.lock
files. This enables the extraction of locked versions frompdm.lock
analogous to what others managers do (e.g., poetry inschema.ts
andextract.ts
).For separation of concerns, I added a new
extractLockedVersions()
method sinceprocess()
is still extracting dev dependencies and wouldn't even proceed if notool.pdm
section exists inpyproject.toml
. However, this section is optional, so to identify pdm, a check forbuild-system
was added inextractLockedVersions()
.Context
I'm testing the different managers with osv.dev and noticed that no vulnerability alerts are created for pep621 / pdm if dependencies are not declared with exact versions. This is fixed by this PR with the extraction of locked versions (see test repo below).
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
Test repo: renovate-demo/renovate-osv-pypi#5