@@ -36,16 +36,19 @@ def test(tmp_path):
36
36
with (project_dir / "text_info.txt" ).open (mode = "w" ) as ff :
37
37
print ("dummy text" , file = ff )
38
38
39
- # build the wheels
39
+ # write python version information to a temporary file, this is checked in
40
+ # setup.py
41
+ #
42
+ # note, before_all runs in whatever the host environment is, `python`
43
+ # might be any version of python (even Python 2 on Travis ci!), so this is
44
+ # written to be broadly compatible
40
45
before_all_command = (
41
- """python -c "import os, pathlib, sys; pathlib.Path ('{project}/text_info.txt').write_text ('sample text '+os.environ.get('TEST_VAL', ''))" && """
42
- '''python -c "import pathlib, sys; pathlib.Path ('{project}/python_prefix.txt').write_text (sys.prefix)"'''
46
+ """python -c "import os, sys; f = open ('{project}/text_info.txt', 'w'); f.write ('sample text '+os.environ.get('TEST_VAL', '')); f.close( )" && """
47
+ '''python -c "import sys; f = open ('{project}/python_prefix.txt', 'w'); f.write (sys.prefix); f.close( )"'''
43
48
)
44
49
actual_wheels = utils .cibuildwheel_run (
45
50
project_dir ,
46
51
add_env = {
47
- # write python version information to a temporary file, this is
48
- # checked in setup.py
49
52
"CIBW_BEFORE_ALL" : before_all_command ,
50
53
"CIBW_BEFORE_ALL_LINUX" : f'{ before_all_command } && python -c "import sys; assert sys.version_info >= (3, 8)"' ,
51
54
"CIBW_ENVIRONMENT" : "TEST_VAL='123'" ,
0 commit comments