Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Conversation

@mhvk
Copy link

@mhvk mhvk commented Jan 13, 2016

In astropy/astropy#4465, I found that using python3 setup.py build_sphinx, links to python3 SyntaxWarning and RuntimeWarning were not working. I can solve this locally by replacing the local storage file for python3 listed in https://github.com/astropy/astropy-helpers/blob/master/astropy_helpers/sphinx/conf.py#L46 with None. Does that make sense?

@embray
Copy link
Member

embray commented Jan 12, 2016

@bsipocz
Copy link
Member

bsipocz commented Jan 12, 2016

@mhvk - is your python3 3.5 or 3.4? (I should have read the original astropy issue).
Maybe the links changes between the two releases (though if they were fixed in the main python inventory they should work now).

@bsipocz
Copy link
Member

bsipocz commented Jan 12, 2016

Replacing the local file with None means that sphinx will try to download the objects.inv from the link, and it will definitely mess up things for the python2 docs build (also it would make sense this case to delete https://github.com/astropy/astropy-helpers/blob/master/astropy_helpers/sphinx/conf.py#L45). Even if we say that astropy only supports sphinx with python3, it still screws up things for affiliated packages.

@mhvk
Copy link
Author

mhvk commented Jan 12, 2016

Since conf.py is just a python file, can we make the content of intersphinx_mapping['python'] depend on version?
`

@bsipocz
Copy link
Member

bsipocz commented Jan 12, 2016

That sounds like a plan that also saves me the pain of figuring out how I digged those links in the local file out of the binary inventory.
Will you try that or shall I?

@mhvk mhvk force-pushed the python-version-safe-sphinx branch from 1422406 to 8ff08ec Compare January 13, 2016 00:17
@mhvk
Copy link
Author

mhvk commented Jan 13, 2016

@bsipocz - I turned this into a PR, but am not sure this is the right way to go about it; if not, please feel free to make an alternative PR.

@bsipocz
Copy link
Member

bsipocz commented Jan 13, 2016

@mhvk - Can you confirm that this works with python2? I fear that removing the local hack inventory will brake those links that are listed in it at the moment.

@mhvk
Copy link
Author

mhvk commented Jan 13, 2016

@bsipocz - sadly, it doesn't seem this simple solution suffices. Building astropy documentation on python2, I seem to get only warnings for a missing reference to bytes, while on python3, I get warnings about missing references to unicode, plus missing references to file, cPickle and various exceptions.*. I think some of these are actual python2 assumptions in the documentation; the bytes/unicode thing is hopefully easier to fix.

@embray
Copy link
Member

embray commented Jan 13, 2016

I don't think preserving inter-sphinx references to all Python builtins is deeply important in all cases. I like this solution, and for any cases where it doesn't work add nitpick exceptions.

@bsipocz
Copy link
Member

bsipocz commented Feb 2, 2016

See #216 for a solution that works for both py2 ad py3. Since most affiliates uses python2 I think that we should keep the py2 compatibility of the helpers for a little longer (even if switching to py3 sphinx builds in astropy master).

@bsipocz
Copy link
Member

bsipocz commented May 17, 2016

This can be closed as the superseding #216 is merged.

@mhvk
Copy link
Author

mhvk commented May 17, 2016

Yes, you're right. Closing...

@mhvk mhvk closed this May 17, 2016
@mhvk mhvk deleted the python-version-safe-sphinx branch May 17, 2016 15:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants