Skip to content

Commit

Permalink
Lock file hash never matches with --dev
Browse files Browse the repository at this point in the history
Fixes #1916

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed May 12, 2023
1 parent 0234cff commit b8be3c2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
File renamed without changes.
1 change: 1 addition & 0 deletions news/1916.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that dev-dependencies group gets updated with the optional dependencies, causing the hash mismatch.
2 changes: 1 addition & 1 deletion src/pdm/models/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _get_dependency_from_local_package(self, candidate: Candidate) -> CandidateI
raise CandidateInfoNotFound(candidate) from None

reqs = project.pyproject.metadata.get("dependencies", [])
extra_dependencies = project.pyproject.settings.get("dev-dependencies", {})
extra_dependencies = project.pyproject.settings.get("dev-dependencies", {}).copy()
extra_dependencies.update(project.pyproject.metadata.get("optional-dependencies", {}))
if candidate.req.extras is not None:
reqs = sum(
Expand Down

0 comments on commit b8be3c2

Please sign in to comment.