[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pybuild sphinxdoc and extensions



Cześć Piotr,

I found this thread while trying to update the Debian packaging for a Python library that I maintain. The library has Sphinx documentation that is quite complex to build: First, the library needs to be built (it contains C extensions), then figures are generated by scripts, and finally Sphinx is run. This is all done in a Makefile.

Piotr Ożarowski wrote:

[PICCA Frederic-Emmanuel, 2014-04-06]
> so I would like to know how to change this snipset to use the
> {build_dir} for the PYTHONPATH.

you cannot really use pybuild for this, it will invoke your command after or before each interpreter/version call. If you hardcode pybuild's
internal paths on the other hand (.pybuild/something in case of
distutils build plugin), it will break once the internal path changes...

I suggest to move building docs to install target and add
debian/foo/usr/lib/python3/dist-packages) to PYTHONPATH. I also build directly into debian/foo/usr/share/doc/foo/html so I feel a little less
guilty for doing it in install step ;)

With “install target”, do you mean dh_installdocs? In our debian/rules, we have now

# Make documentation only if needed.
ifneq "$(shell dh_listpackages | grep -- -doc)" ""
override_dh_installdocs:
cd doc && PYTHONPATH=$(abspath debian/python-kwant/usr/lib/python2.7/dist-packages) $(MAKE) html
	dh_installdocs
endif

This seems to work, but is this what you meant? Also, I have two questions:

• How to get rid of the explicit mention of python2.7?

• Is the “ifneq”-clause the proper way to ensure that documentation is only built for binary-indep?

I have one further more general question with regard to Debian packaging with pybuild. Pybuild deletes the *.egg-info directory but that directory is included in the tarball as made by “setup.py sdist”. (I am aware that some people consider that directory to be generated data, but this is debatable [1], and it’s standard practice to include it in the tarball anyway.) This has the consequence that after running “gbp buildpackage”, some files are missing and thus “gbp buildpackage” cannot be re-run without “git checkout .”. This situation is unsatisfactory. Is there a recommended solution?

The complete Debian packaging of our library is available in a git repository [2].

Thanks for any hints,
Christoph

[1] https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2092#comment:16
[2] http://git.kwant-project.org/debian-kwant/

Attachment: signature.asc
Description: PGP signature


Reply to: