Re: [Python-modules-team] Bug#830186: sphinx: intersphinx mapping extension causes network access during package builds

2016-07-12 Thread Barry Warsaw
On Jul 12, 2016, at 04:07 PM, Thomas Goirand wrote:

>I find this not the top-noch way. Here's what I do:
>
>override_dh_sphinxdoc:
>ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
>   PYTHONPATH=. sphinx-build -b html doc/source \
>   debian/python-foo-doc/usr/share/doc/python-foo-doc/html
>   dh_sphinxdoc
>endif

I'm going to do this in the next python-webob upload to close #830611.  It had
been building the docs in override_dh_installdocs.  I'll also need to patch
the conf.py file to use the python{,3}-doc files and add those packages as
build dependencies.

Cheers,
-Barry


pgpROt_11jI7v.pgp
Description: OpenPGP digital signature


Re: [Python-modules-team] Bug#830186: sphinx: intersphinx mapping extension causes network access during package builds

2016-07-12 Thread Thomas Goirand
On 07/10/2016 03:34 AM, Brian May wrote:
> Moved to debian-python list from bug report.
> 
> Dmitry Shachnev  writes:
> 
>> You say that we can read some flag set by dh-python. However, dh-python
>> (aka pybuild) already sets http{,s}_proxy environment variables which
>> disable network access for Sphinx. So packages using dh-python are already
>> safe.
> 
> Not sure I understand how dh-python / pybuild help with this problem.

It doesn't, it simply hides the issue.

Also, sometimes exporting http{s,}_proxy simply breaks unit testing (I
did have such case, yes...). So that's not really a fit-all solution either.

> I thought the recommended way to deal with building documentation was
> something like this in debian/rules:
> 
> override_dh_auto_build:
> dh_auto_build
> PYTHONPATH=. sphinx-build -b html -N Doc/ Doc/.build/html

I find this not the top-noch way. Here's what I do:

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=. sphinx-build -b html doc/source \
debian/python-foo-doc/usr/share/doc/python-foo-doc/html
dh_sphinxdoc
endif

IMO, that's better because you don't need to clean Doc/.build/html.
Also, the dh_auto_build isn't the correct target. Some derivative may
well choose not to implement dh_sphinxdoc (for example, for small
systems where they don't want docs), and here, you're making their lives
miserable.

Cheers,

Thomas Goirand (zigo)