On Feb 02, 2012, at 01:12 PM, Jakub Wilk wrote: >* Barry Warsaw <[email protected]>, 2012-01-30, 18:32: >>This patch updates the python-wadllib package in several ways: >> >> * Updates to 1.3.0, the latest available upstream. >> * Adds packaging support for Python 3 since upstream now supports it >> * Enable the test suite during build. >> * Switch to dh_python2 and dh_python3. > >Eh, switch from what? :)
I must have gotten this one mixed up with another package. ;) I'll have an updated patch soon, thanks for the review. >> * Simplify debian/rules > >I don't see any simplifications. :) Yeah, ignore this. >> %: >>- dh $@ --with python2 --buildsystem=python_distutils >>+ dh $@ --with python2,python3 > >This drops --buildsystem=python_distutils, which is probably safe, but worth >mentioning in the changelog. Will do. >>+ >>+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) >>+test-python%: >>+ python$* setup.py test -vv >>+ >>+override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%) >>+endif > >This makes the package FTBFS: >| python2.7 setup.py test -vv >| running test >| Checking .pth file support in . >| /usr/bin/python2.7 -E -c pass >| Searching for lazr.uri >| Reading http://pypi.python.org/simple/lazr.uri/ Yep, python-lazr.uri and python3-lazr.uri need to be added to B-D. Yes, it really sucks that distribute can't be told to never download. >| Download error on http://pypi.python.org/simple/lazr.uri/: [Errno -2] Name >or service not known -- Some packages may not be found! >| Reading http://pypi.python.org/simple/lazr.uri/ >| Download error on http://pypi.python.org/simple/lazr.uri/: [Errno -2] Name >or service not known -- Some packages may not be found! >| Couldn't find index page for 'lazr.uri' (maybe misspelled?) >| Scanning index of all packages (this may take a while) >| Reading http://pypi.python.org/simple/ >| Download error on http://pypi.python.org/simple/: [Errno -2] Name or service >not known -- Some packages may not be found! >| No local packages or download links found for lazr.uri >| error: Could not find suitable distribution for Requirement.parse('lazr.uri') >| make[1]: *** [test-python2.7] Error 1 >| make[1]: Leaving directory >`/build/python-wadllib-ODBkVO/python-wadllib-1.3.0' >| make: *** [build] Error 2 > >(Kudos to iptables for saving me from accidentally running untrusted code...) Yes, and if you don't have this in your build environment, it can be a very tough problem to catch. I don't know if there's anything we can do about it other than be vigilant. This problem will definitely ftbfs when uploaded to Ubuntu or a PPA, so it does get caught there, but local testing in a Debian pbuilder or sbuild environment can fairly easily hide this bug. The fix is easy though: add the package to the B-D. >>+ >>+override_dh_auto_build: >>+ dh_auto_build >>+ set -ex; for py in $(PYTHON3) ; do \ >>+ python$$py setup.py build; \ >>+ done; > >Out of interest, is there are reason you use %-rules for running tests, but >"for" loops for building? It looks a bit inconsistent to me. I thought about this comment, and I agree. The next version of the patch will use %-rules, and I think I'm going to retrofit that back into the packages I maintain. I am still planning on putting together a style guide, and I think I'll describe the %-rules way instead of the loop way. >>+ # Debian bug #618367 >>+ rm -rf debian/*/usr/lib/python*/*-packages/wadllib.egg-info > >It's non-obvious to me what this is for, even after reading #618367. Certainly >it should be explained in the changelog. > >Also, isn't it no-op? I don't see any directory like this created by the >build process. Yes, ignore this. It's another cargo cult. >>+override_dh_auto_clean: >>+ dh_auto_clean >>+ rm -rf *.egg-info > >The clean target is incomplete. The package FTBFS if built twice in a row: Right. The build/ directory needs to be deleted too, but in wadllib's case that's still not quite enough, as you noticed below. >| dpkg-source -b wadllib-1.3.0 >| dpkg-source: info: using source format `3.0 (quilt)' >| dpkg-source: info: building python-wadllib using existing >./python-wadllib_1.3.0.orig.tar.gz >| dpkg-source: warning: newly created empty file >'build/lib/wadllib/tests/data/__init__.py' will not be represented in diff >| dpkg-source: info: local changes detected, the modified files are: >| wadllib-1.3.0/build/lib/wadllib/__init__.py >| wadllib-1.3.0/build/lib/wadllib/application.py >| wadllib-1.3.0/build/lib/wadllib/iso_strptime.py >| wadllib-1.3.0/build/lib/wadllib/tests/__init__.py >| wadllib-1.3.0/build/lib/wadllib/tests/test_docs.py >| wadllib-1.3.0/src/wadllib.egg-info/PKG-INFO >| wadllib-1.3.0/src/wadllib.egg-info/SOURCES.txt >| dpkg-source: info: you can integrate the local changes with dpkg-source >--commit > >(Admittedly, the current version also has this problem, but your patch makes >it even worse.) The problem is that PKG-INFO and SOURCES.txt get changed during the build process, and the upstream comes with src/wadllib.egg-info. I'm not quite sure what the fix is for that, but at least getting rid of the build directory doesn't make it worse. Updated patch to follow. Cheers.
signature.asc
Description: PGP signature

