From commits-return-46495-archive-asf-public=cust-asf.ponee.io@qpid.apache.org Fri Aug 10 18:20:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id BE4C0180630 for ; Fri, 10 Aug 2018 18:20:58 +0200 (CEST) Received: (qmail 72321 invoked by uid 500); 10 Aug 2018 16:20:57 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 72312 invoked by uid 99); 10 Aug 2018 16:20:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2018 16:20:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C6155DFB1B; Fri, 10 Aug 2018 16:20:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kpvdr@apache.org To: commits@qpid.apache.org Message-Id: <82666a98754641169c2ba9f3c6c0ee0b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-interop-test git commit: QPIDIT-136: Fix python2.7 site package path in PYTHON3PATH issue Date: Fri, 10 Aug 2018 16:20:57 +0000 (UTC) Repository: qpid-interop-test Updated Branches: refs/heads/master d2eea54c6 -> 6d748f860 QPIDIT-136: Fix python2.7 site package path in PYTHON3PATH issue Project: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/commit/6d748f86 Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/6d748f86 Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/6d748f86 Branch: refs/heads/master Commit: 6d748f860714f8d1633d8ca61fc90705fca0c819 Parents: d2eea54 Author: Kim van der Riet Authored: Fri Aug 10 11:19:02 2018 -0400 Committer: Kim van der Riet Committed: Fri Aug 10 12:20:20 2018 -0400 ---------------------------------------------------------------------- CMakeLists.txt | 10 ++++++ setup.py | 5 +-- .../src/jms_hdrs_props_test/Sender.py | 34 ++++++++++++-------- 3 files changed, 34 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/6d748f86/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 790d7d7..0fffdd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,16 @@ install(CODE "MESSAGE(STATUS \"Python install dir: ${CMAKE_INSTALL_PREFIX}/lib/$ install(CODE "execute_process(COMMAND python setup.py install --prefix ${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ../)") +# This section is temporary - make links from python3.x site-packages dir to python2.7 files needed by shims +# when running under Python 3.x. +install(CODE "MESSAGE(STATUS \"Python install dir: ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/\")") +install(CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/ + WORKING_DIRECTORY ../)") +install(CODE "execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/qit_errors.py + ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/qit_errors.py)") +install(CODE "execute_process(COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON2_DIR_NAME}/site-packages/qpid_interop_test/qit_jms_types.py + ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON3_DIR_NAME}/site-packages/qpid_interop_test/qit_jms_types.py)") + # TODO: THIS IS UGLY! # Find a way to handle this as part of the Python install process instead # Set the following Python scripts to executable: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/6d748f86/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 6310d34..e11bea9 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ LIBEXEC_DIR = 'libexec/qpid_interop_test' SHIM_DIR = '%s/shims' % LIBEXEC_DIR setup(name='qpid-interop-test', - version='0.1', + version='0.2', description='Test suite for testing interoperability between Qpid AMQP clients', author='Apache Qpid', author_email='users@qpid.apache.org', @@ -34,7 +34,8 @@ setup(name='qpid-interop-test', # Shims, installed into {INSTALL_PREFIX}/libexec/qpid_interop_test/shims/ data_files=[ ('%s/qpid-proton-python' % SHIM_DIR, - ['shims/qpid-proton-python/src/_compat.py'] + ['shims/qpid-proton-python/src/_compat.py', + ] ), ('%s/qpid-proton-python/amqp_types_test' % SHIM_DIR, ['shims/qpid-proton-python/src/amqp_types_test/Receiver.py', http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/6d748f86/shims/qpid-proton-python/src/jms_hdrs_props_test/Sender.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/jms_hdrs_props_test/Sender.py b/shims/qpid-proton-python/src/jms_hdrs_props_test/Sender.py index 08a8e98..076920c 100755 --- a/shims/qpid-proton-python/src/jms_hdrs_props_test/Sender.py +++ b/shims/qpid-proton-python/src/jms_hdrs_props_test/Sender.py @@ -34,7 +34,7 @@ import json import proton import proton.handlers import proton.reactor -from qpid_interop_test.qit_common import QitTestTypeMap +#from qpid_interop_test.qit_common import QitTestTypeMap from qpid_interop_test.qit_errors import InteropTestError from qpid_interop_test.qit_jms_types import create_annotation import _compat @@ -125,6 +125,14 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): return True return False + @staticmethod + def merge_dicts(*dict_args): + """Merge two or more dictionaries""" + res = {} + for this_dict in dict_args: + res.update(this_dict) + return res + # TODO: Change this to return a list of messages. That way each test can return more than one message def _create_message(self, test_value_type, test_value, value_num, hdr_kwargs, hdr_annotations): """Create a single message of the appropriate JMS message type""" @@ -154,8 +162,8 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): (test_value, test_value_type)) return proton.Message(id=(self.sent+1), content_type='application/octet-stream', - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_MESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_MESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) def _create_jms_bytesmessage(self, test_value_type, test_value, hdr_kwargs, hdr_annotations): @@ -190,8 +198,8 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): body=body_bytes, inferred=True, content_type='application/octet-stream', - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_BYTESMESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_BYTESMESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) def _create_jms_mapmessage(self, test_value_type, test_value, name, hdr_kwargs, hdr_annotations): @@ -222,8 +230,8 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): return proton.Message(id=(self.sent+1), body={name: value}, inferred=False, - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_MAPMESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_MAPMESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) def _create_jms_objectmessage(self, test_value, hdr_kwargs, hdr_annotations): @@ -233,8 +241,8 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): body=java_binary, inferred=True, content_type='application/x-java-serialized-object', - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_MAPMESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_MAPMESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) @staticmethod @@ -279,16 +287,16 @@ class JmsHdrsPropsTestSender(proton.handlers.MessagingHandler): return proton.Message(id=(self.sent+1), body=body_list, inferred=True, - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_STREAMMESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_STREAMMESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) def _create_jms_textmessage(self, test_value_text, hdr_kwargs, hdr_annotations): """Create a JMS text message""" return proton.Message(id=(self.sent+1), body=_compat.unicode(test_value_text), - annotations=QitTestTypeMap.merge_dicts(create_annotation('JMS_TEXTMESSAGE_TYPE'), - hdr_annotations), + annotations=JmsHdrsPropsTestSender.merge_dicts(create_annotation('JMS_TEXTMESSAGE_TYPE'), + hdr_annotations), **hdr_kwargs) def _get_jms_message_header_kwargs(self): --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org