pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

Default to the `~=` opperator when adding entries to pipfile

Open Kroppeb opened this issue 1 year ago • 4 comments

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.

Kroppeb avatar Apr 08 '24 21:04 Kroppeb