Skip to content

Commit

Permalink
fix: don't install a local file if it doesn't change (#2966)
Browse files Browse the repository at this point in the history
* fix: don't install a local file if it doesn't change

Signed-off-by: Frost Ming <me@frostming.com>

* add news

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming authored Jun 23, 2024
1 parent 03b3114 commit 8df55c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/2966.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't update local files if they don't change.
4 changes: 2 additions & 2 deletions src/pdm/installers/synchronizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def _should_update(self, dist: Distribution, can: Candidate) -> bool:
if not isinstance(dreq, FileRequirement):
return True
url = dreq.get_full_url()
if url.startswith("file:"):
# We don't know whether local files are changed, always update
if dreq.is_local_dir:
# We don't know whether a local dir has been changed, always update
return True
assert can.link is not None
return url != backend.expand_line(can.link.url_without_fragment)
Expand Down

0 comments on commit 8df55c4

Please sign in to comment.