poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Plans to implement of semver versioning style parser

Open arshvin opened this issue 2 years ago • 2 comments

Issue Kind

Brand new capability

Description

Hi all! I've risen today the question inside of poetry-dynamic-versioning repository, about of semver versioning style full support by the plugin. But implementing of this capability is not only on their side. I have the use case, which I've put there and let me copy-paste it here as well:

Let's imagine I need to put version of my product to 0.0.1-development, if the the poetry project is build from development branch, and 0.0.1-feature-whatever, if it's build from feature/whatever branch, etc. Versions like 0.0.1-development, 0.0.1-feature-whatever, 0.0.1 are compliant to semver spec. I even check it with help of online checkers. I've tried to use the feature of version providing with help of file ([tool.poetry-dynamic-versioning.from-file] section), but poetry-dynamic-versioning plugin, even with setting style = "semver" falls in following line, because of it's using only pep440 version parser.

It's not only about of version input approach. The same is if I use git tags. The plugin uses following line of code for parsing input version:

    poetry._package._version = PoetryCoreVersion.parse(version)

Finally, this method is executed. Package versions are:

poetry==1.8.3 poetry-core==1.9.0 poetry-dynamic-versioning==1.4.0

I could not find in your code base of semver parser, only pep440. Is there any chance that poetry library will have capability to accept and allow to use of semver versioning style?

Impact

I've partially described my use case above, of what I'd want to have from the library, but there are some additional details. There are some developer teams, each of which work inside their own short term git branch. Each commit might trigger corresponding job, which is going to create of required artifact: either it might be python lib, built by poetry lib, or some archives of yaml, sql, etc. files. These artifacts are published to ADO universal package feed, and then particular versions of these artifact are used by another pipeline which should be triggered manually. Therefore, either these artifacts versions should be specified manually, or they could be selected by some postix like sanitised branch name, for simplicity. But this way is not relevant for built python package by poetry.

it might lead to incompatibility for pip or other installing tools under the hood. Or package storage services.

Workarounds

none

arshvin avatar Sep 11 '24 01:09 arshvin

We don't plan on supporting versioning other than PEP 440-compliant since it would be against the direction of spec compliance with other Python packaging tools.

Secrus avatar Sep 12 '24 10:09 Secrus

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 Oct 13 '24 00:10 github-actions[bot]