- Python Build Github
- SemVer

TLDR: Python Build seems to not like non “v*..” version tags in git tag based version setting.

The full story I’m working on a project for work. It’s not public yet and thats probably good because I’m a very very young Pythonista, my code is a mess but, it works well and can be installed with pip install <package>.whl. I’m fairly proud. So I start working on a way to get this all automated via GIT, GitHub, and Github Actions/Workflows.
So as I start working on this I go through a few transitory stages, starting with, moving to pyproject.toml which moved me to python/build.

Great local builds still work and I can get the tool to the point where you can run <command_name> from the terminal and it works.
Next i start trying to get this working in Github with automated releases. At some point I work through copying other’s workflows to give me a base to work from. What happens is a day full of frustrations. I get the builds going but the fist v1.0.0 (major) vs v0.X.0 (minor) release I get files/released “packages” that are “versioned” with the default version 0.0.<something>. WTH is going on? Why is this all of a sudden failing. even when it goes to minor versions of V1 (IE v1.X.0)

After more work changing how I get the git tag into the build (I have to do this because of the way workflow/action chaining means a lot of the ENV variables change depending on triggers so I wanted to standardize some of the inputs) in which I have at some point thought “what if I drop the v in the git tags to see if that changes some of the behavior that got me further along in some of the interations, I eventually add it back and SUDDENLY it works. I didn’t see anywhere in Build’s documentation that this was a required format. SemVer didn’t seem to require a v in the version tags anywhere.

So finally I get it to work. and can finally release with proper version tagging. The final piece to this that got this project to at least an MVP: I got semver-release automation added so I can get releases properly versioned based on git commit messages.

Lets just say there is 8-10 hours of my life I want back.