From 374e88382bdbd306b3347a34f3dc6291de4f535e Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 8 Jun 2020 10:19:02 +0200 Subject: [PATCH] move abspath to system specific files --- cibuildwheel/__main__.py | 2 +- cibuildwheel/macos.py | 4 +++- cibuildwheel/windows.py | 4 +++- unit_test/main_tests/conftest.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index ce8555cf..95bc96b9 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -118,7 +118,7 @@ def main() -> None: test_command = get_option_from_environment('CIBW_TEST_COMMAND', platform=platform) test_requires = get_option_from_environment('CIBW_TEST_REQUIRES', platform=platform, default='').split() test_extras = get_option_from_environment('CIBW_TEST_EXTRAS', platform=platform, default='') - package_dir = os.path.abspath(args.package_dir) + package_dir = args.package_dir before_build = get_option_from_environment('CIBW_BEFORE_BUILD', platform=platform) build_verbosity_str = get_option_from_environment('CIBW_BUILD_VERBOSITY', platform=platform, default='') build_config, skip_config = os.environ.get('CIBW_BUILD', '*'), os.environ.get('CIBW_SKIP', '') diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 745c1557..96e874f9 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -194,7 +194,9 @@ def build(options: BuildOptions) -> None: if os.path.exists(built_wheel_dir): shutil.rmtree(built_wheel_dir) os.makedirs(built_wheel_dir) - call(['pip', 'wheel', options.package_dir, '-w', built_wheel_dir, '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env) + # os.path.abspath is need. Without it pip wheel may try to fetch package from pypi.org + # see https://github.com/joerick/cibuildwheel/pull/369 + call(['pip', 'wheel', os.path.abspath(options.package_dir), '-w', built_wheel_dir, '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env) built_wheel = glob(os.path.join(built_wheel_dir, '*.whl'))[0] # repair the wheel diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 9f33ad91..7feb2998 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -180,7 +180,9 @@ def build(options: BuildOptions) -> None: if os.path.exists(built_wheel_dir): shutil.rmtree(built_wheel_dir) os.makedirs(built_wheel_dir) - shell(['pip', 'wheel', options.package_dir, '-w', built_wheel_dir, '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env) + # os.path.abspath is need. Without it pip wheel may try to fetch package from pypi.org + # see https://github.com/joerick/cibuildwheel/pull/369 + shell(['pip', 'wheel', os.path.abspath(options.package_dir), '-w', built_wheel_dir, '--no-deps'] + get_build_verbosity_extra_flags(options.build_verbosity), env=env) built_wheel = glob(os.path.join(built_wheel_dir, '*.whl'))[0] # repair the wheel diff --git a/unit_test/main_tests/conftest.py b/unit_test/main_tests/conftest.py index 4542b9df..cd896915 100644 --- a/unit_test/main_tests/conftest.py +++ b/unit_test/main_tests/conftest.py @@ -18,7 +18,7 @@ class ArgsInterceptor: self.kwargs = kwargs -MOCK_PACKAGE_DIR = os.path.abspath('some_package_dir') +MOCK_PACKAGE_DIR = 'some_package_dir' @pytest.fixture(autouse=True)