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

Incorrect normalization of PEP 440 development and post release version name #4843

Closed
3 tasks done
k-sriram opened this issue Nov 28, 2021 · 3 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@k-sriram
Copy link

k-sriram commented Nov 28, 2021

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 20.04 on WSL2 on Windows 10
  • Poetry version: poetry 1.2.0a2 on python 3.10
  • Link of a Gist with the contents of your pyproject.toml file: bug recreatable on an empty project.

Issue

I don't know if this is a bug in poetry-core but I am posting it here.

Poetry incorrectly normalizes the PEP440 version names of development releases and post releases. The following table shows the normal forms in the PEP and the forms which poetry uses.

Release Type Normalized version Poetry version
Post release 1.2.3.post4 1.2.3-4
Development release 5.6.7.dev8 5.6.7dev8

The version names that poetry uses are however acceptable alternative forms. (Hence this bug could be low priority)

Unless there is a very good reason to do so I don't see why poetry should normalize the version names to an alternative form rather than the standard form, if it is going to normalize the version names in the first place.

To recreate the issue, create a repository and change the version in pyproject.py to one of the forms for a post-release or a development release. like (1.2.3.post4 or 5.6.7.dev8). Now there are two places where the normalized version numbers show up.

  • First, in the built wheel and sdist. To check this run poetry build and look at the filenames generated. It would have generated things of the form 1.2.3-4 and 5.6.7dev8 instead of 1.2.3.post4 and 5.6.7.dev8.
  • Second is in the package metadata. For this run poetry install. Then check importlib.metadata.version("PACKAGE_NAME") in an interactive python shell.
@k-sriram k-sriram added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 28, 2021
@finswimmer
Copy link
Member

Hello @k-sriram,

I'm not able to reproduce this anymore. So I guess this solved in the meantime.

fin swimmer

@radoering
Copy link
Member

Resolved by python-poetry/poetry-core#344

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants