summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Jehannet <julien.jehannet@logilab.fr>2010-12-07 16:04:28 +0100
committerJulien Jehannet <julien.jehannet@logilab.fr>2010-12-07 16:04:28 +0100
commitfac3eabf729f6e7a8b93bd0e8cc1b252ea2a3fba (patch)
treeb19986213a8fee732c3ec259aaea00a83bdd8365
parenta87b90ef093e54f0c062f9fcd098fbf21662ac2a (diff)
downloadlogilab-common-fac3eabf729f6e7a8b93bd0e8cc1b252ea2a3fba.tar.gz
[debian] py3k: update debian rules with new debhelper API
*** Working In Progress *** - tests cannot pass Try with command: PYTHONPATH=~/src/public lgp build -vv -d py3k --hooks=no
-rw-r--r--debian.py3k/control5
-rwxr-xr-xdebian.py3k/rules23
-rw-r--r--setup.py10
3 files changed, 23 insertions, 15 deletions
diff --git a/debian.py3k/control b/debian.py3k/control
index 9d1e90c..77f365f 100644
--- a/debian.py3k/control
+++ b/debian.py3k/control
@@ -9,7 +9,8 @@ Uploaders: David Douard <david.douard@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-egenix-mxdatetime, python-unittest2
+Build-Depends-Indep: python-epydoc, graphviz
+#, python-unittest2, python-egenix-mxdatetime
Standards-Version: 3.9.1
Homepage: http://www.logilab.org/project/logilab-common
Vcs-Hg: http://hg.logilab.org/logilab/common
@@ -19,7 +20,7 @@ Package: python3-logilab-common
Architecture: all
Provides: ${python:Provides}
Depends: ${python:Depends}, ${misc:Depends}
-Suggests: pyro, python-unittest2
+Suggests: pyro
#Recommends: python3-egenix-mxdatetime
Description: useful miscellaneous modules used by Logilab projects
logilab-common is a collection of low-level Python packages and modules,
diff --git a/debian.py3k/rules b/debian.py3k/rules
index e2100ac..6446aee 100755
--- a/debian.py3k/rules
+++ b/debian.py3k/rules
@@ -11,27 +11,24 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-PACKAGE:=$(shell grep Package debian/control | cut -d ' ' -f2)
-PYDEF:=$(shell py3versions -dv)
-
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:
- # python module build
- NO_SETUPTOOLS=1 python3 setup.py -q build --build-purelib $(CURDIR)/build/lib
+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}
- # transform python2 sources to python3
- find $(CURDIR)/debian/$(PACKAGE)/usr/lib/python*/*-packages/ ! -path "*/test/*py" -name "*py" -exec 2to3-$(PYDEF) -wn {} \;
# remove test directory
rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/common/test
# rename pytest for python3k
@@ -41,8 +38,7 @@ override_dh_install:
rm -rf debian/$(PACKAGE)/usr/lib/python2.?
override_dh_pysupport:
- dh_pysupport
- dh_python3 -V "$(PYDEF)-" --suggests=python3
+ dh_python3 --suggests=python3
override_dh_installdocs:
dh_installdocs -i README* doc/apidoc/
@@ -50,11 +46,14 @@ override_dh_installdocs:
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)/build/lib/logilab/__init__.py
+ 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)/build/lib/ python3 $(shell unit2) -v -s $(CURDIR)/build/lib/logilab/common/test -p '*test*.py'
- rm -f $(CURDIR)/build/lib/logilab/__init__.py
+ 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:
diff --git a/setup.py b/setup.py
index ef35099..31db5f2 100644
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,13 @@ except ImportError:
from distutils.command import install_lib
USE_SETUPTOOLS = 0
+try:
+ # python3
+ from distutils.command.build_py import build_py_2to3 as build_py
+except ImportError:
+ # python2.x
+ from distutils.command.build_py import build_py
+
sys.modules.pop('__pkginfo__', None)
# import optional features
__pkginfo__ = __import__("__pkginfo__")
@@ -154,7 +161,8 @@ def install(**kwargs):
scripts = ensure_scripts(scripts),
data_files = data_files,
ext_modules = ext_modules,
- cmdclass = {'install_lib': MyInstallLib},
+ cmdclass = {'install_lib': MyInstallLib,
+ 'build_py': build_py},
**kwargs
)