PROTON-885: allow pip to set the install path for proton
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a117035e Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a117035e Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a117035e Branch: refs/heads/0.9.x Commit: a117035e4a14ecf6d9a07f99966abd8efcaab6b7 Parents: ae6309f Author: Flavio Percoco <[email protected]> Authored: Wed May 27 13:11:14 2015 -0400 Committer: Ken Giusti <[email protected]> Committed: Wed May 27 13:15:38 2015 -0400 ---------------------------------------------------------------------- proton-c/bindings/python/setup.py | 12 +++++++----- proton-c/bindings/python/setuputils/bundle.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a117035e/proton-c/bindings/python/setup.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/setup.py b/proton-c/bindings/python/setup.py index e61edc7..09fa76a 100755 --- a/proton-c/bindings/python/setup.py +++ b/proton-c/bindings/python/setup.py @@ -133,7 +133,9 @@ class Configure(build_ext): description = "Discover Qpid Proton version" def bundle_libqpid_proton_extension(self): - bundledir = "bundled" + base = self.get_finalized_command('build').build_base + install = self.get_finalized_command('install').install_base + bundledir = os.path.join(base, "bundled") ext_modules = self.distribution.ext_modules log.info("Using bundled libqpid-proton") @@ -154,7 +156,7 @@ class Configure(build_ext): # is in `distutils.sysconfig.PREFIX` and finally, disable testing # as well. The python binding will be built by this script later # on. Don't let cmake do it. - extra_compile_args = ['-DCMAKE_INSTALL_PREFIX:PATH=%s' % ds_sys.PREFIX, + extra_compile_args = ['-DCMAKE_INSTALL_PREFIX:PATH=%s' % install, '-DBUILD_PYTHON=False', '-DBUILD_JAVA=False', '-DBUILD_PERL=False', @@ -168,6 +170,7 @@ class Configure(build_ext): # NOTE(flaper87): Register this new extension and make # sure it's built and installed *before* `_cproton`. self.distribution.ext_modules.insert(0, libqpid_proton) + return install def set_cproton_settings(self, prefix=None): settings = misc.settings_from_prefix(prefix) @@ -191,8 +194,7 @@ class Configure(build_ext): def run(self): prefix = None if self.bundle_proton: - self.bundle_libqpid_proton_extension() - prefix = ds_sys.PREFIX + prefix = self.bundle_libqpid_proton_extension() self.set_cproton_settings(prefix) @@ -204,7 +206,7 @@ cmdclass = {'configure': Configure, setup(name='python-qpid-proton', - version=bundle.min_qpid_proton_str, + version=bundle.bundled_version_str, description='An AMQP based messaging library.', author='Apache Qpid', author_email='[email protected]', http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a117035e/proton-c/bindings/python/setuputils/bundle.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/setuputils/bundle.py b/proton-c/bindings/python/setuputils/bundle.py index 46b1821..1a2010f 100644 --- a/proton-c/bindings/python/setuputils/bundle.py +++ b/proton-c/bindings/python/setuputils/bundle.py @@ -36,7 +36,7 @@ min_qpid_proton = (0,9,1) min_qpid_proton_str = "%i.%i.%i" % min_qpid_proton bundled_version = (0,9,1) -bundled_version_str = "%i.%i.%i" % (0,9,1) +bundled_version_str = "%i.%i.%i" % bundled_version libqpid_proton = "qpid-proton-%s.tar.gz" % bundled_version_str libqpid_proton_url = ("http://www.apache.org/dist/qpid/proton/%s/%s" % (bundled_version_str, libqpid_proton)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
