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 better dev version number in docs #1922

Merged
merged 10 commits into from
Apr 23, 2024

Conversation

Conengmo
Copy link
Member

@Conengmo Conengmo commented Apr 4, 2024

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.

@Conengmo Conengmo added the work in progress Work is in progress on a PR, check the PR to see its status label Apr 4, 2024
@Conengmo Conengmo changed the title Use better dev version number in docs Use better dev version number in docs [WIP] Apr 4, 2024
@martinfleis
Copy link
Collaborator

Isn't there a way to configure setuptools_scm to do this for us, instead of replacing the string ourselves?

@Conengmo Conengmo changed the title Use better dev version number in docs [WIP] Use better dev version number in docs Apr 4, 2024
@Conengmo
Copy link
Member Author

Conengmo commented Apr 4, 2024

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 :)

@Conengmo Conengmo removed the work in progress Work is in progress on a PR, check the PR to see its status label Apr 4, 2024
@Conengmo Conengmo added the work in progress Work is in progress on a PR, check the PR to see its status label Apr 5, 2024
@Conengmo
Copy link
Member Author

Conengmo commented Apr 5, 2024

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.

@Conengmo Conengmo removed the work in progress Work is in progress on a PR, check the PR to see its status label Apr 5, 2024
@ocefpaf ocefpaf merged commit 570f293 into python-visualization:main Apr 23, 2024
11 checks passed
@Conengmo Conengmo deleted the docs-dev-version-number branch May 6, 2024 08:45
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.

None yet

3 participants