pdm: Adds basic lock file invalidation #1035
Draft
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.
Basic idea for lock invalidation in pdm.
This would fix #999 but isn't exactly complete.
All this does is pull the hash from the lock file, and manually calculate the hash in the same way that pdm does. This isn't a great solution because any time pdm changes the way the lock file hash is calculated.
The alternatives are:
runCommand
on a script that makes pdm evaluate whether the lock file is valid or not. This seems a bit clunky to me.dream.lock
file, that would contain data for all hashes for all lock files for any given project; i.e., instead of the way that the pip and npm work, where they generate a full lock file on their own, we can generate the lock files for any given tool and store the invalidation hash instead.I'd like to suggest the second solution since it could allow for easier usage of many package managers for a variety of language, but it's also a little involved.
@DavHau @phaer