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

Modernize versioneer or maybe even replace it? #4685

Closed
foosel opened this issue Nov 14, 2022 · 3 comments
Closed

Modernize versioneer or maybe even replace it? #4685

foosel opened this issue Nov 14, 2022 · 3 comments
Labels
approved Issue has been approved by the bot or manually for further processing done Done but not yet released task A OctoPrint related task that needs to be taken care of as part of a milestone
Milestone

Comments

@foosel
Copy link
Member

foosel commented Nov 14, 2022

The problem

OctoPrint currently uses an ancient & heavily adjusted versioneer build that is bundled.

That version of versioneer only supports setuptools, which long term will cause problems in switching OctoPrint to pyproject.toml (at some point setup.py will either go away or at the very least become increasingly more difficult to cater to, pyproject.toml based build configurations are what pip is currently pushing towards).

The solution

There are three options I currently see:

  1. Update versioneer to the latest release, which supports pyproject.toml as well as setup.py. However, our customization with .versioneer-lookup that basically creates virtual tags to use for version generation based on the currently checked-out branch is not available in that. That would have to be ported if we want to keep our current branching scheme.

  2. Update versioneer and switch to the use of release branches instead of .versioneer-lookup. We would no longer have maintenance and devel but rather something like 1.9.0 and 2.0.0 as development branches for the respective version. It might even make sense to stop supporting installing stable OctoPrint directly from master and instead use that as bugfix prep branch for the latest tag.

  3. Like 2, but switching to PyPA's own setuptools_scm.

For reference:

I'm honestly currently not sure which of the options I prefer.

@github-actions github-actions bot added triage This issue needs triage and removed approved Issue has been approved by the bot or manually for further processing labels Nov 14, 2022
@OctoPrint OctoPrint deleted a comment from github-actions bot Nov 14, 2022
@cp2004
Copy link
Member

cp2004 commented Mar 11, 2023

To add to this issue - OctoPrint almost works under Python 3.12, but versioneer uses SafeConfigParser which has been deprecated for a while & removed in 3.12. (At least that's going off the top of my head).

It's easily fixable, but it means that the pip install process is no longer Python 2 compatible so you don't get the nice error message. Some more advanced error handling could probably make it work, I remember having a poke before. At some point we will have to jump ship there I guess, it is widely known that OctoPrint isn't Py2 compatible anymore but there are still some people running older versions that it would be nice to not have them start saying updating/installing is broken.

@foosel
Copy link
Member Author

foosel commented Oct 4, 2023

The SafeConfigParser issue has been fixed in a922ff8, so that's no longer in the way for Python 3.12.

Meanwhile I still have not made a decision on which way to go here.

foosel added a commit that referenced this issue Oct 5, 2023
Instead of customizing an existing tool that does a lot of stuff
that we don't need but lacks what we DO need (branch based virtual
tags), now there's a custom single file implementation that mixes
concepts from versioneer, miniver and the lookup that so far was
implemented in OctoPrint's custom build of versioneer, and does so
with less overhead.

Closes #4685
@foosel
Copy link
Member Author

foosel commented Oct 16, 2023

In the end I decided to replace it with a small tool. Enter _version.py now living in the source tree, heavily influenced by miniver but adjusted to allow the use of virtual tags. It should result in pretty much the same versioning behaviour as versioneer so far did, but of course I might have overlooked some corner cases. We'll see.

@foosel foosel closed this as completed Oct 16, 2023
@github-actions github-actions bot added the done Done but not yet released label Oct 16, 2023
@foosel foosel added this to the 1.10.0 milestone Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Issue has been approved by the bot or manually for further processing done Done but not yet released task A OctoPrint related task that needs to be taken care of as part of a milestone
Projects
Status: Done
Development

No branches or pull requests

2 participants