diff options
-rw-r--r-- | README.Python3 | 20 | ||||
-rw-r--r-- | debian.hardy/preinst | 19 | ||||
-rwxr-xr-x | debian.hardy/rules | 70 | ||||
-rwxr-xr-x | debian.py3k/rules | 36 | ||||
-rw-r--r-- | debian.sid/control (renamed from debian.py3k/control) | 18 | ||||
-rwxr-xr-x | debian.sid/rules | 42 | ||||
-rw-r--r-- | debian.sid/source/format (renamed from debian.py3k/source/format) | 0 | ||||
-rw-r--r-- | setup.py | 3 |
8 files changed, 68 insertions, 140 deletions
diff --git a/README.Python3 b/README.Python3 index 7c557bf..55ea159 100644 --- a/README.Python3 +++ b/README.Python3 @@ -1,19 +1,15 @@ Python3 ======= -Source ------- - -Python3 portage is made by running the 2to3 script on all modules:: +Approach +-------- - find . ! -path "*/test/*py" -name "*py" -exec 2to3-3.1 -wn {} \; +We maintain a Python 2 base and use 2to3 to generate Python 3 code. +2to3 is integrated into the distutils installation process and will be run as a +build step when invoked by the python3 interpreter:: -Dev ---- - -If you want to run the tests, simply remove the "! -path ..." option, hence -also refactoring the test files, including all data files. + python3 setup.py install --no-compile Debian @@ -24,3 +20,7 @@ the debian/ folder:: cp debian.py3k/* debian/ + +Resources +--------- +http://wiki.python.org/moin/PortingPythonToPy3k diff --git a/debian.hardy/preinst b/debian.hardy/preinst deleted file mode 100644 index 4d830f7..0000000 --- a/debian.hardy/preinst +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -e - -case "$1" in - install) - ;; - upgrade) - pycentral pkgremove python-logilab-astng || true - ;; - abort-upgrade) - ;; - *) - echo "preinst called with unknown argument '$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian.hardy/rules b/debian.hardy/rules deleted file mode 100755 index 228a8ea..0000000 --- a/debian.hardy/rules +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# -# adapted by Logilab for automatic generation by debianize -# (part of the devtools project, http://www.logilab.org/projects/devtools) -# -# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE). -# http://www.logilab.fr/ -- mailto:contact@logilab.fr - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -build: build-stamp -build-stamp: - dh_testdir - - NO_SETUPTOOLS=1 python setup.py -q build - - touch build-stamp - -clean: - dh_testdir - dh_testroot - - NO_SETUPTOOLS=1 python setup.py clean - - find . -name "*.pyc" -delete - - rm -rf build - dh_clean build-stamp - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - NO_SETUPTOOLS=1 python setup.py -q install --no-compile \ - --root=$(CURDIR)/debian/python-logilab-astng/ - - # remove sub-package __init__ file (created in postinst) - rm debian/python-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 - - # install tests - (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/{} \;) - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot - dh_install -i - dh_pysupport -i - dh_installchangelogs -i ChangeLog - dh_installexamples -i - dh_installdocs -i README - dh_compress -i -X.py -X.ini -X.xml -Xtest - dh_fixperms -i - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -binary-arch: - -binary: binary-indep -.PHONY: build clean binary binary-indep binary-arch - diff --git a/debian.py3k/rules b/debian.py3k/rules deleted file mode 100755 index e769bda..0000000 --- a/debian.py3k/rules +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# -# adapted by Logilab for automatic generation by debianize -# (part of the devtools project, http://www.logilab.org/projects/devtools) -# -# Copyright (c) 2003-2010 LOGILAB S.A. (Paris, FRANCE). -# http://www.logilab.fr/ -- mailto:contact@logilab.fr - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -PACKAGE:=$(shell grep Package debian/control | cut -d ' ' -f2) - -include /usr/share/python3/python.mk - - -%: - dh --with python3 --without python2 $@ - -override_dh_install: - NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ - --root=$(CURDIR)/debian/$(PACKAGE)/ ${py_setup_install_args} - rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/astng/test - rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/__init__.py - -override_dh_pysupport: - dh_python3 --suggests=python3 - -override_dh_installdocs: - dh_installdocs -i README* - dh_installchangelogs -i ChangeLog - -override_dh_compress: - dh_compress -i -X.py -X.ini -X.xml -Xtest/ diff --git a/debian.py3k/control b/debian.sid/control index dc744bd..c73a764 100644 --- a/debian.py3k/control +++ b/debian.sid/control @@ -6,15 +6,27 @@ Uploaders: Sylvain Thénault <sylvain.thenault@logilab.fr>, Alexandre Fayolle <afayolle@debian.org>, Sandro Tosi <morph@debian.org>, Julien Jehannet <julien.jehannet@logilab.fr> -Build-Depends: debhelper (>= 7.0.50~), python3-all -Standards-Version: 3.9.1 +Build-Depends: debhelper (>= 7.0.50~), python-all, python3-all +Standards-Version: 3.9.2 Homepage: http://www.logilab.org/project/logilab-astng Vcs-Hg: http://hg.logilab.org/logilab/astng Vcs-Browser: http://hg.logilab.org/logilab/astng +Package: python-logilab-astng +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, python-logilab-common +Description: rebuild a new abstract syntax tree from Python's ast + The aim of this module is to provide a common base representation of + Python source code for projects such as pyreverse or pylint. + . + It rebuilds the tree generated by the _ast module 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. + Furthermore, astng builds partial trees by inspecting living objects. + Package: python3-logilab-astng Architecture: all -Depends: ${python:Depends}, ${misc:Depends}, python3-logilab-common +Depends: ${python3:Depends}, ${misc:Depends}, python3-logilab-common Description: rebuild a new abstract syntax tree from Python's ast The aim of this module is to provide a common base representation of Python source code for projects such as pyreverse or pylint. diff --git a/debian.sid/rules b/debian.sid/rules new file mode 100755 index 0000000..1a9c55b --- /dev/null +++ b/debian.sid/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. +# +# adapted by Logilab for automatic generation by debianize +# (part of the devtools project, http://www.logilab.org/projects/devtools) +# +# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE). +# http://www.logilab.fr/ -- mailto:contact@logilab.fr + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/python/python.mk + +PACKAGE:=$(call py_pkgname,python-logilab-astng,python) +PACKAGE3:=$(call py_pkgname,python-logilab-astng,python3.) + +%: + dh $@ --with python2,python3 + +override_dh_install: + NO_SETUPTOOLS=1 python setup.py -q install --no-compile \ + --root=$(CURDIR)/debian/$(PACKAGE)/ \ + ${py_setup_install_args} + NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ + --root=$(CURDIR)/debian/$(PACKAGE3)/ \ + ${py_setup_install_args} + rm -rf debian/*/usr/lib/python*/*-packages/logilab/astng/test + rm -rf debian/*/usr/lib/python*/*-packages/logilab/__init__.py + +override_dh_installdocs: + dh_installdocs -i README* + dh_installchangelogs -i ChangeLog + +override_dh_compress: + dh_compress -i -X.py -X.ini -X.xml -Xtest/ + +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + # PYTHON 2.X + PYTHON 3.2 +endif diff --git a/debian.py3k/source/format b/debian.sid/source/format index 163aaf8..163aaf8 100644 --- a/debian.py3k/source/format +++ b/debian.sid/source/format @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=W0404,W0622,W0704,W0613 -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. @@ -51,7 +51,6 @@ __pkginfo__ = __import__("__pkginfo__") # import required features from __pkginfo__ import modname, version, license, description, \ web, author, author_email -# import optional features distname = getattr(__pkginfo__, 'distname', modname) scripts = getattr(__pkginfo__, 'scripts', []) |