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

Default to the ~= opperator when adding entries to pipfile #6123

Open
Kroppeb opened this issue Apr 8, 2024 · 4 comments
Open

Default to the ~= opperator when adding entries to pipfile #6123

Kroppeb opened this issue Apr 8, 2024 · 4 comments

Comments

@Kroppeb
Copy link

Kroppeb commented Apr 8, 2024

This might be quite opinionated, but tools like npm have similar behavior.
Npm will check the latest version available (eg x.y.z) and will specify the version as ^x.y.z.

One important difference though is that ^x.y.z, is equivalent (in python) to == x.*, >= x.y.z (for non-zero x),
while ~= x.y.z is equivalent to == x.y.*, >= x.y.z.

So either we

  1. Add our own non-official ^= operator that gets automatically translated (not a big fan),
  2. Use == x.*, >= x.y.z (assuming x is non-zero)
  3. Use ~= x.y (assuming x is non-zero)
  4. Use ~= x.y.z (assuming x is non-zero) not ideal because it doesn't allow minor increases

Additionally, it would be preferable if pipenv update would then also increase these specifiers.

@matteius
Copy link
Member

matteius commented Apr 9, 2024

I wouldn't want this to be the global default, but would support a Pipfile setting that triggered this behavior. I think there is some overlap with this and the issue report behind #5963

@Kroppeb
Copy link
Author

Kroppeb commented Apr 9, 2024

Ah oops, seems I've missed issue #5531. My bad.

@Kroppeb
Copy link
Author

Kroppeb commented Apr 9, 2024

When you say a "pipfile setting" do you mean a command flag/environment flag, or do you mean a value in the pipfile?

@Kroppeb
Copy link
Author

Kroppeb commented Apr 9, 2024

The reason I suggested to change the default btw, was to avoid issues like #6104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants