Closed TheTripleV closed 1 year ago
The built wheel is incorrectly versioned. The correct version is picked up but is replaced at some point with the branch name of "main".
I think the setup.py is overwriting the version in the sdist when building the wheel since it fails to run git describe
in the isolated environment (which is a temporary directory).
Yeah, I thought it was because https://github.com/actions/checkout does a shallow checkout by default, so we need to fetch all tags:
https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches
But I added that in PR #79 but it still fails.
We can see it gets the tag for the sdist but not the wheel:
Successfully built sphinxext-opengraph-0.7.0.tar.gz and sphinxext_opengraph-main-py3-none-any.whl
Printing the exception:
try:
ret = subprocess.run(
"git describe --tags --abbrev=0",
capture_output=True,
check=True,
shell=True,
)
version = ret.stdout.decode("utf-8").strip()
except Exception as e:
print(e)
version = "main"
Gives:
Command 'git describe --tags --abbrev=0' returned non-zero exit status 128.
For the first one, I think we want something like:
on:
push:
tags:
- '*'
Rather than:
on:
create:
tags:
- '*'
Closed in #79 and #80. https://pypi.org/project/sphinxext-opengraph/0.7.1/