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 version number in the latest tag #136

Closed
avalentino opened this issue Aug 8, 2024 · 8 comments
Closed

Incorrect version number in the latest tag #136

avalentino opened this issue Aug 8, 2024 · 8 comments

Comments

@avalentino
Copy link

The version in the pyproject.toml file in the latest tag (v0.0.81) is 0.0.0.dev0.
This seems to be not in line with the source distribution published in pypi.
Is this expected?

@michalc
Copy link
Member

michalc commented Aug 10, 2024

It is expected yes.

The 0.0.0.dev0 is replaced by the release process just before publish to pypi https://github.com/uktrade/stream-zip/blob/main/.github/workflows/deploy-package-to-pypi.yml#L19. Have to admit I've not seen this done elsewhere, but it makes releasing new versions very straightforward: we make a release in GitHub with no code change involved.

Is this causing a problem? (/do you have a better way?)

@avalentino
Copy link
Author

I'm packaging stream-zip for debian and the generated package has the version number that is in the pyproject.toml file, the incorrect one.

The current workaround is to patch the sources I would like to avoid to do it in the long term.

The option of using directly the source tarball in pypy (rather then the one in the github tag) is also problematic for me because the pypi tarball does not include, e.g., the test suite.

@michalc
Copy link
Member

michalc commented Aug 10, 2024

Ah I think understood… Will have a ponder on how best to approach this - I am quite keen to avoid having to manually change the version in code each time though, but also I have liked the ease at which I can just make a GitHub release and PyPI is automatically deployed to

@michalc
Copy link
Member

michalc commented Aug 10, 2024

Actually a question: do you have to take the code from a tag, or could you take from another asset from releases: https://github.com/uktrade/stream-zip/releases

So we can do any faffing with the version in code at our end rather than yours

@avalentino
Copy link
Author

Using releases should be fine

michalc added a commit that referenced this issue Aug 10, 2024
… with correct version

From #136, this apparently makes it
a touch easier to package for Debian
michalc added a commit that referenced this issue Aug 10, 2024
… with correct version

From #136, this makes it a touch
easier/more robust to package for Debian
michalc added a commit that referenced this issue Aug 10, 2024
… with correct version

From #136, this makes it a touch
easier/more robust to package for Debian

Bumping the checkout version just by the by
michalc added a commit that referenced this issue Aug 10, 2024
From #136, this makes it a touch
easier/more robust to package for Debian
michalc added a commit that referenced this issue Aug 10, 2024
The source does not actually include the correct release version to avoid
having to change the source code based on the current or next version. While
this is maybe odd, it makes releasing quite easy. However, as
#136 this makes it slightly harder
to release for Debian.

So we make a version of the source code that has the correct release version,
and add it to the GitHub release. This makes it so any tinkering with versions
is just done in this repository.
@michalc
Copy link
Member

michalc commented Aug 10, 2024

After a few false starts, now have a "Source code (with release version)" asset in new releases which is all of the source code, but with the correct version in pyproject.toml, e.g. at https://github.com/uktrade/stream-zip/releases/tag/v0.0.82

@avalentino
Copy link
Author

Thanks a lot @michalc
I have just tested the packaging of the new release and all works perfectly without patching the version number.
Closing

michalc added a commit that referenced this issue Aug 11, 2024
stream-zip is now in sid/unstable, discussed slightly in
#136
@stuaxo
Copy link

stuaxo commented Aug 12, 2024

In Shoebot when we had a similar thing with versions, I ended up adding a unit test that failed if the versions wheren't synced (not pyproject.toml there, but setup.py as our project is old)

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

3 participants