From 4e15e202c8a12812a5691725757ff9d0258c0ee3 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Tue, 2 Jun 2020 20:03:04 +0100 Subject: [PATCH] style- inline function --- cibuildwheel/__main__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 4706a2a3..95bc96b9 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -161,8 +161,9 @@ def main() -> None: # This needs to be passed on to the docker container in linux.py os.environ['CIBUILDWHEEL'] = '1' - if not is_python_project(package_dir): - print('cibuildwheel: Could not find setup.py at root of package', file=sys.stderr) + if not any(os.path.exists(os.path.join(package_dir, name)) + for name in ["setup.py", "setup.cfg", "pyproject.toml"]): + print('cibuildwheel: Could not find setup.py, setup.cfg or pyproject.toml at root of package', file=sys.stderr) exit(2) if args.print_build_identifiers: @@ -309,12 +310,5 @@ def detect_warnings(platform: str, build_options: BuildOptions) -> List[str]: return warnings -def is_python_project(package_dir: str) -> bool: - return any( - os.path.exists(os.path.join(package_dir, name)) - for name in ["setup.py", "setup.cfg", "pyproject.toml"] - ) - - if __name__ == '__main__': main()