Closed Conengmo closed 1 month ago
Isn't there a way to configure setuptools_scm to do this for us, instead of replacing the string ourselves?
Good suggestion Martin, I found this snippet in their docs which seems to work well: https://setuptools-scm.readthedocs.io/en/stable/usage/#usage-from-sphinx.
Running Sphinx v7.2.6
Version: 0.16.1.dev37+g1296fdf3
It assumes we're working towards a 0.16.1 release instead of a 0.17.0 release, but I guess that doesn't really matter. Most important thing is that it's much better than 0.1.dev that's shown now :)
Okay so turns out the issue was not in the conf.py code, but that there was no git history to find the latest tag in. So just updating the workflow to also fetch the history is enough to get the right version number. There's also no need to manipulate that string, it's already good as it is.
Improve the dev version number we show in the docs. We now show something like
0.1.dev1.dev+gca4ce8f
.The issue is that in the workflow only the latest commit is fetched, so we don't know the latest tag. Fetch the full history so we know the latest tag.
Then simplify some things in the docs config. No need to manipulate the version string. It will now look like
v0.x.y.devn+hash
, where n is the number of commits since the release.