diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2011-06-09 12:43:20 +0200 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2011-06-09 12:43:20 +0200 |
commit | e2dc55d9743c816d1815189ac90d095c00869e3e (patch) | |
tree | f28de052cec498f68ce876d704e837b1162002f5 | |
parent | c736e7029e155349801a635452c63523ca3942c8 (diff) | |
download | logilab-common-e2dc55d9743c816d1815189ac90d095c00869e3e.tar.gz |
[py3k] make python3 package available in sid
logilab.common is not compatible with python3.1 but
since python3.2 is available by default in sid, we
can now try to construct python3 package automatically.
Note: test failures are not blocking for python3
-rw-r--r-- | README.Python3 | 25 | ||||
-rwxr-xr-x | debian.py3k/rules | 60 | ||||
-rw-r--r-- | debian.py3k/source/format | 1 | ||||
-rw-r--r-- | debian.sid/control (renamed from debian.py3k/control) | 32 | ||||
-rwxr-xr-x | debian.sid/rules | 76 |
5 files changed, 118 insertions, 76 deletions
diff --git a/README.Python3 b/README.Python3 index a4522e0..1000948 100644 --- a/README.Python3 +++ b/README.Python3 @@ -1,26 +1,29 @@ 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 ---- + python3 setup.py install -If you want to run the tests, simply remove the "! -path ..." option, hence -also refactoring the test files, including all data files. +Tests +----- +Set your PYTHONPATH and run pytest3 against the test directory. Debian ------ -For the Debian packaging of python3-logilab-common, you can use the debian.py3k/ +For the Debian packaging of python3-logilab-common, you can use the debian.sid/ content against the debian/ folder:: - cp debian.py3k/* debian/ + cp debian.sid/* debian/ +Resources +--------- +http://wiki.python.org/moin/PortingPythonToPy3k diff --git a/debian.py3k/rules b/debian.py3k/rules deleted file mode 100755 index 4661da1..0000000 --- a/debian.py3k/rules +++ /dev/null @@ -1,60 +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-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/python3/python.mk - -PACKAGE:=$(shell grep Package debian/control | cut -d ' ' -f2) -#PACKAGE:=$(call py_pkgname,$(shell grep Package debian/control | cut -d ' ' -f2), python3.) - -%: - dh --with python3 --without python2 $@ - -override_dh_auto_build: -ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) - # build doc - $(MAKE) -C doc -endif - -override_dh_install: - NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ - --root=$(CURDIR)/debian/$(PACKAGE)/ \ - ${py_setup_install_args} - # remove test directory - rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/common/test - # rename pytest for python3k - mv debian/$(PACKAGE)/usr/bin/pytest debian/$(PACKAGE)/usr/bin/pytest3 - sed -i 's/python -u/python3 -u/' debian/$(PACKAGE)/usr/bin/pytest3 - # don't install python2.X sources in this package - rm -rf debian/$(PACKAGE)/usr/lib/python2.? - -override_dh_pysupport: - dh_python3 --suggests=python3 - -override_dh_installdocs: - dh_installdocs -i README* doc/apidoc/ - dh_installchangelogs -i ChangeLog - -override_dh_auto_test: -ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) - # IMPORTANT: Install command was overriden by Logilab to install data test files. - NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ - --root=$(CURDIR)/testing/ ${py_setup_install_args} - # since "logilab.common" is a namespace package, we need to "simulate" it - touch $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/__init__.py - # use the default python version to select the script dir to run the tests - PYTHONPATH=$(CURDIR)/testing/usr/lib/python3/dist-packages/ python3 $(CURDIR)/testing/usr/bin/pytest -t $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/common/test - rm -f $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/__init__.py -endif - -override_dh_compress: - dh_compress -i -X.py -X.ini -X.xml -Xtest/ -Xapidoc/ diff --git a/debian.py3k/source/format b/debian.py3k/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian.py3k/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian.py3k/control b/debian.sid/control index 77f365f..956ac50 100644 --- a/debian.py3k/control +++ b/debian.sid/control @@ -8,18 +8,42 @@ Uploaders: David Douard <david.douard@logilab.fr>, Adrien Di Mascio <Adrien.DiMascio@logilab.fr>, Nicolas Chauvat <nicolas.chauvat@logilab.fr>, Julien Jehannet <julien.jehannet@logilab.fr> -Build-Depends: debhelper (>= 7.0.50~), python3-all -Build-Depends-Indep: python-epydoc, graphviz -#, python-unittest2, python-egenix-mxdatetime +Build-Depends: debhelper (>= 7.0.50~), python-all, python3-all +Build-Depends-Indep: python-epydoc, graphviz, python-unittest2, python-egenix-mxdatetime +X-Python3-Version: >= 3.2 Standards-Version: 3.9.1 Homepage: http://www.logilab.org/project/logilab-common Vcs-Hg: http://hg.logilab.org/logilab/common Vcs-Browser: http://hg.logilab.org/logilab/common -Package: python3-logilab-common +Package: python-logilab-common Architecture: all Provides: ${python:Provides} Depends: ${python:Depends}, ${misc:Depends} +Recommends: python-egenix-mxdatetime +Suggests: pyro, python-unittest2 +Conflicts: python-constraint (<< 0.4.0-4), python-logilab-astng (<< 0.19.1-1), pylint (<< 0.18.1-1) +Description: useful miscellaneous modules used by Logilab projects + 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 + + +Package: python3-logilab-common +Architecture: all +Provides: ${python3:Provides} +Depends: ${python3:Depends}, ${misc:Depends} Suggests: pyro #Recommends: python3-egenix-mxdatetime Description: useful miscellaneous modules used by Logilab projects diff --git a/debian.sid/rules b/debian.sid/rules new file mode 100755 index 0000000..7a6e7fb --- /dev/null +++ b/debian.sid/rules @@ -0,0 +1,76 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# +# 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 + +PYLIB:=$(call py_libdir,$(shell pyversions -d)) +PACKAGE:=$(call py_pkgname,python-logilab-common,python) +PYLIB3:=$(call py_libdir,python3.) +PACKAGE3:=$(call py_pkgname,python-logilab-common,python3.) + +%: + dh $@ --with python2,python3 + +override_dh_auto_build: +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) + $(MAKE) -C doc +endif + +override_dh_auto_install: + NO_SETUPTOOLS=1 python setup.py -q install --no-compile \ + --root=$(CURDIR)/debian/$(PACKAGE)/ \ + ${py_setup_install_args} + # remove test directory + rm -rf debian/$(PACKAGE)/$(PYLIB)/logilab/common/test + + NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ + --root=$(CURDIR)/debian/$(PACKAGE3)/ \ + ${py_setup_install_args} + # remove test directory + rm -rf debian/$(PACKAGE3)/$(PYLIB3)/logilab/common/test + + # rename pytest and its man page for python3k + mv debian/$(PACKAGE3)/usr/bin/pytest debian/$(PACKAGE3)/usr/bin/pytest3 + sed -i 's/python -u/python3 -u/' debian/$(PACKAGE3)/usr/bin/pytest3 + install -D doc/pytest.1 debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1 + sed -i 's/pytest/pytest3/' debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1 + gzip debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1 + +override_dh_installdocs: + dh_installchangelogs -i ChangeLog + dh_installdocs -i README* +ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) + dh_installdocs -i doc/apidoc/ +endif + +override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + # PYTHON 2.X + # IMPORTANT: Install command was overriden by Logilab to install data test files. + NO_SETUPTOOLS=1 python setup.py -q install --no-compile \ + --root=$(CURDIR)/testing/ ${py_setup_install_args} + # since "logilab.common" is a namespace package, we need to "simulate" it + touch $(CURDIR)/testing/$(PYLIB)/logilab/__init__.py + # use the default python version to select the script dir to run the tests + PYTHONPATH=$(CURDIR)/testing/$(PYLIB) python $(CURDIR)/testing/usr/bin/pytest -t $(CURDIR)/testing/$(PYLIB)/logilab/common/test + rm -rf $(CURDIR)/testing + + # PYTHON 3.2 + # IMPORTANT: Install command was overriden by Logilab to install data test files. + NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ + --root=$(CURDIR)/testing/ ${py_setup_install_args} + # since "logilab.common" is a namespace package, we need to "simulate" it + touch $(CURDIR)/testing/$(PYLIB3)/logilab/__init__.py + # use python3 version to run pytest + -PYTHONPATH=$(CURDIR)/testing/$(PYLIB3) python3 $(CURDIR)/testing/usr/bin/pytest -t $(CURDIR)/testing/$(PYLIB3)/logilab/common/test + rm -rf $(CURDIR)/testing +endif + +override_dh_compress: + dh_compress -X.py -X.ini -X.xml -Xtest/ -Xapidoc/ |