PROTON-490: Make setup py34 compatible

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/fc3f4f5b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/fc3f4f5b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/fc3f4f5b

Branch: refs/heads/kgiusti-python3
Commit: fc3f4f5b1592e6b57f5e64a691a96d91c6742d5f
Parents: 2721c63
Author: Flavio Percoco <flape...@gmail.com>
Authored: Sun Jun 14 00:08:02 2015 +0200
Committer: Ken Giusti <kgiu...@apache.org>
Committed: Mon Jun 15 13:28:30 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/setup.py |  7 +++++--
 proton-c/bindings/python/tox.ini  | 19 ++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/fc3f4f5b/proton-c/bindings/python/setup.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/setup.py 
b/proton-c/bindings/python/setup.py
index 84b5a66..e6fbb79 100755
--- a/proton-c/bindings/python/setup.py
+++ b/proton-c/bindings/python/setup.py
@@ -149,7 +149,7 @@ class Configure(build_ext):
 #define PN_VERSION_MINOR %i
 #endif /* version.h */
 """ % bundle.min_qpid_proton
-            ver.write(version_text)
+            ver.write(version_text.encode('utf-8'))
 
         # Collect all the C files that need to be built.
         # we could've used `glob(.., '*', '*.c')` but I preferred going
@@ -269,6 +269,9 @@ class Configure(build_ext):
 
         _cproton.runtime_library_dirs.extend([install_lib])
 
+        if sys.version_info.major >= 3:
+            _cproton.libraries[0] = "qpid-proton%s" % 
ds_sys.get_config_var('EXT_SUFFIX')[:-3]
+
         # Register this new extension and make
         # sure it's built and installed *before* `_cproton`.
         self.distribution.ext_modules.insert(0, libqpid_proton)
@@ -283,7 +286,7 @@ class Configure(build_ext):
     @property
     def bundle_proton(self):
         """Bundled proton if the conditions below are met."""
-        return sys.platform == 'linux2' and not 
self.check_qpid_proton_version()
+        return 'linux' in sys.platform and not self.check_qpid_proton_version()
 
     def run(self):
         if self.bundle_proton:

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/fc3f4f5b/proton-c/bindings/python/tox.ini
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/tox.ini b/proton-c/bindings/python/tox.ini
index dddfe74..b2277da 100644
--- a/proton-c/bindings/python/tox.ini
+++ b/proton-c/bindings/python/tox.ini
@@ -1,9 +1,10 @@
 [tox]
-envlist = build
+envlist = build,py34
 minversion = 1.4
 skipdist = True
 
 [testenv]
+usedevelop = False
 changedir = {toxinidir}/../../proton-c/include/
 setenv =
     VIRTUAL_ENV={envdir}
@@ -11,8 +12,7 @@ passenv =
     PKG_CONFIG_PATH
     CFLAGS
 commands =
-    pip install -e {toxinidir}
-    tests/python/proton-test {posargs}
+    {toxinidir}/../../../tests/python/proton-test {posargs}
 
 [testenv:pep8]
 commands = flake8
@@ -20,13 +20,18 @@ commands = flake8
 [testenv:docs]
 commands = python setup.py build_sphinx
 
+[testenv:py34]
+platform = linux
+setenv =
+    VIRTUAL_ENV={envdir}
+    PKG_CONFIG_PATH=None
+    QPID_PROTON_SRC={toxinidir}/../../../
+    DEBUG=True
+
 [testenv:build]
-usedevelop = False
 platform = linux2
 setenv =
     VIRTUAL_ENV={envdir}
     PKG_CONFIG_PATH=None
     QPID_PROTON_SRC={toxinidir}/../../../
-    DEBUG=True
-commands =
-    {toxinidir}/../../../tests/python/proton-test {posargs}
\ No newline at end of file
+    DEBUG=True
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to