poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Dependency specification: inaccurate description of caret requirement

Open TanguyP opened this issue 1 year ago • 3 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

Issue

On the Dependency specification page, the Caret requirements section reads:

An update is allowed if the new version number does not modify the left-most non-zero digit in the major, minor, patch grouping.

But this seems partly inaccurate, as it means that specifying ^0.2.3 as a requirement allows version 2.2.3 which has the same left-most non-zero digit i.e. 2 - but that's clearly not the case, as illustrated in the examples table further down, which mentions that a requirement of ^0.2.3 will allow versions >=0.2.3 <0.3.0.

Or maybe the person who wrote the above sentence meant that the digit and position of the left-most non-zero digit shouldn't change? In that case, I would argue that the phrasing can be improved.

TanguyP avatar Feb 19 '24 16:02 TanguyP

The misunderstanding that you propose feels unlikely!

but if you have ideas to improve the docs then - by a very large margin - the best way to do that is to submit a merge request with the change you would like to see.

dimbleby avatar Feb 19 '24 16:02 dimbleby

I think the term we need here is "significant figures" https://en.wikipedia.org/wiki/Significant_figures "0" means different things for the logic if it's in "012.34" or "0.1234", but the referenced part of the doc mentions it like there is only one case.

ulgens avatar Feb 20 '24 02:02 ulgens

I think the term we need here is "significant figures" https://en.wikipedia.org/wiki/Significant_figures "0" means different things for the logic if it's in "012.34" or "0.1234", but the referenced part of the doc mentions it like there is only one case.

Thanks! But I believe this comment belongs more in the PR, would you mind copying/moving it there (if you have sufficient permissions)? Then we can have a more extended discussion with a clearer format :)

TanguyP avatar Feb 20 '24 07:02 TanguyP

I think this is overkill and suggestion in #8992 does not really make much of a dent in improving the status quo imho. I appreciate that the current version can be confusing, but I do think it gets the point across just fine.

And further, I think any concerns raised about the "confusion" is mitigated by the additional examples provided in the same line.

If instead we had specified the version string as ^0.1.13, poetry would update to 0.1.14 but not 0.2.0. 0.0.x is not considered compatible with any other version.

abn avatar Mar 01 '24 23:03 abn

@radoering Can you please add a short comment why this got closed? Thanks in advance.

ulgens avatar Mar 02 '24 06:03 ulgens

https://github.com/python-poetry/poetry/issues/8991#issuecomment-1974079665 https://github.com/python-poetry/poetry/pull/8992#issuecomment-1974327864

radoering avatar Mar 02 '24 06:03 radoering

Thanks but "this solution is not good enough" shouldn't be the reason to close an issue. It makes sense for the PR but please keep this open.

ulgens avatar Mar 02 '24 06:03 ulgens

@ulgens the maintainers do not agree there is a need for this - that is enough reason

And honestly this is a nitpick issue and we do not agree there is value in spending cycles debating semantics.

As for why we do not agree there is a need for such a change, please see my comment above where I have clearly said the example after the concerned phrase clarifies that the OPs example is not the case.

abn avatar Mar 02 '24 09:03 abn

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 02 '24 00:04 github-actions[bot]