Skip to content

Documentation fails to build with Python 3 #2281

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

Closed
wants to merge 4 commits into from

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Aug 6, 2013

Documentation fails to build with Python 3.

$ python3.3 make.py
Running Sphinx v1.2b1

Exception occurred:
  File "conf.py", line 47, in <module>
    if sphinx.__version__ >= 1.1:
TypeError: unorderable types: str() >= float()
...

Patch:

--- doc/conf.py
+++ doc/conf.py
@@ -44,7 +44,7 @@

 autosummary_generate = True

-if sphinx.__version__ >= 1.1:
+if sphinx.__version__ >= '1.1':
     autodoc_docstring_signature = True

 # Add any paths that contain templates here, relative to this directory.

@WeatherGod
Copy link
Member

technically speaking, it shouldn't be like that either (is version 1.1.1 greater or less than version 1.1?). There is a a module in distutils for comparing version numbers, we should use that instead.

@mdboom
Copy link
Member

mdboom commented Aug 6, 2013

@WeatherGod: agreed.

My understanding is that there are a lot of other bugs lurking behind that that prevent building the docs on Python 3 as well.

@Arfrever
Copy link
Author

Arfrever commented Aug 6, 2013

I am able to build documentation in Matplotlib 1.3.0 with Python 3 after fixing this TypeError.

@mdboom
Copy link
Member

mdboom commented Aug 6, 2013

The issue was that numpydoc did not support Python 3. Indeed, in the latest release of Numpy and in the numpydoc available from pip it still does not. However, the numpydoc in numpy master does appear to work with Python 3.

@WeatherGod
Copy link
Member

Just as a side note, the NumPy developers have split out numpydoc into its own repo: https://github.com/numpy/numpydoc

@Arfrever
Copy link
Author

Arfrever commented Aug 6, 2013

(I use NumPy 1.7.1 and numpydoc 0.4.1_pre20130801.)

@mdboom
Copy link
Member

mdboom commented Aug 6, 2013

@WeatherGod: Thanks, I wasn't aware of that.

There are gobs of failing plots under Python 3. We should probably put some effort into fixing them, as it also means those examples will not work on Python 3.

@mdboom
Copy link
Member

mdboom commented Aug 6, 2013

I've attached code that addresses the initial problem as reported by @ARFever, and then fixes a number of failing examples. There are still a few classes of errors in some of the examples, that I didn't get to (in case someone else wants to have a crack at it):

Trying to load a Python 2-created pickle in Python 3:

examples/api/date_demo.py
examples/pylab_examples/centered_ticklabels.py
examples/pylab_examples/load_converter.py
examples/pylab_examples/scatter_demo2.py
doc/users/recipes.rst

Requires PIL -- should be converted to Pillow:

examples/pylab_examples/to_numeric.py
doc/users/image_tutorial.rst

All of the units examples are failing, we should investigate

examples/units/*

@Arfrever
Copy link
Author

Arfrever commented Aug 6, 2013

examples/pylab_examples/to_numeric.py is compatible with Pillow.
doc/users/image_tutorial.rst needs to import PIL.Image instead of Image.

@Arfrever
Copy link
Author

Apparently I previously tested only with Python 3.3.
There are syntax errors in doc/sphinxext/gen_rst.py with Python 3.2 due to u'' literals.

@mdboom
Copy link
Member

mdboom commented Aug 12, 2013

@ARFever: I probably won't have time to work on this over the next few weeks. If you wanted to make a PR against this one for the Python 3.2 fixes, I wouldn't object 😉

@tacaswell
Copy link
Member

Closing this because the docs build with py3k on current master. I do not think it is worth the effort to fix building the docs on py3k on the un-sixified 1.3.x branch (as we will stop supporting it in the very near future).

@tacaswell tacaswell closed this Feb 21, 2014
@mdboom mdboom deleted the doc-build-3 branch November 10, 2015 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants