From ccfc3c3aa1eabd85040014252f85de862f820420 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Thu, 29 Nov 2018 23:20:38 +0100 Subject: [PATCH] Fixing indentation error, and keeping only check for setup.py in project root directory in __main__.py --- cibuildwheel/__main__.py | 20 ++------------------ test/03_before_build/setup.py | 1 + test/05_environment/setup.py | 2 ++ 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 84372395..d680e9b8 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -105,24 +105,8 @@ def main(): # This needs to be passed on to the docker container in linux.py os.environ['CIBUILDWHEEL'] = '1' - try: - project_setup_py = os.path.join(project_dir, 'setup.py') - name_output = subprocess.check_output([sys.executable, project_setup_py, '--name'], - universal_newlines=True) - # the last line of output is the name - package_name = name_output.strip().splitlines()[-1] - except subprocess.CalledProcessError as err: - if not os.path.exists(project_setup_py): - print('cibuildwheel: Could not find setup.py at root of project', file=sys.stderr) - exit(2) - else: - print(err.output) - print('cibuildwheel: Failed to get name of the package. Command was %s' % err.cmd, - file=sys.stderr) - exit(err.returncode) - if package_name == '' or package_name == 'UNKNOWN': - print('cibuildwheel: Invalid package name "%s". Check your setup.py' % package_name, - file=sys.stderr) + if not os.path.exists(os.path.join(project_dir, 'setup.py')): + print('cibuildwheel: Could not find setup.py at root of project', file=sys.stderr) exit(2) build_options = dict( diff --git a/test/03_before_build/setup.py b/test/03_before_build/setup.py index aea796af..b7b802fe 100644 --- a/test/03_before_build/setup.py +++ b/test/03_before_build/setup.py @@ -9,6 +9,7 @@ with open(version_file) as f: print('stored_version', stored_version) print('sys.version', sys.version) assert stored_version == sys.version + # check that the executable also was written executable_file = 'c:\\pythonexecutable.txt' if sys.platform == 'win32' else '/tmp/pythonexecutable.txt' with open(executable_file) as f: diff --git a/test/05_environment/setup.py b/test/05_environment/setup.py index 40b2c197..61abd814 100644 --- a/test/05_environment/setup.py +++ b/test/05_environment/setup.py @@ -5,6 +5,7 @@ import sys, os CIBW_TEST_VAR = os.environ.get('CIBW_TEST_VAR') CIBW_TEST_VAR_2 = os.environ.get('CIBW_TEST_VAR_2') PATH = os.environ.get('PATH') + if CIBW_TEST_VAR != 'a b c': raise Exception('CIBW_TEST_VAR should equal "a b c". It was "%s"' % CIBW_TEST_VAR) if CIBW_TEST_VAR_2 != '1': @@ -14,6 +15,7 @@ if '/opt/cibw_test_path' not in PATH: if '$PATH' in PATH: raise Exception('$PATH should be expanded in PATH. It was "%s"' % PATH) + setup( name="spam", ext_modules=[Extension('spam', sources=['spam.c'])],