WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 0c86ee5

Browse files
committed
fix: pylock.toml + git dependency => lock failure.
Fixes #3694 Signed-off-by: Frost Ming <[email protected]>
1 parent 133a514 commit 0c86ee5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

news/3694.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore `packages.vcs.requested-revision` if it's None when formatting pylock.toml.

src/pdm/formats/pylock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ def make_package(self, package: Package) -> dict[str, Any]:
4242
result["vcs"] = {
4343
"type": req.vcs,
4444
"url": req.repo,
45-
"requested-revision": req.ref,
4645
"commit-id": candidate.get_revision(),
4746
}
47+
if req.ref:
48+
result["vcs"]["requested-revision"] = req.ref
4849
if req.subdirectory:
4950
result["vcs"]["subdirectory"] = req.subdirectory
5051
elif isinstance(req, FileRequirement):

0 commit comments

Comments
 (0)