-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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: move sphinx-lint to pre-commit #105750
Conversation
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.
I'm not a great reviewer for the change to the Makefile, but everything else LGTM (and I approve of the idea)!
Thanks! I should also mention I based the Makefile stuff from the peps repo: https://github.com/python/peps/blob/1b0666eafa3d6ca2c5804f7ed41e49ebb74ca831/Makefile#L62-L66 (Which may have come from similar things in https://github.com/python-pillow/Pillow/blob/main/Makefile) |
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role | ||
$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/ | ||
check: venv | ||
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit |
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.
Any reason why this is installed like this instead of adding it to requirements.txt
?
Everything else LGTM.
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.
Good question, I think to prefer running pre-commit when committing to Git, and avoid installing it unless we really need to - usually we don't need it installed with all the other venv things.
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.
LGTM, thanks @hugovk
Since we also moved the 3.12 branch to using pre-commit and this is just a background infra change, I marked this for backport there too. |
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit bc07c8f) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
GH-105894 is a backport of this pull request to the 3.12 branch. |
GH-108276 is a backport of this pull request to the 3.11 branch. |
Move sphinx-lint to pre-commit, and so out of the Docs' various requirements.txt files.
Change
make -C Doc check
to run pre-commit instead of only sphinx-lint.pre-commit is run on the CI in lint.yml, so we no longer need to run
make check
there.📚 Documentation preview 📚: https://cpython-previews--105750.org.readthedocs.build/