-
-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent behaviour of pdm add
in mode direct_minimal_versions
#2853
Comments
I think, on the contrary, the lowest version should be locked.
It means to "overwrite" what is stored in the
|
Fixes #2853 Signed-off-by: Frost Ming <me@frostming.com>
Hi @frostming , Thanks for having speedily fixed this and taken the time to answer my comments! Regarding your "lowest version" policy for |
You should probably use two lock files, one with latest versions (the default one), one with lowest versions (only used in CI, or maybe also when running tests locally). |
Yes, basically you add dependencies to the default lock file which prefers latest and run |
Hi @pawamoy @frostming , thank you both for your feedback. I didn't think of using two lock files. I have to give it some thoughts. Have a nice day! |
Steps to reproduce
pdm lock --strategy direct_minimal_versions
to activate the locking strategypdm add django
. This will modify the pyproject file to install the latest compatible django package (->django>=4.2.11
for python 3.9)pdm add django
. The pyproject file will now be modified to install the earliest compatible django package (->django>=1.1.3
)Expected behavior
pdm add
a second time should have no effectEnvironment Information
Discussion
pdm add
should look for the latest or earliest compatible version on its first call. IMHO, the latest version should be sought, even in direct_minimal_versions strategy, since that strategy specifies how the lock file consistency with the pyproject file is enforced, not how the pyproject file is specifiedpdm add
should do with respect to what is already specified in the pyproject file. The documentation doesn't say much about the policies followed by PDM ifpdm add
is called for an already-specified dependencypdm install
?Thanks for the awesome work done on PDM!
The text was updated successfully, but these errors were encountered: