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

dh_python2 namespace issue ?



Hello,

while preparing one of our package (pyfai), we endup with an FTBFS due to 
backports.functools_lru_cache [1].

here the backtrace

Traceback (most recent call last):
  File "./run_tests.py", line 543, in <module>
    unittest.defaultTestLoader.loadTestsFromNames(options.test_name))
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 115, in loadTestsFromName
    test = obj()
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/test/__init__.py", line 50, in suite
    from . import test_all
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/test/test_all.py", line 50, in <module>
    from . import test_peak_picking
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/test/test_peak_picking.py", line 48, in <module>
    from ..gui.peak_picker import PeakPicker
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/gui/peak_picker.py", line 59, in <module>
    from .utils import update_fig, maximize_fig
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/gui/utils/__init__.py", line 41, in <module>
    from .. import matplotlib
  File "/<<BUILDDIR>>/pyfai-0.17.0+dfsg1/.pybuild/cpython2_2.7_pyfai/build/pyFAI/gui/matplotlib.py", line 48, in <module>
    import matplotlib
  File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 130, in <module>
    from matplotlib.rcsetup import defaultParams, validate_backend, cycler
  File "/usr/lib/python2.7/dist-packages/matplotlib/rcsetup.py", line 29, in <module>
    from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  File "/usr/lib/python2.7/dist-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
    from backports.functools_lru_cache import lru_cache
ImportError: No module named backports.functools_lru_cache


so we tried in a clean chroot, a simple

import backports.functools_lru_cache

which end-up with

~# python -c "import backports.functools_lru_cache; print backports.functools_lru_cache"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named backports.functools_lru_cache

If we add an __init__.py file under

(unstable-amd64-sbuild)root@diffabs6:/usr/lib/python2.7/dist-packages/backports# touch __init__.py

then it works

# python -c "import backports.functools_lru_cache; print backports.functools_lru_cache"
<module 'backports.functools_lru_cache' from '/usr/lib/python2.7/dist-packages/backports/functools_lru_cache.pyc'>


So the question is: who is in charge of this __init__.py file ?

if I look in the rules[2] file of backports.fucntools... package we can see this:

override_dh_auto_install:
	dh_auto_install
	rm -rf $(CURDIR)/debian/*/usr/lib/python2.7/dist-packages/backports/__init__.py

override_dh_python2:
	dh_python2 --namespace backports


the changelog[3][4] is even more explicite, explaining that dh_python2 is now in charge of the backports namespace.

Is there  a bug in the dh_python2 namespace machinery or in the  backports.func... package ?

thanks for your attention.

Frédéric

[1] https://tracker.debian.org/pkg/backports.functools-lru-cache
[2] https://tracker.debian.org/media/packages/b/backports.functools-lru-cache/rules-1.5-1
[3] https://tracker.debian.org/media/packages/b/backports.functools-lru-cache/changelog-1.5-1
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884690

Reply to: