From ff887221ae0e733470b4847d67ff1a253da28378 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Sun, 27 Sep 2015 12:32:43 +0000 Subject: [PATCH] Added Python 3 support. --- debian/changelog | 6 ++++ debian/control | 44 +++++++++++++++++++++++++-- debian/python-mistralclient.postinst | 11 +++++++ debian/python-mistralclient.postrm | 11 +++++++ debian/python-mistralclient.prerm | 11 +++++++ debian/python3-mistralclient.postinst | 11 +++++++ debian/python3-mistralclient.postrm | 11 +++++++ debian/python3-mistralclient.prerm | 11 +++++++ debian/rules | 11 +++++-- 9 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 debian/python-mistralclient.postinst create mode 100644 debian/python-mistralclient.postrm create mode 100644 debian/python-mistralclient.prerm create mode 100644 debian/python3-mistralclient.postinst create mode 100644 debian/python3-mistralclient.postrm create mode 100644 debian/python3-mistralclient.prerm diff --git a/debian/changelog b/debian/changelog index cf39087..04ac77f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-mistralclient (1:1.1.0-2) experimental; urgency=medium + + * Added Python 3 support. + + -- Thomas Goirand Sun, 27 Sep 2015 12:32:29 +0000 + python-mistralclient (1:1.1.0-1) experimental; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index 8fd8c06..65e425d 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: python-mistralclient Section: python Priority: extra Maintainer: PKG OpenStack -Uploaders: Thomas Goirand +Uploaders: Thomas Goirand , Build-Depends: debhelper (>= 9), dh-python, openstack-pkg-tools, @@ -10,6 +10,9 @@ Build-Depends: debhelper (>= 9), python-pbr (>= 1.8), python-setuptools, python-sphinx, + python3-all, + python3-pbr (>= 1.8), + python3-setuptools, Build-Depends-Indep: python-cliff (>= 1.14.0), python-fixtures (>= 1.3.1), python-hacking, @@ -21,6 +24,16 @@ Build-Depends-Indep: python-cliff (>= 1.14.0), python-testtools (>= 1.4.0), python-unittest2, python-yaml, + python3-cliff (>= 1.14.0), + python3-fixtures (>= 1.3.1), + python3-keystoneclient (>= 1:1.6.0), + python3-mock (>= 1.3), + python3-nose, + python3-requests (>= 2.5.2), + python3-tempest-lib (>= 0.6.1), + python3-testtools (>= 1.4.0), + python3-unittest2, + python3-yaml, Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-mistralclient.git Vcs-Git: git://anonscm.debian.org/openstack/python-mistralclient.git @@ -36,7 +49,7 @@ Depends: python-cliff (>= 1.14.0), ${misc:Depends}, ${python:Depends}, ${sphinxdoc:Depends}, -Description: OpenStack Workflow as a Service client - Python 2.x +Description: OpenStack Workflow as a Service client - Python 2.7 Mistral is a task management service. It is also known as Workflow as a Service. Most business processes consist of multiple distinct interconnected steps that need to be executed in a particular order in a distributed @@ -49,4 +62,29 @@ Description: OpenStack Workflow as a Service client - Python 2.x them is called a workflow. Independent routes in a workflow (which, in fact, is a graph) are called flows and Mistral can execute them in parallel. . - This package provides a cli and a Python 2.x client module. + This package provides a cli and a Python 2.7 client module. + +Package: python3-mistralclient +Architecture: all +Depends: python3-cliff (>= 1.14.0), + python3-keystoneclient (>= 1:1.6.0), + python3-pbr (>= 1.8), + python3-requests (>= 2.5.2), + python3-yaml, + ${misc:Depends}, + ${python3:Depends}, + ${sphinxdoc:Depends}, +Description: OpenStack Workflow as a Service client - Python 3.x + Mistral is a task management service. It is also known as Workflow as a + Service. Most business processes consist of multiple distinct interconnected + steps that need to be executed in a particular order in a distributed + environment. One can describe such process as a set of tasks and task + relations and upload such description to Mistral so that it takes care of + state management, correct execution order, task distribution and high + availability. Mistral also provides flexible task scheduling so that users can + run a process according to a specified schedule (i.e. every Sunday at 4.00pm) + instead of running it immediately. Such set of tasks and dependencies between + them is called a workflow. Independent routes in a workflow (which, in fact, + is a graph) are called flows and Mistral can execute them in parallel. + . + This package provides a cli and a Python 3.x client module. diff --git a/debian/python-mistralclient.postinst b/debian/python-mistralclient.postinst new file mode 100644 index 0000000..49dbff3 --- /dev/null +++ b/debian/python-mistralclient.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/mistral mistral /usr/bin/python2-mistral 300 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python-mistralclient.postrm b/debian/python-mistralclient.postrm new file mode 100644 index 0000000..239c6c6 --- /dev/null +++ b/debian/python-mistralclient.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then + update-alternatives --remove mistral /usr/bin/python2-mistral +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python-mistralclient.prerm b/debian/python-mistralclient.prerm new file mode 100644 index 0000000..3a40981 --- /dev/null +++ b/debian/python-mistralclient.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove mistral /usr/bin/python2-mistral +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-mistralclient.postinst b/debian/python3-mistralclient.postinst new file mode 100644 index 0000000..e6d3ba0 --- /dev/null +++ b/debian/python3-mistralclient.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/mistral mistral /usr/bin/python3-mistral 200 +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-mistralclient.postrm b/debian/python3-mistralclient.postrm new file mode 100644 index 0000000..d7edd77 --- /dev/null +++ b/debian/python3-mistralclient.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ] ; then + update-alternatives --remove mistral /usr/bin/python3-mistral +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/python3-mistralclient.prerm b/debian/python3-mistralclient.prerm new file mode 100644 index 0000000..bd4fde6 --- /dev/null +++ b/debian/python3-mistralclient.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove mistral /usr/bin/python3-mistral +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 0a89e6b..711077c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f PYTHONS:=$(shell pyversions -vr) -#PYTHON3S:=$(shell py3versions -vr) +PYTHON3S:=$(shell py3versions -vr) UPSTREAM_GIT = git://github.com/stackforge/python-mistralclient.git include /usr/share/openstack-pkg-tools/pkgos.make @@ -9,14 +9,20 @@ include /usr/share/openstack-pkg-tools/pkgos.make export OSLO_PACKAGE_VERSION=$(VERSION) %: - dh $@ --buildsystem=python_distutils --with python2,sphinxdoc + dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc override_dh_install: set -e ; for pyvers in $(PYTHONS); do \ python$$pyvers setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python-mistralclient; \ done + set -e ; for pyvers in $(PYTHON3S); do \ + python$$pyvers setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/python3-mistralclient; \ + done rm -rf $(CURDIR)/debian/python*-mistralclient/usr/lib/python*/dist-packages/*.pth + mv $(CURDIR)/debian/python-mistralclient/usr/bin/mistral $(CURDIR)/debian/python-mistralclient/usr/bin/python2-mistral + mv $(CURDIR)/debian/python3-mistralclient/usr/bin/mistral $(CURDIR)/debian/python3-mistralclient/usr/bin/python3-mistral override_dh_clean: dh_clean -O--buildsystem=python_distutils @@ -25,6 +31,7 @@ override_dh_clean: override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) nosetests -v -I cli_multi_tenancy_tests.py -I cli_tests_v2.py + nosetests3 -v -I cli_multi_tenancy_tests.py -I cli_tests_v2.py # set -e ; for i in $(PYTHONS) $(PYTHON3S) ; do \ # PYMAJOR=`echo $$i | cut -d'.' -f1` ; \ # echo "===> Testing with python$$i (python$$PYMAJOR)" ; \