-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Regression: Docs no longer build with py27-sphinx since #2394 #2593
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
Comments
I personally like what Pallets' projects are doing: AST analyzing the version string, without really importing it, like: https://github.com/pallets/click/blob/master/setup.py#L11. We'd need typed-ast instead to be able to generate the AST on Python 2 as well and we should be all set. Let me see how much work it is to prepare a PR for this. |
Turns out we don't even need typed-ast if we only evaluate the string found in the version assignment. |
- Add mypy/version_static.py during doc build to work around python/mypy#2593. Pending official patch or rejection of py27-sphinx compatibility. - Fix Sphinx theme. Sphinx does NOT recognize PYTHONPATH, so installing sphinx_rtd_theme to libexec/vendor then pointing PYTHONPATH there is useless. Instead, we install sphinx_rtd_theme to buildpath/docs, then directly modify sys.path in Sphinx's conf.py.
While I'm not sure I care about Sphinx-2.7 given that mypy solidly requires
Python 3 to run, the hackery in version.py is definitely not ideal (and may
even have some broken edge cases, search the tracker). But I'm not sure
that just opening the file instead of importing it is really better (the
import machinery is *sooo* much subtler than that...).
…On Tue, Dec 20, 2016 at 1:25 PM, Łukasz Langa ***@***.***> wrote:
Turns out we don't even need typed-ast if we only evaluate the string
found in the *version* assignment.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2593 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMuO3ExBaihFdYdg4VY9wIsR7mjD6ks5rKEfVgaJpZM4LSSab>
.
--
--Guido van Rossum (python.org/~guido)
|
- Add mypy/version_static.py during doc build to work around python/mypy#2593. Pending official patch or rejection of py27-sphinx compatibility. - Fix Sphinx theme. Sphinx does NOT recognize PYTHONPATH, so installing sphinx_rtd_theme to libexec/vendor then pointing PYTHONPATH there is useless. Instead, we install sphinx_rtd_theme to buildpath/docs, then directly modify sys.path in Sphinx's conf.py. Closes #8073. Signed-off-by: Tomasz Pajor <[email protected]>
@ambv Since you closed your PR, did you intend this issue to be closed with "won't fix" as well? |
As the OP I'm okay with wont fix. I've patched the Homebrew formula (with the version_static hack mentioned above, only at build time) and no one's mad at me so far. |
Docs used to build just fine with Sphinx under Python 2.7. #2394 introduced an import
mypy.git
tomypy.version
(which is imported by Sphinx'sconf.py
), and sincemypy.git
contains function annotations not supported by Python 2.7, trying to build the docs with py27-sphinx now causes an error:This unfortunately is causing some trouble for Homebrew (see Homebrew/homebrew-core#7143), since our
sphinx-doc
formula is py27 only at the moment.We'll of course try to fix this on Homebrew's side, but maybe py27-sphinx compatibility could be restored? One solution I can think of is to add something like
mypy/version_static.py
with the plain old version declaration:then import
mypy.version_static
indocs/source/conf.py
instead. The downside is it needs to be bumped alongsideversion.py
at the same time, and when building from a git tree, the commit hash won't be included in the docs.The text was updated successfully, but these errors were encountered: