Skip to content
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

Missing compatible strategy.save in docs #1769

Closed
1 task done
wgordon17 opened this issue Mar 15, 2023 · 2 comments · Fixed by j178/pdm#1
Closed
1 task done

Missing compatible strategy.save in docs #1769

wgordon17 opened this issue Mar 15, 2023 · 2 comments · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@wgordon17
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

This is more of a docs bug than anything at the moment. When trying to understand the "save" strategy, I found on the configuration page


strategy.save Specify how to save versions when a package is added minimum(can be: exact, wildcard, minimum) Yes

2 issues with this

  1. I don't see compatible listed, but it looks like it was added over 2 years ago Change the compatible strategy to use ~= operator #230
  2. I see wildcard listed (also on the CLI page), but I don't see wildcard as any option https://github.com/pdm-project/pdm/blob/main/src/pdm/cli/utils.py#L468, so I'm confused as the behavior of wildcard.

Finally, this one might be a bit controversial, but I was wondering if it's worth opening an Enhancement issue to suggest moving from minimum to compatible as the default save strategy. This could be considered a breaking change, but IMO, it's the correct behavior, to default to compatible package versions instead of just specifying a minimum and letting packages upgrade to breaking semvar versions. I feel like that behavior is surprising, to say the least (I was surprised by it). I don't want to hash out this discussion here, since I want to focus on the docs bug here. Mostly just wondering if it's worth opening the Enhancement or let me idea just die here if there's no interest

@wgordon17 wgordon17 added the 🐛 bug Something isn't working label Mar 15, 2023
@frostming
Copy link
Collaborator

frostming commented Mar 16, 2023

but IMO, it's the correct behavior, to default to compatible package versions instead of just specifying a minimum and letting packages upgrade to breaking semvar versions.

Not really, you may be from the application perspective, but for a library, version specifiers with upper bound may be harmful, and this effect is harder to fix than a minimum strategy used on an application, so we decide to make it the default.

2. but I don't see wildcard as any option https://github.com/pdm-project/pdm/blob/main/src/pdm/cli/utils.py#L468,

wildcard mean to not change the specifiers, a => a, a>=1 -> a>=1

@wgordon17
Copy link
Author

Ahh, ok...that definitely makes sense then. Yeah, coming at this from an application perspective...at least it's configurable 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants