From e3ef92660abea2b36d41e2de04890224f23fd856 Mon Sep 17 00:00:00 2001 From: Fabre Florian Date: Tue, 13 Feb 2018 15:08:45 +0100 Subject: Fix MANIFEST.in to exclude rabbitmq-c/ and add behaviour of make target 'rabbit-c' in setup.py for usage in source dist --- MANIFEST.in | 12 +++++++----- setup.py | 26 +++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 971ccec..8dc7d92 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,8 +9,10 @@ include setup.cfg recursive-include librabbitmq * recursive-include Modules * recursive-include tests * -prune *.pyc -prune *.o -prune *.la -prune *.so -prune *.dylib +prune rabbitmq-c/ +exclude *.pyc +exclude *.o +exclude *.la +exclude *.so +exclude *.dylib +exclude Makefile diff --git a/setup.py b/setup.py index ec00de9..fe4c397 100644 --- a/setup.py +++ b/setup.py @@ -104,6 +104,8 @@ def create_builder(): here = os.path.abspath(os.getcwd()) config = sysconfig.get_config_vars() + make = find_make() + try: vars = {'ld': config['LDFLAGS'], 'c': config['CFLAGS']} @@ -117,8 +119,23 @@ def create_builder(): ('CFLAGS', vars['c']), ('LDFLAGS', vars['ld']), ) + try: + if not os.path.isdir(os.path.join(LRMQDIST(), '.git')): + print('- pull submodule rabbitmq-c...') + if os.path.isfile('Makefile'): + os.system(' '.join([make, 'submodules'])) + else: + os.system(' '.join(['git', 'clone', '-b', 'v0.8.0', + 'https://github.com/alanxz/rabbitmq-c.git', + 'rabbitmq-c'])) + os.chdir(LRMQDIST()) + + if not os.path.isfile('configure'): + print('- autoreconf') + os.system('autoreconf -i') + if not os.path.isfile('config.h'): print('- configure rabbitmq-c...') if os.system('/bin/sh configure --disable-tools \ @@ -187,7 +204,14 @@ if 'install' in sys.argv and 'build' not in sys.argv: sys.argv[:] = ( sys.argv[:_index] + ['build', 'install'] + sys.argv[_index + 1:] ) - + +# 'bdist_egg doesn't always call build for some reason +if 'bdist_wheel' in sys.argv and 'build' not in sys.argv: + _index = sys.argv.index('bdist_wheel') + sys.argv[:] = ( + sys.argv[:_index] + ['build', 'bdist_wheel'] + sys.argv[_index + 1:] + ) + # 'bdist_egg doesn't always call build for some reason if 'bdist_egg' in sys.argv and 'build' not in sys.argv: _index = sys.argv.index('bdist_egg') -- cgit v1.2.1 From dbf12e0d088a932b5e64889499ccc7cfd969c0d2 Mon Sep 17 00:00:00 2001 From: Fabre Florian Date: Tue, 13 Feb 2018 15:10:28 +0100 Subject: Fix a comment --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fe4c397..37b7e82 100644 --- a/setup.py +++ b/setup.py @@ -205,7 +205,7 @@ if 'install' in sys.argv and 'build' not in sys.argv: sys.argv[:_index] + ['build', 'install'] + sys.argv[_index + 1:] ) -# 'bdist_egg doesn't always call build for some reason +# 'bdist_wheel doesn't always call build for some reason if 'bdist_wheel' in sys.argv and 'build' not in sys.argv: _index = sys.argv.index('bdist_wheel') sys.argv[:] = ( -- cgit v1.2.1