[Python-modules-commits] r22581 - in packages/logilab-common/trunk/debian (3 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Mon Aug 27 19:03:55 UTC 2012


    Date: Monday, August 27, 2012 @ 19:03:53
  Author: morph
Revision: 22581

provide Python 3 package; Closes: #606144

Modified:
  packages/logilab-common/trunk/debian/changelog
  packages/logilab-common/trunk/debian/control
  packages/logilab-common/trunk/debian/rules

Modified: packages/logilab-common/trunk/debian/changelog
===================================================================
--- packages/logilab-common/trunk/debian/changelog	2012-08-26 19:30:07 UTC (rev 22580)
+++ packages/logilab-common/trunk/debian/changelog	2012-08-27 19:03:53 UTC (rev 22581)
@@ -2,8 +2,9 @@
 
   * debian/{control, rules}
     - switch to dh sequencer
+    - provide Python 3 package; Closes: #606144
 
- -- Sandro Tosi <morph at debian.org>  Tue, 21 Aug 2012 18:06:15 +0200
+ -- Sandro Tosi <morph at debian.org>  Mon, 27 Aug 2012 13:13:04 +0200
 
 logilab-common (0.58.2-1) experimental; urgency=low
 

Modified: packages/logilab-common/trunk/debian/control
===================================================================
--- packages/logilab-common/trunk/debian/control	2012-08-26 19:30:07 UTC (rev 22580)
+++ packages/logilab-common/trunk/debian/control	2012-08-27 19:03:53 UTC (rev 22581)
@@ -3,9 +3,10 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: Julien Jehannet <julien.jehannet at logilab.fr>, Sandro Tosi <morph at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), python (>= 2.5.3-1~)
+Build-Depends: debhelper (>= 7.0.50~), python (>= 2.5.3-1~), python3-all
 Build-Depends-Indep: python-support, python-epydoc, graphviz, python-egenix-mxdatetime, python-unittest2
 XS-Python-Version: all
+X-Python3-Version: >= 3.2
 Standards-Version: 3.9.3
 Homepage: http://www.logilab.org/project/logilab-common
 Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/logilab-common/trunk/
@@ -32,3 +33,26 @@
   * generating text and HTML reports
   * logging
   * parsing XML processing instructions
+
+Package: python3-logilab-common
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}
+#Recommends: python-egenix-mxdatetime
+#Suggests: pyro, python-unittest2
+Description: useful miscellaneous modules used by Logilab projects (Python3)
+ logilab-common is a collection of low-level Python packages and modules,
+ designed to ease:
+ .
+  * handling command line options and configuration files
+  * writing interactive command line tools
+  * manipulation files and character strings
+  * interfacing to OmniORB
+  * generating SQL queries
+  * running unit tests
+  * manipulating tree structures
+  * accessing RDBMS (currently postgreSQL, MySQL and sqlite)
+  * generating text and HTML reports
+  * logging
+  * parsing XML processing instructions
+ .
+ This package contains the Python 3 version of logilab-common.

Modified: packages/logilab-common/trunk/debian/rules
===================================================================
--- packages/logilab-common/trunk/debian/rules	2012-08-26 19:30:07 UTC (rev 22580)
+++ packages/logilab-common/trunk/debian/rules	2012-08-27 19:03:53 UTC (rev 22581)
@@ -5,40 +5,56 @@
 
 include /usr/share/python/python.mk
 
-# Python default version number
-PYDEF := $(shell pyversions -d -v)
+# Python default library and script directories
+LIB := $(shell python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_purelib")
+SCRIPT := $(shell python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_scripts")
+LIB3 := $(shell python3 -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)")
+SCRIPT3 := $(shell python3 -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_scripts)")
 
 %:
-	dh $@
+	dh $@ --with python3
 
 override_dh_auto_build:
 	# python module build
-	NO_SETUPTOOLS=1 python setup.py -q build --build-purelib build/lib
+	NO_SETUPTOOLS=1 python setup.py build
+	NO_SETUPTOOLS=1 python3 setup.py build
 
 	# we need this hack because we have to import "logilab.common.pytest"
 	# and for doc generation, but since it's a namespace package,
 	# we need to "simulate" it
-	touch $(CURDIR)/build/lib/logilab/__init__.py
+	touch $(CURDIR)/$(LIB)/logilab/__init__.py
 
 	# build doc
 	$(MAKE) -C doc
 
 	# remove dummy file
-	rm -f $(CURDIR)/build/lib/logilab/__init__.py
+	rm -f $(CURDIR)/$(LIB)/logilab/__init__.py
 
 override_dh_auto_test:
 ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
 	# we need this hack because we have to import "logilab.common.pytest"
 	# and for doc generation, but since it's a namespace package,
 	# we need to "simulate" it
-	touch $(CURDIR)/build/lib/logilab/__init__.py
+	touch $(CURDIR)/$(LIB)/logilab/__init__.py
+	touch $(CURDIR)/$(LIB3)/logilab/__init__.py
+	# we need also the data subdir, so we link it (backing off the old dir first)
+	mv $(CURDIR)/$(LIB)/logilab/common/test/data $(CURDIR)/$(LIB)/logilab/common/test/data2
+	ln -s $(CURDIR)/test/data $(CURDIR)/$(LIB)/logilab/common/test/
+	mv $(CURDIR)/$(LIB3)/logilab/common/test/data $(CURDIR)/$(LIB3)/logilab/common/test/data2
+	ln -s $(CURDIR)/test/data $(CURDIR)/$(LIB3)/logilab/common/test/
 
 	# run tests
 	# use the default python version to select the script dir to run the tests
-	PYTHONPATH=$(CURDIR)/build/lib/ $(CURDIR)/build/scripts-$(PYDEF)/pytest -t test
+	PYTHONPATH=$(CURDIR)/$(LIB)/ $(CURDIR)/$(SCRIPT)/pytest -t $(CURDIR)/$(LIB)/logilab/common/test
+	-PYTHONPATH=$(CURDIR)/$(LIB3)/ $(CURDIR)/$(SCRIPT3)/pytest -t $(CURDIR)/$(LIB3)//logilab/common/test
 
 	# remove dummy file
-	rm -f $(CURDIR)/build/lib/logilab/__init__.py
+	rm -f $(CURDIR)/$(LIB)/logilab/__init__.py
+	rm -f $(CURDIR)/$(LIB3)/logilab/__init__.py
+	# and link to data dir
+	rm -f $(CURDIR)/$(LIB)/logilab/common/test/data $(CURDIR)/$(LIB3)/logilab/common/test/data
+	mv $(CURDIR)/$(LIB)/logilab/common/test/data2 $(CURDIR)/$(LIB)/logilab/common/test/data
+	mv $(CURDIR)/$(LIB3)/logilab/common/test/data2 $(CURDIR)/$(LIB3)/logilab/common/test/data
 endif
 
 override_dh_auto_clean:
@@ -46,17 +62,26 @@
 	$(MAKE) -C doc clean
 
 	NO_SETUPTOOLS=1 python setup.py clean
+	NO_SETUPTOOLS=1 python3 setup.py clean
 
 	find . -name "*.pyc" -delete
 
 	dh_clean
 
 override_dh_auto_install: build
-	NO_SETUPTOOLS=1 python setup.py -q install --no-compile \
+	NO_SETUPTOOLS=1 python setup.py install --no-compile \
 		--root=$(CURDIR)/debian/python-logilab-common/ \
 		${py_setup_install_args}
+	NO_SETUPTOOLS=1 python3 setup.py install --no-compile \
+		--root=$(CURDIR)/debian/python3-logilab-common/ \
+		${py_setup_install_args}
+	# move pytest to pytest3 for py3k package
+	mv debian/python3-logilab-common/usr/bin/pytest debian/python3-logilab-common/usr/bin/pytest3
+	# remove __pycache__ dirs
+	find $(CURDIR)/debian/python3-logilab-common -type d -name "__pycache__" | xargs rm -rf
 	# remove test directory
 	rm -rf debian/python-logilab-common/usr/lib/python*/*-packages/logilab/common/test
+	rm -rf debian/python3-logilab-common/usr/lib/python*/*-packages/logilab/common/test
 
 override_dh_installchangelogs:
 	dh_installchangelogs	ChangeLog
@@ -64,5 +89,12 @@
 override_dh_installdocs:
 	dh_installdocs		README doc/apidoc/
 
+override_dh_installman:
+	dh_installman
+	# install the manpage for the py3k package
+	cp doc/pytest.1 doc/pytest3.1
+	dh_installman -p python3-logilab-common doc/pytest3.1
+	rm doc/pytest3.1
+
 override_dh_compress:
 	dh_compress		-X.py -X.ini -X.xml -Xtest/ -Xapidoc/




More information about the Python-modules-commits mailing list