wpilibsuite / sphinxext-opengraph

Sphinx extension to generate unique OpenGraph metadata
https://sphinxext-opengraph.readthedocs.io
Other
69 stars 25 forks source link

Create wheel with version number not "main" #79

Closed hugovk closed 1 year ago

hugovk commented 1 year ago

Fixes part two of https://github.com/wpilibsuite/sphinxext-opengraph/issues/76.

Fetch all tags:

https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches

So that when setup.py runs:

https://github.com/wpilibsuite/sphinxext-opengraph/blob/a2d9acc031510cdc6e9e274f16d1efe27d5849aa/setup.py#L5-L16

We use the version in the wheel name and not "main".

hugovk commented 1 year ago

Well, something like this, but this stil has main:

Successfully built sphinxext-opengraph-main.tar.gz and sphinxext_opengraph-main-py3-none-any.whl

Will check further.

auscompgeek commented 1 year ago

See my comment on the issue, I believe it's building the wheel from the sdist outside of the git tree. The setup.py will need to be fixed to allow building/installing the sdist.

hugovk commented 1 year ago

Righto, here's one way, use https://github.com/pypa/setuptools_scm to fetch the version from the tag instead of calling Git directly via a subcommand.

When not exactly on a tag, it gives a dev version number based on the "distance" from the tag. For example:

$ python setup.py --version
0.7.1.dev3+g0ed6287

https://github.com/pypa/setuptools_scm#default-versioning-scheme

~Edit: still not quite ready!~