Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #7759

Re: pybuild sphinxdoc and extensions

From Christoph Groth <christoph@grothesque.org>
Newsgroups linux.debian.maint.python
Subject Re: pybuild sphinxdoc and extensions
Date 2015-10-22 16:20 +0200
Message-ID <qmoSJ-4U2-3@gated-at.bofh.it> (permalink)
References <n3Z3k-4ZZ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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/

Back to linux.debian.maint.python | Previous | NextNext in thread | Find similar


Thread

Re: pybuild sphinxdoc and extensions Christoph Groth <christoph@grothesque.org> - 2015-10-22 16:20 +0200
  Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2015-10-23 10:40 +0200
    Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2015-10-23 16:10 +0200
      Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2015-10-23 16:20 +0200
        Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2015-10-23 16:30 +0200
          Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2015-10-23 17:10 +0200
            Re: pybuild sphinxdoc and extensions Christoph Groth <christoph@grothesque.org> - 2016-02-25 22:40 +0100
              Re: pybuild sphinxdoc and extensions Piotr Ożarowski <piotr@debian.org> - 2016-02-25 23:20 +0100
                Re: pybuild sphinxdoc and extensions Christoph Groth <christoph@grothesque.org> - 2016-02-27 21:40 +0100
          Re: pybuild sphinxdoc and extensions Dimitri John Ledkov <xnox@debian.org> - 2015-10-23 17:50 +0200
            Re: pybuild sphinxdoc and extensions "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca> - 2015-10-23 19:50 +0200

csiph-web