[med-svn] r16359 - in trunk/packages/python-biom-format/trunk/debian: . patches

Timothy Booth tbooth-guest at moszumanska.debian.org
Fri Feb 28 16:30:29 UTC 2014


Author: tbooth-guest
Date: 2014-02-28 16:30:29 +0000 (Fri, 28 Feb 2014)
New Revision: 16359

Added:
   trunk/packages/python-biom-format/trunk/debian/docs
   trunk/packages/python-biom-format/trunk/debian/patches/
   trunk/packages/python-biom-format/trunk/debian/patches/deal_with_none_array_metadata
   trunk/packages/python-biom-format/trunk/debian/patches/ignore_local_dist-packages
   trunk/packages/python-biom-format/trunk/debian/patches/smart_arse_fix
Removed:
   trunk/packages/python-biom-format/trunk/debian/patches/enable_cython_beta.patch
Modified:
   trunk/packages/python-biom-format/trunk/debian/changelog
   trunk/packages/python-biom-format/trunk/debian/control
   trunk/packages/python-biom-format/trunk/debian/manpages
   trunk/packages/python-biom-format/trunk/debian/patches/series
   trunk/packages/python-biom-format/trunk/debian/rules
   trunk/packages/python-biom-format/trunk/debian/watch
Log:
Trying to get the the Bio-Linux and Debian packages in sync.  I think this does it.
The cython on Precise does build OK and passes the tests, so I've dropped the acceptable
version down to what is on Ubuntu, otherwise we need two different control files.


Modified: trunk/packages/python-biom-format/trunk/debian/changelog
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/changelog	2014-02-28 12:34:45 UTC (rev 16358)
+++ trunk/packages/python-biom-format/trunk/debian/changelog	2014-02-28 16:30:29 UTC (rev 16359)
@@ -1,3 +1,17 @@
+python-biom-format (1.2.0-1biolinux1) precise; urgency=low
+
+  * Add runtime dep on PyQi
+  * Patch /usr/bin/biom script to force /usr/lib/python2.7/dist-packages
+    to the top of the PYTHONPATH
+  * Allow building with cython 0.15.1 on Ubuntu as it builds and passes all
+    the tests
+  * Drop deal_with_none_array_metadata for now as it fails the self tests
+    But it's still not right!
+  * Rename add_metadata to something less generic.  It will die in the next
+    release anyway.
+
+ -- Tim Booth <tbooth at ceh.ac.uk>  Fri, 28 Feb 2014 16:25:41 +0000
+
 python-biom-format (1.2.0-1) unstable; urgency=low
 
   * New upstream version
@@ -12,6 +26,19 @@
 
  -- Andreas Tille <tille at debian.org>  Mon, 11 Nov 2013 09:24:46 +0100
 
+python-biom-format (1.2.0-0biolinux2) precise; urgency=low
+
+  * New upstream.
+  * No need for the old cythonize tinkering in rules
+  * Add examples to /usr/share/doc
+  * Also add HTML API docs (single html build)
+  * Build manpages from Sphinx
+  * Add bash completion
+  * Investigate and patch issue converting BIOM to table with
+    taxonomy not set to an array
+
+ -- Tim Booth <tbooth at ceh.ac.uk>  Wed, 25 Sep 2013 18:31:40 +0100
+
 python-biom-format (1.1.2-1) unstable; urgency=low
 
   * debian/watch:
@@ -27,8 +54,14 @@
 
  -- Andreas Tille <tille at debian.org>  Thu, 15 Aug 2013 01:17:43 +0200
 
-python-biom-format (1.0.0-1ubuntu1) precise; urgency=low
+python-biom-format (1.1.2-0ubuntu1) precise; urgency=low
 
+  * New upstream.  Repack no longer needed.
+
+ -- Tim Booth <tbooth at ceh.ac.uk>  Tue, 30 Apr 2013 18:09:17 +0100
+
+python-biom-format (1.0.0+repack-1ubuntu1) precise; urgency=low
+
   * Rebuild for Precise 
   * Minor changes to cleanup and get-orig-source that helped me
 

Modified: trunk/packages/python-biom-format/trunk/debian/control
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/control	2014-02-28 12:34:45 UTC (rev 16358)
+++ trunk/packages/python-biom-format/trunk/debian/control	2014-02-28 16:30:29 UTC (rev 16359)
@@ -6,12 +6,14 @@
 Build-Depends: debhelper (>= 9),
                python-all-dev,
                python-numpy,
-               cython (>= 0.17),
+               cython (>= 0.15.1-1ubuntu1),
                help2man,
                python-dateutil,
                python-cogent,
                pyqi,
-               python-nose
+               python-nose,
+               python-sphinx, 
+               bash-completion
 Standards-Version: 3.9.4
 Vcs-Browser: http://anonscm.debian.org/viewvc/debian-med/trunk/packages/python-biom-format/trunk/
 Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/python-biom-format/trunk/
@@ -23,6 +25,7 @@
 Depends: ${shlibs:Depends},
          ${python:Depends},
          ${misc:Depends},
+         ${js:Depends},
          python-dateutil,
          python-cogent,
          pyqi
@@ -46,4 +49,3 @@
  observations in this case again might correspond to SEED subsystems, and
  the counts would correspond to the number of times each subsystem is
  observed in each genome.
-

Added: trunk/packages/python-biom-format/trunk/debian/docs
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/docs	                        (rev 0)
+++ trunk/packages/python-biom-format/trunk/debian/docs	2014-02-28 16:30:29 UTC (rev 16359)
@@ -0,0 +1,2 @@
+examples
+doc/_build/singlehtml

Modified: trunk/packages/python-biom-format/trunk/debian/manpages
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/manpages	2014-02-28 12:34:45 UTC (rev 16358)
+++ trunk/packages/python-biom-format/trunk/debian/manpages	2014-02-28 16:30:29 UTC (rev 16359)
@@ -1 +1,2 @@
+doc/_build/man/*
 debian/*.1

Added: trunk/packages/python-biom-format/trunk/debian/patches/deal_with_none_array_metadata
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/patches/deal_with_none_array_metadata	                        (rev 0)
+++ trunk/packages/python-biom-format/trunk/debian/patches/deal_with_none_array_metadata	2014-02-28 16:30:29 UTC (rev 16359)
@@ -0,0 +1,17 @@
+Allow the conversion of BIOM to a table when the metadata is not held in an array.
+This is probably not the best fix as the BIOM is still corrupt.  Maybe should throw
+an error?
+--- a/python-code/biom/table.py
++++ b/python-code/biom/table.py
+@@ -352,8 +352,9 @@
+             str_obs_vals = delim.join(map(str, self._conv_to_np(obs_values)))
+ 
+             if header_key and self.ObservationMetadata is not None:
+-                md = self.ObservationMetadata[self._obs_index[obs_id]]
+-                md_out = metadata_formatter(md.get(header_key,None))
++                md = self.ObservationMetadata[self._obs_index[obs_id]].get(header_key,None)
++                if isinstance(md, basestring) : md = md,
++                md_out = metadata_formatter(md)
+                 output.append('%s%s%s\t%s' % (obs_id, delim, str_obs_vals, md_out))
+             else:
+                 output.append('%s%s%s' % (obs_id, delim, str_obs_vals))

Deleted: trunk/packages/python-biom-format/trunk/debian/patches/enable_cython_beta.patch
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/patches/enable_cython_beta.patch	2012-08-10 15:13:43 UTC (rev 12032)
+++ trunk/packages/python-biom-format/trunk/debian/patches/enable_cython_beta.patch	2014-02-28 16:30:29 UTC (rev 16359)
@@ -1,51 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Date: Sat, 28 Jul 2012 20:59:32 +0200
-Description: Work around broken cython that creates invalid gcc-4.7 code
- Problem: only cython >= 0.17~beta1 creates valid C++ code
- This patch cares for the following
-  - Enable building also with beta versions of Cython
-  - in case of to low Cython versions just install a copy
-    of the created C++ code from 0.17~beta
-
---- biom-format-1.0.0.orig/setup.py
-+++ biom-format-1.0.0/setup.py
-@@ -5,6 +5,7 @@
- from os.path import join, split
- from os import getcwd
- from glob import glob
-+from re import sub
- 
- __author__ = "Daniel McDonald"
- __copyright__ = "Copyright 2012, The BIOM Format"
-@@ -25,7 +26,7 @@
-     import Cython
-     from Cython.Distutils import build_ext
-     
--    cy_version = tuple(map(int, Cython.__version__.split('.')))
-+    cy_version = tuple(map(int, sub('beta', '0.', Cython.__version__).split('.')))
-     if cy_version >= (0, 14, 1):
-         cython_present = True
-     else:
-@@ -31,6 +31,10 @@
-         cython_present = True
-     else:
-         cython_present = False
-+    if  cy_version >= (0, 17, 0):
-+        cython_works_with_gcc47 = True
-+    else:
-+        cython_works_with_gcc47 = False
- except ImportError:
-     cython_present = False
- 
-@@ -52,7 +56,10 @@
- if cython_present:
-     from subprocess import Popen, PIPE
-     from os import system
--    system('cython %s/_sparsemat.pyx -o %s/_sparsemat.cpp --cplus' % (support_code_path, support_code_path))
-+    if cython_works_with_gcc47:
-+        system('cython %s/_sparsemat.pyx -o %s/_sparsemat.cpp --cplus' % (support_code_path, support_code_path))
-+    else:
-+        system('cp -a debian/cythonized-files/*.cpp %s' % (support_code_path))
- 
-     gcc_version = map(int, Popen('gcc -dumpversion', shell=True, stdout=PIPE).stdout.read().split('.'))
-     if gcc_version[0] == 4 and gcc_version[1] > 2:

Added: trunk/packages/python-biom-format/trunk/debian/patches/ignore_local_dist-packages
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/patches/ignore_local_dist-packages	                        (rev 0)
+++ trunk/packages/python-biom-format/trunk/debian/patches/ignore_local_dist-packages	2014-02-28 16:30:29 UTC (rev 16359)
@@ -0,0 +1,24 @@
+This patch allows biom to work even if there is an older installation of the biom
+libs in /usr/local/...
+Not sure if this is the neatest fix, but absolute_imports doesn't seem to be the full
+answer here as we have one module hooking in another, and probably looking for the
+default installed version is normally what you'd want.
+--- a/scripts/biom
++++ b/scripts/biom
+@@ -11,4 +11,6 @@
+ # __maintainer__ = "Greg Caporaso"
+ # __email__ = "gregcaporaso at gmail.com"
+ 
++export PYTHONPATH=/usr/lib/python`python --version 2>&1 | grep -o '[1-9]\.[0-9]\+'`/dist-packages
++
+ exec pyqi --driver-name biom --command-config-module biom.interfaces.optparse.config -- "$@"
+--- a/python-code/biom/__init__.py
++++ b/python-code/biom/__init__.py
+@@ -1,5 +1,7 @@
+ #!/usr/bin/env python
+ 
++from __future__ import absolute_import
++
+ __author__ = "Daniel McDonald"
+ __copyright__ = "Copyright 2012, BIOM-Format Project"
+ __credits__ = ["Daniel McDonald", "Jai Ram Rideout", "Greg Caporaso", 

Modified: trunk/packages/python-biom-format/trunk/debian/patches/series
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/patches/series	2012-08-10 15:13:43 UTC (rev 12032)
+++ trunk/packages/python-biom-format/trunk/debian/patches/series	2014-02-28 16:30:29 UTC (rev 16359)
@@ -1 +1,3 @@
-enable_cython_beta.patch
+#deal_with_none_array_metadata
+smart_arse_fix
+ignore_local_dist-packages

Added: trunk/packages/python-biom-format/trunk/debian/patches/smart_arse_fix
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/patches/smart_arse_fix	                        (rev 0)
+++ trunk/packages/python-biom-format/trunk/debian/patches/smart_arse_fix	2014-02-28 16:30:29 UTC (rev 16359)
@@ -0,0 +1,17 @@
+--- a/python-code/biom/table.py
++++ b/python-code/biom/table.py
+@@ -332,12 +332,8 @@
+ 
+         samp_ids = delim.join(map(str, self.SampleIds))
+ 
+-        # 17 hrs of straight programming later...
+-        if header_key is not None:
+-            if header_value is None:
+-                raise TableException, "You need to specify both header_key and header_value"
+-        if header_value is not None:
+-            if header_key is None:
++        # If h_key xor h_value is set we have a problem...
++        if (header_key is None) != (header_value is None):
+                 raise TableException, "You need to specify both header_key and header_value"
+ 
+         if header_value:

Modified: trunk/packages/python-biom-format/trunk/debian/rules
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/rules	2014-02-28 12:34:45 UTC (rev 16358)
+++ trunk/packages/python-biom-format/trunk/debian/rules	2014-02-28 16:30:29 UTC (rev 16359)
@@ -16,22 +16,41 @@
 pybuilddir := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)-$(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
 
 %:
-	dh $@ --with python2 # ,sphinxdoc
+	dh $@ --with python2
 
-manpages:
-	debian/create-manpages
+override_dh_auto_build:
+	dh_auto_build
+	cd doc && make man singlehtml
+	env PYTHONPATH="`pwd`/python-code"  pyqi make-bash-completion \
+	    --command-config-module biom.interfaces.optparse.config \
+	    --driver-name biom -o debian/bash-completion
 
 override_dh_auto_clean:
 	rm -rf build/tests
 	dh_auto_clean
-	find -name "._*" -exec rm -f '{}' ';'  #Needed if you try to build from pristine tarball
-	rm -rf python-code/support-code/_sparsemat.cpp
+	find -name "._*" -delete  #Remove any Mac metadata files
+	cd doc && make clean
+	rm -f debian/bash-completion
+	rm -f python-code/support-code/_*.cpp
 
 override_dh_install:
 	dh_install
+	dh_bash-completion
+	# These commands are deprecated but in the upstream they are still present
 	# remove language extension
 	rename 's/\.py$$//;' $(bindir)/*
+	# give one binary a less generic name
+	mv $(bindir)/add_metadata $(bindir)/add_biom_metadata 
 
+override_dh_installdocs:
+	dh_installdocs
+	# Replace jquery.js and underscore.js with symlink, and fail if no file found
+	for jq in jquery underscore ; do \
+	    find debian/$(pkg) -name $$jq.js -print \
+	        -exec ln -sf /usr/share/javascript/$$jq/$$jq.js '{}' ';' | grep -q . ;\
+	done
+	echo "js:Depends=libjs-jquery,libjs-underscore" >> debian/$(pkg).substvars
+
 override_dh_installman:
 	dh_installman
 	# try to create man pages whereever possible
@@ -39,7 +58,7 @@
 	export PYTHONPATH=$(CURDIR)/python-code ; \
 	    help2man --no-info --version-string="$(version)" \
 		 --name="Script to add sample and/or observation metadata to BIOM-formatted files." \
-		$(bindir)/add_metadata > $(mandir)/add_metadata.1 ; \
+		$(bindir)/add_biom_metadata > $(mandir)/add_biom_metadata.1 ; \
 	    help2man --no-info --version-string="$(version)" \
 		--name='Test a biom file for adherence to the format specification' \
 		$(bindir)/biom_validator > $(mandir)/biom_validator.1 ; \

Modified: trunk/packages/python-biom-format/trunk/debian/watch
===================================================================
--- trunk/packages/python-biom-format/trunk/debian/watch	2014-02-28 12:34:45 UTC (rev 16358)
+++ trunk/packages/python-biom-format/trunk/debian/watch	2014-02-28 16:30:29 UTC (rev 16359)
@@ -1,3 +1,3 @@
 version=3
 opts=dversionmangle=s/\+dfsg[0-9]*// \
-   http://biom-format.org/ ftp://thebeast.colorado.edu/pub/biom-format-releases/biom-format-([\d.]+)\.tar\.gz
+   http://biom-format.org/ ftp://thebeast.colorado.edu/pub/biom-format-releases/biom-format-([\d.]+)\.(?:tar\.gz|tgz)




More information about the debian-med-commit mailing list