[py3k] make python3 package available in sid (closes: #81139)

Forget hardy distribution.

authorJulien Jehannet <julien.jehannet@logilab.fr>
changesetd90352fcf019
branchdefault
phasepublic
hiddenno
parent revision#a3b0b27a96b8 only call transformers if modname specified
child revision#cd5d87c447fe Make sure that the name attribute on lambda nodes is defined,
files modified by this revision
README.Python3
debian.hardy/preinst
debian.hardy/rules
debian.py3k/control
debian.py3k/rules
debian.py3k/source/format
debian.sid/control
debian.sid/rules
debian.sid/source/format
setup.py
# HG changeset patch
# User Julien Jehannet <julien.jehannet@logilab.fr>
# Date 1319105385 -7200
# Thu Oct 20 12:09:45 2011 +0200
# Node ID d90352fcf0199a40a5195768a23ff4dfe4c7fa91
# Parent a3b0b27a96b86332ff401dd793e678ac782f014e
[py3k] make python3 package available in sid (closes: #81139)

Forget hardy distribution.

diff --git a/README.Python3 b/README.Python3
@@ -1,26 +1,26 @@
1  Python3
2  =======
3 
4 -Source
5 -------
6 +Approach
7 +--------
8 
9 -Python3 portage is made by running the 2to3 script on all modules::
10 -
11 -  find . ! -path "*/test/*py" -name "*py" -exec 2to3-3.1 -wn {} \;
12 +We maintain a Python 2 base and use 2to3 to generate Python 3 code.
13 
14 +2to3 is integrated into the distutils installation process and will be run as a
15 +build step when invoked by the python3 interpreter::
16 
17 -Dev
18 ----
19 -
20 -If you want to run the tests, simply remove the "! -path ..." option, hence
21 -also refactoring the test files, including all data files.
22 +  python3 setup.py install --no-compile
23 
24 
25  Debian
26  ------
27 
28  For the Debian packaging, you can use the debian.py3k/ content against
29  the debian/ folder::
30 
31    cp debian.py3k/* debian/
32 
33 +
34 +Resources
35 +---------
36 +http://wiki.python.org/moin/PortingPythonToPy3k
diff --git a/debian.hardy/preinst b/debian.hardy/preinst
@@ -1,19 +0,0 @@
37 -#!/bin/sh -e
38 -
39 -case "$1" in
40 -	install)
41 -		;;
42 -	upgrade)
43 -		pycentral pkgremove python-logilab-astng || true
44 -		;;
45 -	abort-upgrade)
46 -		;;
47 -	*)
48 -		echo "preinst called with unknown argument '$1'" >&2
49 -		exit 1
50 -		;;
51 -esac
52 -
53 -#DEBHELPER#
54 -
55 -exit 0
diff --git a/debian.hardy/rules b/debian.hardy/rules
@@ -1,70 +0,0 @@
56 -#!/usr/bin/make -f
57 -# Sample debian/rules that uses debhelper.
58 -# GNU copyright 1997 to 1999 by Joey Hess.
59 -#
60 -# adapted by Logilab for automatic generation by debianize
61 -# (part of the devtools project, http://www.logilab.org/projects/devtools)
62 -#
63 -# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
64 -# http://www.logilab.fr/ -- mailto:contact@logilab.fr
65 -
66 -# Uncomment this to turn on verbose mode.
67 -#export DH_VERBOSE=1
68 -
69 -build: build-stamp
70 -build-stamp: 
71 -	dh_testdir
72 -	
73 -	NO_SETUPTOOLS=1 python setup.py -q build
74 -
75 -	touch build-stamp
76 -
77 -clean: 
78 -	dh_testdir
79 -	dh_testroot
80 -
81 -	NO_SETUPTOOLS=1 python setup.py clean
82 -
83 -	find . -name "*.pyc" -delete 
84 -	
85 -	rm -rf build
86 -	dh_clean build-stamp
87 -
88 -install: build
89 -	dh_testdir
90 -	dh_testroot
91 -	dh_clean -k
92 -	dh_installdirs
93 -
94 -	NO_SETUPTOOLS=1 python setup.py -q install --no-compile \
95 -		--root=$(CURDIR)/debian/python-logilab-astng/
96 -
97 -	# remove sub-package __init__ file (created in postinst)
98 -	rm debian/python-logilab-astng/usr/lib/python*/*-packages/logilab/__init__.py
99 -	# remove test directory (installed in a separated package)
100 -	rm -rf debian/python-logilab-astng/usr/lib/python*/*-packages/logilab/astng/test
101 -
102 -	# install tests
103 -	(cd test && find . -type f -not \( -path '*/CVS/*' -or -name '*.pyc' \) -exec install -D --mode=644 {} ../debian/python-logilab-astng/usr/share/doc/python-logilab-astng/test/{} \;)
104 -
105 -# Build architecture-independent files here.
106 -binary-indep: build install
107 -	dh_testdir 
108 -	dh_testroot 
109 -	dh_install -i
110 -	dh_pysupport -i 
111 -	dh_installchangelogs -i ChangeLog
112 -	dh_installexamples -i
113 -	dh_installdocs -i README
114 -	dh_compress -i -X.py -X.ini -X.xml -Xtest
115 -	dh_fixperms -i
116 -	dh_installdeb -i
117 -	dh_gencontrol -i 
118 -	dh_md5sums -i
119 -	dh_builddeb -i
120 -
121 -binary-arch:
122 -
123 -binary: binary-indep
124 -.PHONY: build clean binary binary-indep binary-arch
125 -
diff --git a/debian.py3k/control b/debian.sid/control
@@ -4,19 +4,31 @@
126  Maintainer: Logilab S.A. <contact@logilab.fr>
127  Uploaders: Sylvain Thénault <sylvain.thenault@logilab.fr>,
128  	   Alexandre Fayolle <afayolle@debian.org>,
129  	   Sandro Tosi <morph@debian.org>,
130  	   Julien Jehannet <julien.jehannet@logilab.fr>
131 -Build-Depends: debhelper (>= 7.0.50~), python3-all
132 -Standards-Version: 3.9.1
133 +Build-Depends: debhelper (>= 7.0.50~), python-all, python3-all
134 +Standards-Version: 3.9.2
135  Homepage: http://www.logilab.org/project/logilab-astng
136  Vcs-Hg: http://hg.logilab.org/logilab/astng
137  Vcs-Browser: http://hg.logilab.org/logilab/astng
138 
139 +Package: python-logilab-astng
140 +Architecture: all
141 +Depends: ${python:Depends}, ${misc:Depends}, python-logilab-common
142 +Description: rebuild a new abstract syntax tree from Python's ast
143 + The aim of this module is to provide a common base representation of
144 + Python source code for projects such as pyreverse or pylint.
145 + .
146 + It rebuilds the tree generated by the _ast module by recursively walking down
147 + the AST and building an extended ast (let's call it astng ;). The new node
148 + classes have additional methods and attributes for different usages.
149 + Furthermore, astng builds partial trees by inspecting living objects.
150 +
151  Package: python3-logilab-astng
152  Architecture: all
153 -Depends: ${python:Depends}, ${misc:Depends}, python3-logilab-common
154 +Depends: ${python3:Depends}, ${misc:Depends}, python3-logilab-common
155  Description: rebuild a new abstract syntax tree from Python's ast
156   The aim of this module is to provide a common base representation of
157   Python source code for projects such as pyreverse or pylint.
158   .
159   It rebuilds the tree generated by the _ast module by recursively walking down
diff --git a/debian.py3k/rules b/debian.sid/rules
@@ -3,34 +3,40 @@
160  # GNU copyright 1997 to 1999 by Joey Hess.
161  #
162  # adapted by Logilab for automatic generation by debianize
163  # (part of the devtools project, http://www.logilab.org/projects/devtools)
164  #
165 -# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE).
166 +# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE).
167  # http://www.logilab.fr/ -- mailto:contact@logilab.fr
168 
169  # Uncomment this to turn on verbose mode.
170  #export DH_VERBOSE=1
171 
172 -PACKAGE:=$(shell grep Package debian/control | cut -d ' ' -f2)
173 +include /usr/share/python/python.mk
174 
175 -include /usr/share/python3/python.mk
176 -
177 +PACKAGE:=$(call py_pkgname,python-logilab-astng,python)
178 +PACKAGE3:=$(call py_pkgname,python-logilab-astng,python3.)
179 
180  %:
181 -	dh --with python3 --without python2 $@
182 +	dh $@ --with python2,python3
183 
184  override_dh_install:
185 +	NO_SETUPTOOLS=1 python setup.py -q install --no-compile \
186 +	                --root=$(CURDIR)/debian/$(PACKAGE)/ \
187 +	                ${py_setup_install_args}
188  	NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \
189 -		--root=$(CURDIR)/debian/$(PACKAGE)/ ${py_setup_install_args}
190 -	rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/astng/test
191 -	rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/__init__.py
192 -
193 -override_dh_pysupport:
194 -	dh_python3 --suggests=python3
195 +	                --root=$(CURDIR)/debian/$(PACKAGE3)/ \
196 +	                ${py_setup_install_args}
197 +	rm -rf debian/*/usr/lib/python*/*-packages/logilab/astng/test
198 +	rm -rf debian/*/usr/lib/python*/*-packages/logilab/__init__.py
199 
200  override_dh_installdocs:
201  	dh_installdocs -i README*
202  	dh_installchangelogs -i ChangeLog
203 
204  override_dh_compress:
205  	dh_compress -i -X.py -X.ini -X.xml -Xtest/
206 +
207 +override_dh_auto_test:
208 +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
209 +	# PYTHON 2.X + PYTHON 3.2
210 +endif
diff --git a/debian.py3k/source/format b/debian.sid/source/format
diff --git a/setup.py b/setup.py
@@ -1,9 +1,9 @@
211  #!/usr/bin/env python
212  # -*- coding: utf-8 -*-
213  # pylint: disable=W0404,W0622,W0704,W0613
214 -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
215 +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
216  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
217  #
218  # This file is part of logilab-astng.
219  #
220  # logilab-astng is free software: you can redistribute it and/or modify it under
@@ -49,11 +49,10 @@
221  # import optional features
222  __pkginfo__ = __import__("__pkginfo__")
223  # import required features
224  from __pkginfo__ import modname, version, license, description, \
225       web, author, author_email
226 -# import optional features
227 
228  distname = getattr(__pkginfo__, 'distname', modname)
229  scripts = getattr(__pkginfo__, 'scripts', [])
230  data_files = getattr(__pkginfo__, 'data_files', None)
231  subpackage_of = getattr(__pkginfo__, 'subpackage_of', None)