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

Use versioneer for tagging (Fix #154) #156

Closed
wants to merge 6 commits into from

Conversation

joshmoore
Copy link
Member

Move to the use of https://github.com/python-versioneer/python-versioneer for defining a version from the current tag. This also removes the need to use bump2version, therefore releases can be handled completely from the GH UI.

cc: @will-moore

joshmoore and others added 4 commits December 7, 2023 11:26
Move to the use of https://github.com/python-versioneer/python-versioneer
for defining a version from the current tag. This also removes the need
to use bump2version, therefore releases can be handled completely from
the GH UI.
@will-moore
Copy link
Member

Versioneer looks nice. So the release steps (currently https://ome-contributing.readthedocs.io/en/latest/python-development.html) are now:

  • git tag v0.5.5
  • add another commit?
  • git tag v0.5.6.dev0
  • git push origin master v5.5.0

@joshmoore
Copy link
Member Author

struggling with pre-commit here. options are:

  • find a way to ignore versioneer.py
  • move from the vendor installation to the runtime dependency on the lib
  • disable pre-commit checks

@jburel
Copy link
Member

jburel commented Dec 7, 2023

Is it a workflow that you see rolling out to other repositories when ready?

@joshmoore
Copy link
Member Author

Not sure. Happy to discuss. The two big benefits are:

  • being able to completely release from the GH UI
  • removing some of the noise in the git history

If you need to have version strings updated anywhere else, though, this won't do it for you.

@joshmoore
Copy link
Member Author

So the release steps ... are now:

More like either:

  • git commit / merge all PRs / etc.
  • git tag
  • git push origin HEAD:main vMyTag
  • Profit

Or:

  • git push / merge all PRs
  • create a release on GitHub and include a new tag

@joshmoore
Copy link
Member Author

Pushed another attempt. Apparently the import versioneer in setup.py leads to mypy checking it no matter what (unless follows are disabled). This just ignores setup.py as a (temporary?) fix. See pre-commit/pre-commit#2936 which convinced me that the excludes should work.

@joshmoore
Copy link
Member Author

We should really settle on one of these two:

image

@joshmoore
Copy link
Member Author

joshmoore commented Dec 8, 2023

Discussing with @will-moore and @jburel, this looks to be working. You can also test locally with:

$ python setup.py version
running version
keywords are unexpanded, not using
got version from VCS {'version': '0.5.4+9.gb243a8d', 'full-revisionid': 'b243a8d3f49b344c209594e2967cf545f10dea77', 'dirty': False, 'error': None, 'date': '2023-12-07T12:01:13+0100'}
Version: 0.5.4+9.gb243a8d
 full-revisionid: b243a8d3f49b344c209594e2967cf545f10dea77
 dirty: False
 date: 2023-12-07T12:01:13+0100

@jburel jburel changed the title Use verioneer for tagging (Fix #154) Use versioneer for tagging (Fix #154) Dec 8, 2023
@jburel
Copy link
Member

jburel commented Dec 8, 2023

One key difference is that we now need to have 2 Python files included in the project tree _version.py and versionner.py. This should be indicated in the README since those files are solely for version and have nothing to do with the plugin itself.

@will-moore will-moore mentioned this pull request Dec 13, 2023
@joshmoore
Copy link
Member Author

At least for versioneer.py, it's possible to choose not to check it in, but that requires installing the versioneer library at runtime.

So what's the next step here?

@will-moore
Copy link
Member

I'm needing to use this PR now to continue to export from IDR, and it's working.
So I'm in favour of getting it merged ASAP and released to fix the current broken release.

I think @jburel was just wanting some mention of the versioneer changes in the README?

@jburel
Copy link
Member

jburel commented Dec 13, 2023

For versionner.py, I think we should keep it out. The other one is a config file similar to the one used by bump2version

@joshmoore
Copy link
Member Author

Following from #157 (comment), @jburel, you're saying that you want me to introduce a dependency on the versioneer library here? You can find out more about the "experimental build-time dependency mode" here: https://github.com/python-versioneer/python-versioneer?tab=readme-ov-file#build-time-dependency-mode

@snoopycrimecop snoopycrimecop mentioned this pull request Jan 10, 2024
@joshmoore
Copy link
Member Author

Closing in favor of #159 for the moment.

@joshmoore joshmoore closed this Jan 11, 2024
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

Successfully merging this pull request may close these issues.

3 participants