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
docs: use sphinx-gitref to handle git links dynamically #462
Conversation
I see the 3.9 tests failed to find git info:
and that only 3.9 runs the docs update (from the workflow): - name: "Set lint/docs env var"
if: matrix.python-version == '3.9'
run: |
echo "LINT_DOCS=,lint,docs" >> $GITHUB_ENV I'll try to make time for this tomorrow or Monday. |
Pull Request Test Coverage Report for Build 2017668936
💛 - Coveralls |
I fixed the broken build by setting the version as the Git branch. I don't know if the links will be broken, I will take a look at GitHub Actions logs later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to your changes, I also fixed some Sphinx warnings from extlinks.
I left a comment to hear your opinion on the (hacky) workaround I suggested for gitref_branch
.
1e6eb39
to
9fe0ee0
Compare
Hrm, weird. I would have expected this to pass now. I was basing this on the documentation of GH default environment variables:
When the PR runs, |
9fe0ee0
to
459b705
Compare
Confirmed. I've added a new commit that adds a |
- Bumpversion no longer needs to update a series of rst files - Tox needs to pass through current Github actions information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for solving it! 🙏🏻
🎉 This PR is included in version 0.32.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Fix #459
Proposed changes
Use sphinx-gitref to generate github links to the project.
This automatically handles references to nitpick GitHub files based on the current checked out branch, including on ReadTheDocs. This takes care of the vast majority of project references.
There are a few caveats:
gitref_branch
configuration item to the tag name in thedocs/conf.py
configuration, when, say, theREADTHEDOCS_VERSION
env variable is set to a specific version rather thanlatest
orstable
.style-library
section was already using. These links will break when pushed to PyPI. This was already a problem before this change, however.code-block
examples on how to use regular GitHub URLs. These are just examples so may be just fine.The issue with the README.rst links being relative should probably only be addressed when releasing to PyPI; at that point the README.rst links could be updated to include the specific release tag before packaging, either as part of the release commit or as a poetry plugin that runs during wheel and sdist builds.
Checklist
make
locally before pushing commits