Doc states that Poetry doesn't enforce
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
Issue
The doc on the pyproject.toml file states that:
[version] should follow semantic versioning. However it will not be enforced and you remain free to follow another specification.
I have a version looking like this: 0.4.4-11-gc91ab07
. I believe it is semver valid, but the poetry build
command returns the following error:
InvalidVersion
Invalid version: '0.4.4.11.gc91ab07'
at /opt/poetry/lib/poetry/_vendor/py3.7/poetry/core/version/version.py:61 in __init__
57│ def __init__(self, version): # type: (str) -> None
58│ # Validate the version and parse it into pieces
59│ match = VERSION_PATTERN.match(version)
60│ if not match:
→ 61│ raise InvalidVersion("Invalid version: '{0}'".format(version))
I’ve found tickets saying that Poetry does enforce PEP 440 style for versions, but it’s not clear if this is still the current state of things. The doc looks wrong anyway!
I would rather have a choice since PEP 440 and Semver are not compatible and pretty much everyone else (Docker, Helm, helm) uses Semver nowadays…
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The pyproject.toml file | Documentation
Versioning Poetry requires PEP 440-compliant versions for all projects. While Poetry does not enforce any release convention, it does encourage the use of ......
Read more >A Poetic Apology. Or Why Should You Use Poetry to ...
In this document, we'll introduce yet another tool, Poetry, and make an argument about why you should probably add it to your own...
Read more >Change python version to 3.x
poetry doesn't change the python version of a venv once it is created, because it uses the python version itself to create the...
Read more >Understanding Poetry (Brooks/Penn Warren): Marvell's ...
The poem, "Tom May's Death," suggests a further complication. ... The speaker one observes, does not identify Cromwell's himself as the "forward" youth,"...
Read more >EDUCATION CODE CHAPTER 28. COURSES OF STUDY
(n) The State Board of Education may by rule develop and implement a plan designed to ... The term does not include cognitive-only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This breaks or complicates using e.g. CalVer, which is for a lot of projects a strictly better option than SemVer. “The python ecosystem forces to use a PEP 440 compliant version.” does not always make sense, not all projects are released to the cheeseshop - for an internal project on a steady cadence, we’d like to use YYYY.MM_nn, e.g. 2022.01_02 for the second release in January, 2022. We don’t want to use 2022.01.02 because that looks like the second of January and probably ise not, and we want the releases to be string-sortable and easy to place on a timeline.
What is the reason Poetry enforces this? Notably, PEP440 specifies what “canonical public version identifiers” must adhere to, but even disregarding that rational people can disagree with PEPs, some project have non-public version identifiers and Poetry will refuse to build them (or change e.g. 1.2v003 to 1.2.post3 when building) - I’d be happy with having to give a flag to say I really want to opt out of PEP440 check or whatever, but I don’t think Poetry should dictate what versions it can build.
Edit: even just pushing the check to the publish step would resolve this specific issue.
@jcmdln, please see https://github.com/pypa/setuptools/issues/3088 for this case.