Re: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam
* Andreas Tille , 2014-02-20, 18:04: dh_auto_test chmod a+x tests/pysam_test_offline.py set -e -x;\ for pyv in `pyversions -dv` ; do \ cd tests && env PYTHONPATH=/«PKGBUILDDIR»/build/lib.«ARCH»-${pyv} ./pysam_test_offline.py ; \ done + pyversions -dv + cd tests + env PYTHONPATH=/«PKGBUILDDIR»/build/lib.«ARCH»-2.7 ./pysam_test_offline.py Traceback (most recent call last): File "./pysam_test_offline.py", line 8, in import pysam ImportError: No module named pysam make[1]: *** [override_dh_auto_test] Error 1 make[1]: Leaving directory `/«PKGBUILDDIR»' make: *** [build-arch] Error 2 Obfuscated build logs are not very helpful. :| Here's an actual build log snippet for i386: | dh_auto_build | running build | running build_py | creating build | creating build/lib.linux-i686-2.7 | creating build/lib.linux-i686-2.7/pysam [...] | + env PYTHONPATH=/build/python-pysam-fLMqAQ/python-pysam-0.7.5/build/lib.linux-i486-2.7 ./pysam_test_offline.py | Traceback (most recent call last): | File "./pysam_test_offline.py", line 8, in | import pysam | ImportError: No module named pysam | make[1]: *** [override_dh_auto_test] Error 1 So setup.py installed stuff to "build/lib.linux-i686-2.7", but PYTHONPATH is set to "build/lib.linux-i486-2.7". /usr/share/python/python.mk defines a macro for determining build directory. You might want to use it. :) -- Jakub Wilk -- To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20140220174400.ga9...@jwilk.net
Re: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam
Hi Jacub, On Thu, Feb 20, 2014 at 06:44:00PM +0100, Jakub Wilk wrote: > | running build > | running build_py > | creating build > | creating build/lib.linux-i686-2.7 > | creating build/lib.linux-i686-2.7/pysam > [...] > | + env > PYTHONPATH=/build/python-pysam-fLMqAQ/python-pysam-0.7.5/build/lib.linux-i486-2.7 > ./pysam_test_offline.py > | Traceback (most recent call last): > | File "./pysam_test_offline.py", line 8, in > | import pysam > | ImportError: No module named pysam > | make[1]: *** [override_dh_auto_test] Error 1 > > So setup.py installed stuff to "build/lib.linux-i686-2.7", but > PYTHONPATH is set to "build/lib.linux-i486-2.7". I think I understood the problem ... > /usr/share/python/python.mk defines a macro for determining build > directory. You might want to use it. :) ... but not the suggested solution. I tried: $ git diff debian/rules diff --git a/debian/rules b/debian/rules index 50d4cad..073f3b1 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,8 @@ export PYBUILD_NAME=pysam DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}') TESTPKG:= $(DEBPKGNAME)-tests -pybuilddir := $(CURDIR)/build/lib.$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)-$(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) + +include /usr/share/python/python.mk %: dh $@ --with python2 @@ -38,7 +39,7 @@ override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) set -e -x;\ for pyv in `pyversions -dv` ; do \ - cd tests && env PYTHONPATH=$(pybuilddir)-$${pyv} ./pysam_test_offline.py ; \ + cd tests && env PYTHONPATH=$(py_builddir) ./pysam_test_offline.py ; \ done endif which leads to: dh_auto_test chmod a+x tests/pysam_test_offline.py set -e -x;\ for pyv in `pyversions -dv` ; do \ cd tests && env PYTHONPATH=build/lib.linux-x86_64-2.7 ./pysam_test_offline.py ; \ done + pyversions -dv + cd tests + env PYTHONPATH=build/lib.linux-x86_64-2.7 ./pysam_test_offline.py Traceback (most recent call last): File "./pysam_test_offline.py", line 8, in import pysam ImportError: No module named pysam So how exactly do you want me to use a variable from /usr/share/python/python.mk? Kind regards Andreas. -- http://fam-tille.de -- To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20140220182445.gd17...@an3as.eu
Re: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam
/me continues promoting pybuild: -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 diff --git a/debian/control b/debian/control index 8699486..c9acaaf 100644 --- a/debian/control +++ b/debian/control @@ -6,6 +6,7 @@ Section: python XS-Testsuite: autopkgtest Priority: optional Build-Depends: debhelper (>= 9), + dh-python, python-all-dev, python-setuptools, cython, diff --git a/debian/rules b/debian/rules index 50d4cad..aaf270f 100755 --- a/debian/rules +++ b/debian/rules @@ -1,19 +1,12 @@ #!/usr/bin/make -f -# Hint: -# https://wiki.debian.org/Python/LibraryStyleGuide -# suggests: export PYBUILD_NAME=pysam -# which probably does not harm but due to the fact that there is -# some additional binary package a debian/python-pysam.install -# file is definitely needed. DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}') TESTPKG:= $(DEBPKGNAME)-tests -pybuilddir := $(CURDIR)/build/lib.$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)-$(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) %: - dh $@ --with python2 + dh $@ --with python2 --buildsystem=pybuild # Cython is recreating some c-files. To enable building twice in a row these # will be saved in advance and restored afterwards @@ -33,14 +26,10 @@ override_dh_auto_build: debian/savefiles dh_auto_build override_dh_auto_test: - dh_auto_test - chmod a+x tests/pysam_test_offline.py -ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - set -e -x;\ - for pyv in `pyversions -dv` ; do \ - cd tests && env PYTHONPATH=$(pybuilddir)-$${pyv} ./pysam_test_offline.py ; \ - done -endif + dh_auto_test # default tests + PYBUILD_SYSTEM=custom \ + PYBUILD_TEST_ARGS="cd tests && PYTHONPATH={build_dir} {interpreter} ./pysam_test_offline.py" \ + dh_auto_test --buildsystem=pybuild override_dh_install-indep: dh_install -p $(TESTPKG)
Re: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam
Hi Piotr, On Fri, Feb 21, 2014 at 02:42:37PM +0100, Piotr Ożarowski wrote: > /me continues promoting pybuild: Thanks for this nice promotion demo - it worked nicely. Thanks for the patch Andreas. PS: What is the best place to read about this in the first place. -- http://fam-tille.de -- To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20140224210735.gf5...@an3as.eu
Re: [Help] Bug#739631: python-pysam: FTBFS: ImportError: No module named pysam
[Andreas Tille, 2014-02-24] > PS: What is the best place to read about this in the first place. pybuild manpage (also available online¹) or this mailing list (for example in this² thread) [¹] http://deb.li/pybuild [²] https://lists.debian.org/debian-python/2013/01/msg9.html) -- Piotr Ożarowski Debian GNU/Linux Developer www.ozarowski.pl www.griffith.cc www.debian.org GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645 -- To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20140225092734.ga28...@sts0.p1otr.com