diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index 6e895836..69a06c04 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 da31b1af..c625b39a 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/test/test_subdir_package.py b/test/test_subdir_package.py index 53bd9520..98b1b8cd 100644 --- a/test/test_subdir_package.py +++ b/test/test_subdir_package.py @@ -35,7 +35,7 @@ def test(capfd, tmp_path): project_dir = tmp_path / 'project' subdir_package_project.generate(project_dir) - package_dir = os.path.join(project_dir, 'src', 'spam') + package_dir = os.path.join('src', 'spam') # build the wheels actual_wheels = utils.cibuildwheel_run(project_dir, package_dir=package_dir, add_env={ 'CIBW_BEFORE_BUILD': 'python {project}/bin/before_build.py',