Discussion:
[PyCUDA] Problems building PyCUDA documentation
Tomasz Rybak
2016-07-01 09:42:10 UTC
Permalink
I was trying to rebuild PyCUDA 2016.1.1 (as tagged on GitHub) package using
CUDA 7.5 and Sphinx 1.4.4.
There was warning regarding http to https redirect on documen.tician.de,
patch below:
Index: pycuda-2016.1.1/doc/source/conf.py
===================================================================
--- pycuda-2016.1.1.orig/doc/source/conf.py
+++ pycuda-2016.1.1/doc/source/conf.py
@@ -187,5 +187,5 @@ latex_documents = [
intersphinx_mapping = {
'http://docs.python.org/dev': None,
'http://docs.scipy.org/doc/numpy/': None,
- 'http://documen.tician.de/codepy/': None,
+ 'https://documen.tician.de/codepy/': None,
}


There was also error when building documentation, see the trace:
# Sphinx version: 1.4.4
# Python version: 2.7.12rc1 (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
# Running Sphinx v1.4.4
# loading pickled environment...
# not yet created
# loading intersphinx inventory from
http://docs.python.org/dev/objects.inv...
# intersphinx inventory has moved: http://docs.python.org/dev ->
https://docs.python.org/dev
# loading intersphinx inventory from
https://documen.tician.de/codepy/objects.inv...
# loading intersphinx inventory from
http://docs.scipy.org/doc/numpy/objects.inv...
# building [mo]: targets for 0 po files that are out of date
# Loaded extensions:
# sphinx.ext.mathjax (1.4.4) from
/usr/lib/python2.7/dist-packages/sphinx/ext/mathjax.pyc
# alabaster (0.7.8) from
/usr/lib/python2.7/dist-packages/alabaster/__init__.pyc
# sphinx.ext.intersphinx (1.4.4) from
/usr/lib/python2.7/dist-packages/sphinx/ext/intersphinx.pyc
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/sphinx/cmdline.py", line 244, in
main
app.build(opts.force_all, filenames)
File "/usr/lib/python2.7/dist-packages/sphinx/application.py", line 298,
in build
self.builder.build_update()
File "/usr/lib/python2.7/dist-packages/sphinx/builders/__init__.py", line
248, in build_update
to_build = list(to_build)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 174,
in get_outdated_docs
self.config_hash = get_stable_hash(cfgdict)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 59,
in get_stable_hash
return get_stable_hash(list(obj.items()))
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 59,
in get_stable_hash
return get_stable_hash(list(obj.items()))
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 59,
in get_stable_hash
return get_stable_hash(list(obj.items()))
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in get_stable_hash
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 61,
in <genexpr>
obj = sorted(get_stable_hash(o) for o in obj)
File "/usr/lib/python2.7/dist-packages/sphinx/builders/html.py", line 62,
in get_stable_hash
return md5(text_type(obj).encode('utf8')).hexdigest()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 0:
ordinal not in range(128)

This is caused by doc/source/conf.py, html_theme_options, which contains
Unicode characters for floppy and rocket. I did not have any problems with
PyOpenCL, probably because 2016.1 does not contain those glyphs.

Andreas - how have you built documentation for your web page? Is there some
special option for Sphinx I should use?

Best regards
Tomasz Rybak
Andreas Kloeckner
2016-07-01 14:02:52 UTC
Permalink
Tomasz Rybak <***@post.pl> writes:
> I was trying to rebuild PyCUDA 2016.1.1 (as tagged on GitHub) package using
> CUDA 7.5 and Sphinx 1.4.4.
> There was warning regarding http to https redirect on documen.tician.de,
> patch below:
> Index: pycuda-2016.1.1/doc/source/conf.py
> ===================================================================
> --- pycuda-2016.1.1.orig/doc/source/conf.py
> +++ pycuda-2016.1.1/doc/source/conf.py
> @@ -187,5 +187,5 @@ latex_documents = [
> intersphinx_mapping = {
> 'http://docs.python.org/dev': None,
> 'http://docs.scipy.org/doc/numpy/': None,
> - 'http://documen.tician.de/codepy/': None,
> + 'https://documen.tician.de/codepy/': None,
> }

Thanks for the patch, I've applied that.

> This is caused by doc/source/conf.py, html_theme_options, which contains
> Unicode characters for floppy and rocket. I did not have any problems with
> PyOpenCL, probably because 2016.1 does not contain those glyphs.
>
> Andreas - how have you built documentation for your web page? Is there some
> special option for Sphinx I should use?

Regarding the Sphinx build problem: I can reproduce this on Python 2,
but I've been using Python 3, where the issue does not occur. I'm not
entirely sure what the issue is--the traceback is somewhere deep in the
weeds.

Andreas
Tomasz Rybak
2016-07-01 16:36:39 UTC
Permalink
Dnia 2016-07-01 16:02 Andreas Kloeckner napisał(a):

>Tomasz Rybak <***@post.pl> writes:
>> I was trying to rebuild PyCUDA 2016.1.1 (as tagged on GitHub) package
using
>> CUDA 7.5 and Sphinx 1.4.4.
>> There was warning regarding http to https redirect on documen.tician.de,
>> patch below:
>> Index: pycuda-2016.1.1/doc/source/conf.py
>> ===================================================================
>> --- pycuda-2016.1.1.orig/doc/source/conf.py
>> +++ pycuda-2016.1.1/doc/source/conf.py
>> @@ -187,5 +187,5 @@ latex_documents = [
>> intersphinx_mapping = {
>> 'http://docs.python.org/dev': None,
>> 'http://docs.scipy.org/doc/numpy/': None,
>> - 'http://documen.tician.de/codepy/': None,
>> + 'https://documen.tician.de/codepy/': None,
>> }
>
>Thanks for the patch, I've applied that.
>
>> This is caused by doc/source/conf.py, html_theme_options, which contains
>> Unicode characters for floppy and rocket. I did not have any problems
with
>> PyOpenCL, probably because 2016.1 does not contain those glyphs.
>>
>> Andreas - how have you built documentation for your web page? Is there
some
>> special option for Sphinx I should use?
>
>Regarding the Sphinx build problem: I can reproduce this on Python 2,
>but I've been using Python 3, where the issue does not occur. I'm not
>entirely sure what the issue is--the traceback is somewhere deep in the
>weeds.
>

Thanks, building with Python 3 was exactly what was needed.
I changed doc/Makefile to use python3 instead of python:
https://anonscm.debian.org/cgit/collab-maint/python-pycuda.git/tree/debian/patches/sphinx.patch?id=9b0962ca4e0c4ebd6e42415a5ffcb19b744fe02d

and now package builds without problems.

Would you apply this patch in repository??
Debian has policy that python means Python 3, and python3 is for Python 3
interpreter.
If not - that's not a problem, now it is automatically applied during
building of Debian packages.

Best regards.
Tomas Rybak
Andreas Kloeckner
2016-07-02 01:25:18 UTC
Permalink
Tomasz Rybak <***@post.pl> writes:
> Would you apply this patch in repository??
> Debian has policy that python means Python 3, and python3 is for Python 3
> interpreter.
> If not - that's not a problem, now it is automatically applied during
> building of Debian packages.

Done.

Andreas
Tomasz Rybak
2016-07-04 07:56:03 UTC
Permalink
Dnia 2016-07-02 03:25 Andreas Kloeckner napisał(a):

>Tomasz Rybak <***@post.pl> writes:
>> Would you apply this patch in repository??
>> Debian has policy that python means Python 3, and python3 is for Python 3
>> interpreter.
>> If not - that's not a problem, now it is automatically applied during
>> building of Debian packages.
>
>Done.
>

Thanks.

Best regards.
Tomasz Rybak
Loading...