--- /dev/null
+Convert the tests together with the sources.
+
+Index: packaging-deb-pOCCI/setup.py
+===================================================================
+--- packaging-deb-pOCCI.orig/setup.py
++++ packaging-deb-pOCCI/setup.py
+@@ -50,7 +50,7 @@ setup(
+
+ keywords='OCCI cloud compliance testing pycurl',
+
+- packages=find_packages(exclude=['doc', 'tests']),
++ packages=find_packages(exclude=['doc']),
+
+ install_requires=['pycurl'],
+
+++ /dev/null
-Enable Python 2 to Pyhton 3 conversion.
-
-It is not enabled in upstream as there are problems in setuptools with
-launching tests.
-
-Index: packaging-deb-pOCCI/setup.py
-===================================================================
---- packaging-deb-pOCCI.orig/setup.py
-+++ packaging-deb-pOCCI/setup.py
-@@ -68,4 +68,6 @@ setup(
- },
-
- test_suite='tests',
-+
-+ use_2to3=True,
- )
+++ /dev/null
-Numpydoc is not used in upstream.
-
-Index: packaging-deb-pOCCI/doc/conf.py
-===================================================================
---- packaging-deb-pOCCI.orig/doc/conf.py
-+++ packaging-deb-pOCCI/doc/conf.py
-@@ -19,7 +19,6 @@ extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.doctest',
- 'sphinx.ext.viewcode',
-- 'numpydoc',
- ]
-
- # To suppress autodoc errors.
export PYBUILD_NAME = pocci
export PYBUILD_DISABLE=test/python3
+PY2VER := $(shell pyversions -vds)
+PY3VER := $(shell py3versions -vds)
+
%:
dh $@ --with python2,python3 --buildsystem=pybuild
override_dh_auto_install:
dh_auto_install
# binaries for both Python 2 and Python 3
- mv debian/python3-pocci/usr/bin/pOCCI debian/python3-pocci/usr/bin/pOCCI-3
+ cp -p debian/python-pocci/usr/bin/pOCCI debian/python-pocci/usr/bin/pOCCI-$(PY2VER)
+ mkdir -p debian/python-pocci/usr/share/man/man1
+ cp -p pOCCI/pOCCI.1 debian/python-pocci/usr/share/man/man1/pOCCI-$(PY2VER).1
+ mv debian/python3-pocci/usr/bin/pOCCI debian/python3-pocci/usr/bin/pOCCI-$(PY3VER)
+ mkdir -p debian/python3-pocci/usr/share/man/man1
+ cp -p pOCCI/pOCCI.1 debian/python3-pocci/usr/share/man/man1/pOCCI-$(PY3VER).1
# config file not needed
rm -rf debian/python-pocci/etc
rm -rf debian/python3-pocci/etc
- # remove files already moved
- rm -f debian/python-pocci/usr/lib/python*/dist-packages/pOCCI/pOCCI.1
- rm -f debian/python-pocci/usr/lib/python*/dist-packages/pOCCI/pOCCI.cfg
override_dh_auto_test:
dh_auto_test
- # troubles with setup tools and 2to3,
- # convert and run tests for Python 3 manually
- rm -rf build/lib/tests/
- mkdir -p build/lib/
- cp -a tests/ build/lib/tests
- 2to3 -w -n build/lib/tests/*.py
- chmod +x build/lib/tests/test_*.py
- (export PYTHONPATH=build/lib:$$PYTHONPATH;\
- for t in build/lib/tests/test_*.py; do $${t}; done)
+ (cd .pybuild/pythonX.Y_$(PY3VER)/build/tests;\
+ export PYTHONPATH=..:$$PYTHONPATH;\
+ for t in test_*.py; do python$(PY3VER) $${t}; done)