Skip to content

Conversation

@mhvk
Copy link
Contributor

@mhvk mhvk commented Jul 5, 2016

@bsipocz's #4556 made it possible to build the documentation well with python3. This is a reminder to consider moving the read-the-docs and travis sphinx builds to it. From @astrofrog's #4556 (comment)

I think we should do the switch to Python 3 on RTD after the release so that we can deal with things step by step. Note that RTD will not stop serving existing docs, so once we make the switch on RTD to Python 3, only new docs will need to be build-able. This suggests to me the following timeline:

  • Merge Fixing links to make sphinx built pass with py3.5  #4556 and keep Travis on Python 2.7
  • Go ahead with the 1.2 and 1.0.10 releases
  • Switch default travis build to python 3, but not yet the docs [Move travis tests to python 3.5 by default. #5155]
  • Switch Travis and RTD to build the docs with Python 3. At this point, new latest builds will start building with Python 3, and future 1.2.x builds will also be fine since the 1.2.x branch includes the changes here.
  • Backport any required changes for the docs to build to astropy-helpers 1.0.x, and release a new version of the helpers
  • Update the 1.0.x branch of astropy core to the latest astropy-helpers and do whatever fixes are needed to get it building without errors on Python 3
  • Carry out a new 1.0.x release, which will now build correctly on RTD

@bsipocz
Copy link
Member

bsipocz commented Jul 5, 2016

@mhvk - Can you add the switch over python3.5 to this issue? It makes little sense to me to open a separate PR and repeating everything from this issue. (and I can't turn this issue to a PR since you opened it). I think none of the action items above applies to this PR except the change in the travis file.

@astrofrog
Copy link
Member

So I guess the next thing we can do is first make sure that we can get RTD to work correctly with a Python 3 build?

@bsipocz
Copy link
Member

bsipocz commented Jul 5, 2016

Yes I think so. Then backport the relevant PRs to a 1.0.x helpers release.
I can try and test it locally/on travis, but can't do the backporting properly or the release.

@mhvk
Copy link
Contributor Author

mhvk commented Jul 5, 2016

@bsipocz - OK, I made this into a PR that changes the travis sphinx build to default python, i.e., 3.5. (Just so the flow remains clear, I also added a "done" item to the above checklist.)

@pllim pllim added this to the v1.0.11 milestone Jul 5, 2016
@mhvk
Copy link
Contributor Author

mhvk commented Jul 5, 2016

Sphinx build passing here, so maybe time for the next step? It would seem that all one has to do is to switch to CPython 3.x in the advanced settings on readthedocs...

@astrofrog
Copy link
Member

@mhvk - changed, and the docs are now being built. Standing by...

@mhvk
Copy link
Contributor Author

mhvk commented Jul 6, 2016

@astrofrog - did the RTD python3 build work? If so, I guess this one should be merged so travis and RTD do the same thing, and we should open a new issue with the remaining items from the checklist...

@astrofrog
Copy link
Member

@mhvk - I think it did. Check the latest docs and try and find a link to the Python docs (e.g. instances of True or False) and I think it should link to Python 3 docs.

@bsipocz
Copy link
Member

bsipocz commented Jul 6, 2016

And I've started to test 1.0.x locally to see what's needed to make it work.

@mhvk
Copy link
Contributor Author

mhvk commented Jul 6, 2016

@astrofrog - indeed, None, True, etc., now link to python3 ... but looking more closely, that seems to hold for all astropy versions because those didn't point to a specific python version anyway.

I tried to find some TypeError etc but at least those in the Raises parts of docstring do not seem to be turned into links generally.

@bsipocz
Copy link
Member

bsipocz commented Jul 6, 2016

@mhvk - Those were never turned into links or at least not consistently (I have a long abandoned PR to change them over, but it was manual and wasn't sure we want that anyway, maybe I should revive it at some point during a cleanup).

@bsipocz
Copy link
Member

bsipocz commented Jul 6, 2016

@saimn
Copy link
Contributor

saimn commented Jul 6, 2016

Unfortunately, the CPython 3.x switch has no effect when the builds use Anaconda (I discovered this recently but didn't make the link with this PR before, sorry).

@saimn
Copy link
Contributor

saimn commented Jul 6, 2016

I mean, if you look at the detail of installed packages, the -py27_0 versions are installed.

@bsipocz
Copy link
Member

bsipocz commented Jul 6, 2016

Could you link the line please?

@saimn
Copy link
Contributor

saimn commented Jul 6, 2016

@bsipocz - I think https://readthedocs.org/projects/astropy/builds/4168563/ should use Python 3, but click on the 'conda install ...' block to see the installed packages.

@saimn
Copy link
Contributor

saimn commented Jul 6, 2016

Maybe adding something like python=3.5 in the environment file could change the python version.

@bsipocz
Copy link
Member

bsipocz commented Jul 6, 2016

@astrofrog @mhvk - So to make it work on the v1.0.x branch, we need to following backports:

And the helpers v1.0.8 release needs at least this:

Cherry-picking these pass both sphinx tests: https://travis-ci.org/bsipocz/astropy/builds/142852685 (ignore the first one as there was an error in the cleared out travis file)

In addition, as the latest v1.0.7 helpers is failing due to various reasons, to have a passing version the following backports are needed (to be able to deal with the newer sphinx and setuptools versions):

Cherry picking the relevant commits passes on the tests: https://travis-ci.org/bsipocz/astropy-helpers/builds/142843894

Using all the helpers backports it still works: https://travis-ci.org/bsipocz/astropy/builds/142861025

@pllim pllim mentioned this pull request Jul 7, 2016
@astrofrog
Copy link
Member

Adding:

  - python>=3

to the environment file works.

@mhvk
Copy link
Contributor Author

mhvk commented Jul 24, 2016

@astrofrog - I slightly lost track here: should we go ahead and add the python>=3.5 line to the RTD setup now so that those builds start to use python3? If so, we could move ahead and merge this (and open a new PR for the remaining items).

@bsipocz
Copy link
Member

bsipocz commented Jul 24, 2016

@mhvk - Can you try and add that to readthedocs.yml to see whether it works now?

@mhvk
Copy link
Contributor Author

mhvk commented Jul 24, 2016

@bsipocz - you mean in this PR? Do we then have to merge it to check that it works?

@bsipocz
Copy link
Member

bsipocz commented Jul 24, 2016

Oh my bad, you're right of course.

@mhvk mhvk force-pushed the travis-sphinx-to-3.5 branch from caadfb2 to d4bb956 Compare July 24, 2016 14:48
@mhvk
Copy link
Contributor Author

mhvk commented Jul 24, 2016

OK, I changed .rtd-environment.yml -- is that the correct one?

@bsipocz
Copy link
Member

bsipocz commented Jul 24, 2016

I think it should be a version: >=3.5 line added under python in readthedocs.yml. Though this may work as well (as .rtd-environment.yml is the one to control the conda packages for the environment).

@mhvk
Copy link
Contributor Author

mhvk commented Jul 24, 2016

I copied my change from #5135 (comment) - but am of course happy to change. A line in readthedocs.yml does seem more logical...

@bsipocz
Copy link
Member

bsipocz commented Jul 24, 2016

I assumed the other file based on this readthedocs/readthedocs.org#1901, but I guess both should work.

@astrofrog
Copy link
Member

I think it will work as it is at the moment and it won't change anything to specify it in readthedocs.yml too, but I'll double check.

@astrofrog
Copy link
Member

Here's a test build: http://astropy-test.readthedocs.io/en/latest/ - I haven't had a chance to check whether it worked, but could someone else take a look?

@bsipocz
Copy link
Member

bsipocz commented Jul 24, 2016

@astrofrog - general links (e.g. object, False, IndexError) still point to the python2 docs in your link.

@astrofrog
Copy link
Member

Weird, the build was using Python 3:

http://readthedocs.org/projects/astropy-test/builds/4231016/

For instance you can see it loaded the Python 3 object inventory:

loading intersphinx inventory from http://docs.python.org/3/objects.inv...

and

loading intersphinx inventory from /home/docs/checkouts/readthedocs.org/user_builds/astropy-test/conda/latest/lib/python3.5/site-packages/astropy_helpers/sphinx/local/python3_local_links.inv...

@MSeifert04
Copy link
Contributor

I think that's a simple caching problem. If I check the Build-Messages it says Finished processing dependencies for astropy==1.2.dev15876 but the docs are Astropy v1.2.dev15874.

In my experience it seems non-deterministic which version is displayed but sometimes clearing the version and then building it again works (although this may be an iterative process).

@astrofrog
Copy link
Member

@bsipocz
Copy link
Member

bsipocz commented Jul 28, 2016

Yes, the things I checked randomly all look good.

@astrofrog
Copy link
Member

I think we can go ahead and merge this now. The only impact on users will be that they will get redirected to the Python 3 docs instead of Python 2 for intersphinx links, and I think that's fine (since in 95% of cases the content is the same, just more nicely formatted).

@eteq @taldcroft @kelle - as coordinators, any objections?

@mhvk mhvk force-pushed the travis-sphinx-to-3.5 branch from d4bb956 to bded2cb Compare August 11, 2016 13:47
@mhvk
Copy link
Contributor Author

mhvk commented Aug 11, 2016

I rebased, so this should be mergeable again.

@mhvk
Copy link
Contributor Author

mhvk commented Aug 19, 2016

Shall we merge this?

@astrofrog astrofrog merged commit f7cae22 into astropy:master Aug 19, 2016
@astrobot
Copy link

@astrofrog - thanks for merging this! However, I noticed the following issue with this pull request:

  • Changelog entry not present (or pull request number missing) and neither the Affects-dev nor the no-changelog-entry-needed label are set

Would it be possible to fix this? Thanks!

This is an experimental bot being written by @astrofrog - let me know if the message above is incorrect!

@mhvk mhvk deleted the travis-sphinx-to-3.5 branch August 19, 2016 20:16
@mhvk
Copy link
Contributor Author

mhvk commented Aug 19, 2016

@astrofrog - do you want to move the remaining items on the checklist on top to a new issue?

@astrofrog
Copy link
Member

I don't have time this evening - would you have time to do it now? If not, i'll do it tomorrow.

@mhvk
Copy link
Contributor Author

mhvk commented Aug 20, 2016

@astrofrog - OK, new issue is #5246

@astrofrog astrofrog modified the milestones: v1.3.0, v1.0.11 Aug 22, 2016
@astrofrog
Copy link
Member

Milestoning this as 1.3.0 since as discussed in #5246, we don't need to backport this type of change. The Python version is set by the RTD YAML environment file, which means it's possible to build different versions of Astropy on different Python versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants