Change the way of picking what packages to be installed #466
frostming
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In case you are not familiar with how PDM decides what packages are to be installed. Here is a simple explanation.
After package versions are solved, PDM extracts environment markers of each candidate and its parents and combines them to be a single PEP 508 marker and stores it with the package into the lock file. And the installer only needs to look for each package in the package and decide whether it should be installed evaluating the environment marker on the current system. This method makes the installer simple and stupid and it has been working pretty well.
Until some problems arise, I realize merging markers1 is not sustainable. So I started to refactor that part in #456. In the PR, I switched to a resolve-at-install method which is also being used by Poetry. It turned out to be much easier to implement, I only changed a few lines and removed a lot of codes. But as a consequence, the lock file should be upgraded to the new format. For this purpose, I implemented a simple version check logic to invalidate incompatible lock files.
1 I said "merging" but no calculation is performed, we simply "concatenate" the markers with "and" or "or", this makes the marker super long when there are a lot of markers in the dependency tree.
The new resolve-at-install method:
Beta Was this translation helpful? Give feedback.
All reactions