-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Run Sphinx builds in isolated subprocesses #2441
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I would suggest removing old lines of code instead of commenting. |
thank you for the feedback, i have implemented the suggestion. |
|
This seems to me like a safer way to use Sphinx, and removing the monkeypatching and undocumented Sphinx internals feels much cleaner. One important test would be whether this generates the same built docs as before. (I'm not set up to run djangoproject.com locally, and it doesn't seem like the PR checks deploy a preview site.) FWIW, Copilot had some concerns:
The point about extensions seems valid: they need to be full dotted paths in a command line arg, and there are potential shell quoting issues. But I question some of its other concerns: e.g., preventing doctree reuse was intentional. (Also, the AI mixing British and American spelling in the same paragraph doesn't inspire confidence 😄 .) Copilot also pointed out logging behavior would change. [To clarify: I'm not a maintainer on this project, just a human who uses docs.djangoproject.com and reported a bug.] |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Thanks for the detailed review! I’ve updated the PR and the implementation to avoid passing extensions via the command line and now rely entirely on conf.py, so extension loading and rendered output should match previous builds (aside from the bug fix). The subprocess isolation is intentional to avoid shared Sphinx/docutils state; changes like separate doctrees are expected but shouldn’t affect rendered content. Logging differences are noted, but behaviorally this should now be much closer to the existing builds. |
☝️ these changes currently mean the custom extension is no longer used as it roughly reverts the use added in #1947 How to test this works locally:
|
Fixed issue :- Docs intermittently mix translations of Sphinx labels #2416
Run each Sphinx build in a separate subprocess to avoid global state leakage
between documentation builds.