diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index c574b442..79509dd7 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -76,7 +76,9 @@ def main(): try: project_setup_py = os.path.join(project_dir, 'setup.py') - package_name = subprocess.check_output([sys.executable, project_setup_py, '--name']) + name_output = subprocess.check_output([sys.executable, project_setup_py, '--name']) + # 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) @@ -86,8 +88,6 @@ def main(): file=sys.stderr) exit(2) - package_name = package_name.strip() - if package_name == '' or package_name == 'UNKNOWN': print('cibuildwheel: Invalid package name "%s". Check your setup.py' % package_name, file=sys.stderr)