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

Tag and pypi release don't match #8

Open
imphil opened this issue Jan 31, 2024 · 6 comments
Open

Tag and pypi release don't match #8

imphil opened this issue Jan 31, 2024 · 6 comments

Comments

@imphil
Copy link

imphil commented Jan 31, 2024

The latest tag is 2024.01.29, but the PyPi release is named 2024.1.29 (note the missing 0). Looks like something with the release scripts is wrong?

@henryiii
Copy link
Owner

PyPI releases (Python version numbers) do not contain leading 0's. 1.01.01 is 1.1.1. The tag uses leading zeros to sort nicely, but the Python version number doesn't reflect that.

>>> import packaging.version
>>> packaging.version.Version("1.01")
<Version('1.1')>

@imphil
Copy link
Author

imphil commented Jan 31, 2024

I see. Unfortunately, that's causing a bit of confusion, since pre-commit uses the git tag in some places, and in other places the PyPi version:

- repo: https://github.com/abravalheri/validate-pyproject
  rev: v0.16
  hooks:
    - id: validate-pyproject
      additional_dependencies:
        - validate-pyproject[all]
        - validate-pyproject-schema-store==2024.1.29

vs.

- repo: https://github.com/henryiii/validate-pyproject-schema-store
  rev: "2024.01.29"
  hooks:
    - id: validate-pyproject

I haven't done further research on how other date-based projects solve this. Maybe giving up the sortability of the tags? If nothing else, a bit of documentation will help.

@henryiii
Copy link
Owner

henryiii commented Feb 1, 2024

- repo: https://github.com/abravalheri/validate-pyproject
  rev: v0.16
  hooks:
    - id: validate-pyproject
      additional_dependencies:
        - validate-pyproject[all]
        - validate-pyproject-schema-store==2024.01.29

Works, I think. You can always add leading zeros. I’ll check some other CalVer projects to see how they tag.

@henryiii
Copy link
Owner

henryiii commented Feb 1, 2024

Also, we are fully date-based CalVer, unlike say black which is year.month.version. Not sure there are many fully CalVer projects, most are hybrid. But this is an automated (mostly) update of something where really only the date matters. ¯_(ツ)_/¯

@imphil
Copy link
Author

imphil commented Feb 1, 2024

Thanks for looking into that! I guess another option to avoid the whole issue would be a version number like 20240131. But either way, I think I can deal with it without much problem.

I tend to look up the latest version on PyPi, and used the version number showed there in my pre-commit configuration (where it expected a git tag), which didn't work. That's what caused me filing this issue in the first place.

@henryiii
Copy link
Owner

Nox does the same thing FYI - tags include 0's, but some places (like PyPI) normalize them out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants