From c67de74e286389080d07dabd3fc12276f724d0c8 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Sun, 22 Nov 2020 23:39:18 +0100 Subject: [PATCH 1/2] Demonstrate old version of Python in CIBW_BEFORE_ALL on manylinux --- test/test_before_all.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_before_all.py b/test/test_before_all.py index 73d36ff6..5df4f722 100644 --- a/test/test_before_all.py +++ b/test/test_before_all.py @@ -26,10 +26,12 @@ def test(tmp_path): print("dummy text", file=ff) # build the wheels + before_all_command = '''python -c "import os;open('{project}/text_info.txt', 'w').write('sample text '+os.environ.get('TEST_VAL', ''))"''' actual_wheels = utils.cibuildwheel_run(project_dir, add_env={ # write python version information to a temporary file, this is # checked in setup.py - 'CIBW_BEFORE_ALL': '''python -c "import os;open('{project}/text_info.txt', 'w').write('sample text '+os.environ.get('TEST_VAL', ''))"''', + 'CIBW_BEFORE_ALL': before_all_command, + 'CIBW_BEFORE_ALL_LINUX': before_all_command + ''' && python -c "import sys; assert sys.version_info >= (3, 6)"''', 'CIBW_ENVIRONMENT': "TEST_VAL='123'" }) From 6f3fcf8b126f8a39cf76361fda60b9dff08b4290 Mon Sep 17 00:00:00 2001 From: Yannick Jadoul Date: Mon, 23 Nov 2020 00:49:32 +0100 Subject: [PATCH 2/2] Fix PATH of CPython 3.8 binary for CIBW_BEFORE_ALL --- cibuildwheel/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index e601a8cf..d1ca37fa 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -122,7 +122,7 @@ def build(options: BuildOptions) -> None: if options.before_all: env = docker.get_environment() - env['PATH'] = f'/opt/python/cp38-cp38:{env["PATH"]}' + env['PATH'] = f'/opt/python/cp38-cp38/bin:{env["PATH"]}' env = options.environment.as_dictionary(env, executor=docker.environment_executor) before_all_prepared = prepare_command(options.before_all, project=container_project_path, package=container_package_dir)