-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Ensure invoked Sphinx matches importable one #6965
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
Conversation
This should fix crashes when both conda and pip have Sphinx installed. It's likely also negligibly faster since it avoids the binary wrappers.
Note that this approach is already what you use for mkdocs. |
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.
We need to test this across all sphinx versions (>=1.5).
But looks like it should work https://github.com/sphinx-doc/sphinx/blob/v1.5/sphinx/__main__.py
It was added in 1.3: sphinx-doc/sphinx@74c7a52 |
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.
Tested this with a couple of versions, everything looks correct 👍
Interesting. Anything that changes how we do builds scares me, but this seems like a reasonable change. I wonder if we should put it behind a feature flag to test it, and then roll it out via |
@eric-wieser this is how we add feature flags https://github.com/readthedocs/readthedocs.org/pull/6729/files let me know if you want to give it a try o I can take it from here. The flag could be called |
I'd prefer if you could take it from here, thanks. I think a more suitable name for the flag might be Whatever you decide, could you enable this new behavior on the |
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.
Looks good. 👍
Co-authored-by: Eric Wieser <[email protected]>
Should there be a test for this? There was one present in 1fa3dda, but it seems it was removed again. |
I'll add it back when the feature flag is enabled by default. |
@eric-wieser I enabled this feature flag in your project. Let me know if it does work as you expected. Thanks! |
Definitely doesn't break anything. Not sure if I can easily reproduce the original issue, since it relied on PyPI having a newer release of sphinx than conda, something that only happens immediately after a sphinx release. |
This should fix crashes when both conda and pip have Sphinx installed. It's likely also negligibly faster since it avoids the binary wrappers.