spotify / dh-virtualenv

Python virtualenvs in Debian packages

Home Page:http://dh-virtualenv.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depend on dh-exec and python-sphinx-rtd-theme for dh-virtualenv builds

labeneator opened this issue · comments

On a Debian stretch box (recently upgraded from Jessie), attempting to build the dh-virtualenv package (commit: 3db71ee) results in an error due to a missing dependency.

 ✘ ⚙ ~/dh-virtualenv 
 ❯ dpkg-buildpackage -b
....
....

doc/dh_virtualenv.1: No such file or directory at /usr/bin/dh_installman line 131.
debian/rules:4: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

apt-cache search suggests that we should add dh-exec to provide the missing package


 ✘ ⚙ ~/dh-virtualenv 
 ❯ apt-cache search dh_installman                                                                                                                                                                    [16:03:42]
dh-exec - Scripts to help with executable debhelper files

A further attempt to build after installing dh-exec results in another error

Running Sphinx v1.4.9
Traceback (most recent call last):
  File "setup.py", line 52, in <module>
    setup(**project)
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/sphinx/setup_command.py", line 161, in run
    freshenv=self.fresh_env)
  File "/usr/lib/python2.7/dist-packages/sphinx/application.py", line 137, in __init__
    confoverrides or {}, self.tags)
  File "/usr/lib/python2.7/dist-packages/sphinx/config.py", line 287, in __init__
    execfile_(filename, config)
  File "/usr/lib/python2.7/dist-packages/sphinx/util/pycompat.py", line 130, in execfile_
    exec_(code, _globals)
  File "/usr/lib/python2.7/dist-packages/six.py", line 699, in exec_
    exec("""exec _code_ in _globs_, _locs_""")
  File "<string>", line 1, in <module>
  File "conf.py", line 26, in <module>
ImportError: No module named sphinx_rtd_theme
debian/rules:17: recipe for target 'override_dh_installdocs' failed
make[1]: *** [override_dh_installdocs] Error 1
make[1]: Leaving directory '/home/lmwangi/dh-virtualenv'
debian/rules:4: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

Installing python-sphinx-rtd-theme fixes this issue and results in a successful build. Would you like a quick PR to fix these issues?

Cheers,
Laban

Makes sense as a Build-Depends, and please check those packages are also available in oldstable / Xenial / …. (but I think they are)

Good catch!

I'm (for real now) planning to do 1.1 release. Maybe you can drop the PR in before that, as I'd assume this wouldn't build for Debian unstable if this is the case.

Distribution Support:

dh-exec

python-sphinx-rtd-theme

If we make these changes, we may break folks running wheezy/trusty due to a build depend on python-sphinx-rtd-theme. However, given that these are outdated LTS distros, we may take that risk...?

Created PR #231

Add a comment in the control file regarding those two packages for older distros, then at least people able to read won't search ages for a solution. If you run old stuff, a little pain is common… 👴 👵

Or point to this ticket.

Added a comment in the control file. Test build on my box check out.

Hint for @nailor or anyone else interested: it's quite easy to write a test script that builds a project on all the major target platforms in docker. Which then makes it easy to spot regressions.

@jhermann Yeah, that's a good tip. Will look into it. PR looks fine, just had a small comment there

@nailor, sorry about that. Just updated the PR with a better comment; that also references this issue page. Please have a look at the PR again.

Thanks for your PR, it is now merged!

Oh and inspired by @jhermann I now got a test build setup for docker in a branch (needs some travis love).

For those eager to try:

docker-compose -f test/docker/docker-compose.yml --project-directory=. build 
docker-compose -f test/docker/docker-compose.yml --project-directory=. run test

Currently only makes sure the build succeeds on sid, which I think is a good starting point.