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

morph at users.alioth.debian.org morph at users.alioth.debian.org
Sat Sep 1 19:41:16 UTC 2012


    Date: Saturday, September 1, 2012 @ 19:41:15
  Author: morph
Revision: 22629

provide Python 3 package; Closes: #606146

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

Modified: packages/logilab-astng/trunk/debian/changelog
===================================================================
--- packages/logilab-astng/trunk/debian/changelog	2012-09-01 14:03:34 UTC (rev 22628)
+++ packages/logilab-astng/trunk/debian/changelog	2012-09-01 19:41:15 UTC (rev 22629)
@@ -2,10 +2,11 @@
 
   * debian/{control, rules}
     - switch to dh sequencer
+    - provide Python 3 package; Closes: #606146
   * debian/source/format
     - switch to 3.0 (quilt) source format
 
- -- Sandro Tosi <morph at debian.org>  Sat, 01 Sep 2012 16:02:53 +0200
+ -- Sandro Tosi <morph at debian.org>  Sat, 01 Sep 2012 21:40:39 +0200
 
 logilab-astng (0.24.0-1) experimental; urgency=low
 

Modified: packages/logilab-astng/trunk/debian/control
===================================================================
--- packages/logilab-astng/trunk/debian/control	2012-09-01 14:03:34 UTC (rev 22628)
+++ packages/logilab-astng/trunk/debian/control	2012-09-01 19:41:15 UTC (rev 22629)
@@ -3,9 +3,10 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: Alexandre Fayolle <afayolle at debian.org>, Sandro Tosi <morph at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), python-all (>= 2.5.4-1~), python-logilab-common, python-unittest2
+Build-Depends: debhelper (>= 7.0.50~), python-all (>= 2.5.4-1~), python3-all, python-logilab-common, python3-logilab-common, python-unittest2
 Build-Depends-Indep: python-support
 XS-Python-Version: all
+X-Python3-Version: >= 3.2
 Standards-Version: 3.9.3
 Homepage: http://www.logilab.org/project/logilab-astng
 Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/logilab-astng/trunk/
@@ -27,3 +28,22 @@
  usages. They include some support for static inference and local name
  scopes. Furthermore, astng builds partial trees by inspecting living
  objects.
+
+Package: python3-logilab-astng
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}, python3-logilab-common (>= 0.53.0)
+Description: rebuild a new abstract syntax tree (AST) from Python's ast (Python3)
+ The aim of this module is to provide a common base representation of
+ Python source code for projects such as pychecker, pyreverse, pylint.
+ .
+ It provides a compatible representation which comes from the `_ast`
+ module.
+ .
+ It rebuilds the generated tree by recursively walking down the AST
+ and building an extended ast (let's call it astng ;). The new node
+ classes have additional methods and attributes for different
+ usages. They include some support for static inference and local name
+ scopes. Furthermore, astng builds partial trees by inspecting living
+ objects.
+ .
+ This package contains the Python 3 version of logilab.astng.

Modified: packages/logilab-astng/trunk/debian/rules
===================================================================
--- packages/logilab-astng/trunk/debian/rules	2012-09-01 14:03:34 UTC (rev 22628)
+++ packages/logilab-astng/trunk/debian/rules	2012-09-01 19:41:15 UTC (rev 22629)
@@ -4,15 +4,16 @@
 #export DH_VERBOSE=1
 
 PYTHON2 := $(shell pyversions -s)
+PYTHON3 := $(shell py3versions -s)
 LIB2 := $(shell python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib")
 LOGILAB_COMMON_DIR := $(shell dirname `python -c "import logilab.common as lc ; print lc.__file__" 2>/dev/null`)
 
 %:
-	dh $@
+	dh $@ --with python3
 
 override_dh_auto_build:
 	set -e; \
-	for python in $(PYTHON2) ; do \
+	for python in $(PYTHON2) $(PYTHON3) ; do \
 		NO_SETUPTOOLS=1 $$python setup.py build ; \
 	done
 
@@ -32,10 +33,24 @@
 		# and cleanup the mess ;\
 		rm -rf $(CURDIR)/$(LIB2)/logilab/__init__.py $(CURDIR)/$(LIB2)/logilab/common ;\
 	done
+	for python in $(PYTHON3) ; do \
+		LIB3=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ;\
+		LOGILAB_COMMON_DIR3=$$(dirname `$$python -c "import logilab.common as lc ; print (lc.__file__)" 2>/dev/null`) ;\
+		# we need this hack because we have to initialize the namespace ;\
+		touch $(CURDIR)/$$LIB3/logilab/__init__.py ;\
+		# even bigger hack: we symlink the common module in our temp build/ ;\
+		# because it has to be in the same namespace as astng ;\
+		ln -s $$LOGILAB_COMMON_DIR3 $(CURDIR)/$$LIB3/logilab/ ;\
+		# we can now run the test, at last... ;\
+		PYTHONPATH=$(CURDIR)/$$LIB3 $$python `which pytest` ;\
+		# and cleanup the mess ;\
+		rm -rf $(CURDIR)/$$LIB3/logilab/__init__.py $(CURDIR)/$$LIB3/logilab/common ;\
+	done
 endif
 
 override_dh_auto_clean: 
 	NO_SETUPTOOLS=1 python setup.py clean
+	NO_SETUPTOOLS=1 python3 setup.py clean
 
 	find . -name "*.pyc" -delete 
 	
@@ -46,15 +61,24 @@
 	NO_SETUPTOOLS=1 python setup.py install --no-compile \
 		--root=$(CURDIR)/debian/python-logilab-astng/ \
 		--install-layout=deb
+	NO_SETUPTOOLS=1 python3 setup.py install --no-compile \
+		--root=$(CURDIR)/debian/python3-logilab-astng/ \
+		--install-layout=deb
 
 	# remove sub-package __init__ file (created in postinst)
 	rm debian/python-logilab-astng/usr/lib/python*/*-packages/logilab/__init__.py
+	rm debian/python3-logilab-astng/usr/lib/python*/*-packages/logilab/__init__.py
 	# remove test directory (installed in a separated package)
 	rm -rf debian/python-logilab-astng/usr/lib/python*/*-packages/logilab/astng/test
+	rm -rf debian/python3-logilab-astng/usr/lib/python*/*-packages/logilab/astng/test
 
 	# install tests
 	(cd test && find . -type f -not \( -path '*/CVS/*' -or -name '*.pyc' -or -name '*.pyo' -or -name '*.egg' \) -exec install -D --mode=644 {} ../debian/python-logilab-astng/usr/share/doc/python-logilab-astng/test/{} \;)
+	(cd test && find . -type f -not \( -path '*/CVS/*' -or -name '*.pyc' -or -name '*.pyo' -or -name '*.egg' \) -exec install -D --mode=644 {} ../debian/python3-logilab-astng/usr/share/doc/python3-logilab-astng/test/{} \;)
 
+	# clean up __pycache__ dirs, generated when running tests on the build dir
+	find $(CURDIR)/debian/python3-logilab-astng -type d -name "__pycache__" | xargs rm -rf
+
 override_dh_installchangelogs:
 	dh_installchangelogs -i ChangeLog
 




More information about the Python-modules-commits mailing list