Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Feb 3, 2024
1 parent 662cd61 commit 91ec139
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:

- name: Test cibuildwheel
run: |
python ./bin/run_tests.py --run-podman --num-processes ${{ runner.os == 'macOS' && '2' || '4' }}
python ./bin/run_tests.py --run-podman --num-processes ${{ runner.os == 'macOS' && '3' || '4' }}
test-emulated:
name: Test emulated cibuildwheel using qemu
Expand Down
10 changes: 5 additions & 5 deletions test/test_before_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
r"""
import os
# assert that the Python version as written to pythonversion.txt in the CIBW_BEFORE_BUILD step
# assert that the Python version as written to pythonversion_bb.txt in the CIBW_BEFORE_BUILD step
# is the same one as is currently running.
version_file = 'c:\\pythonversion.txt' if sys.platform == 'win32' else '/tmp/pythonversion.txt'
version_file = 'c:\\pythonversion_bb.txt' if sys.platform == 'win32' else '/tmp/pythonversion_bb.txt'
with open(version_file) as f:
stored_version = f.read()
print('stored_version', stored_version)
print('sys.version', sys.version)
assert stored_version == sys.version
# check that the executable also was written
executable_file = 'c:\\pythonexecutable.txt' if sys.platform == 'win32' else '/tmp/pythonexecutable.txt'
executable_file = 'c:\\pythonexecutable_bb.txt' if sys.platform == 'win32' else '/tmp/pythonexecutable_bb.txt'
with open(executable_file) as f:
stored_executable = f.read()
print('stored_executable', stored_executable)
Expand All @@ -44,8 +44,8 @@ def test(tmp_path):
project_with_before_build_asserts.generate(project_dir)

before_build = (
"""python -c "import sys; open('{output_dir}pythonversion.txt', 'w').write(sys.version)" && """
'''python -c "import sys; open('{output_dir}pythonexecutable.txt', 'w').write(sys.executable)"'''
"""python -c "import sys; open('{output_dir}pythonversion_bb.txt', 'w').write(sys.version)" && """
'''python -c "import sys; open('{output_dir}pythonexecutable_bb.txt', 'w').write(sys.executable)"'''
)

# build the wheels
Expand Down
10 changes: 5 additions & 5 deletions test/test_before_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
class TestBeforeTest(TestCase):
def test_version(self):
# assert that the Python version as written to pythonversion.txt in the CIBW_BEFORE_TEST step
# assert that the Python version as written to pythonversion_bt.txt in the CIBW_BEFORE_TEST step
# is the same one as is currently running.
# because of use symlinks in MacOS run this test is also need
version_file = 'c:\\pythonversion.txt' if sys.platform == 'win32' else '/tmp/pythonversion.txt'
version_file = 'c:\\pythonversion_bt.txt' if sys.platform == 'win32' else '/tmp/pythonversion_bt.txt'
with open(version_file) as f:
stored_version = f.read()
print('stored_version', stored_version)
Expand All @@ -23,7 +23,7 @@ def test_version(self):
def test_prefix(self):
# check that the prefix also was written
prefix_file = 'c:\\pythonprefix.txt' if sys.platform == 'win32' else '/tmp/pythonprefix.txt'
prefix_file = 'c:\\pythonprefix_bt.txt' if sys.platform == 'win32' else '/tmp/pythonprefix_bt.txt'
with open(prefix_file) as f:
stored_prefix = f.read()
print('stored_prefix', stored_prefix)
Expand All @@ -47,8 +47,8 @@ def test(tmp_path):
add_env={
# write python version information to a temporary file, this is
# checked in setup.py
"CIBW_BEFORE_TEST": """python -c "import sys; open('/tmp/pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('/tmp/pythonprefix.txt', 'w').write(sys.prefix)" && python -m pip install {project}/dependency""",
"CIBW_BEFORE_TEST_WINDOWS": """python -c "import sys; open('c:\\pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('c:\\pythonprefix.txt', 'w').write(sys.prefix)" && python -m pip install {project}/dependency""",
"CIBW_BEFORE_TEST": """python -c "import sys; open('/tmp/pythonversion_bt.txt', 'w').write(sys.version)" && python -c "import sys; open('/tmp/pythonprefix_bt.txt', 'w').write(sys.prefix)" && python -m pip install {project}/dependency""",
"CIBW_BEFORE_TEST_WINDOWS": """python -c "import sys; open('c:\\pythonversion_bt.txt', 'w').write(sys.version)" && python -c "import sys; open('c:\\pythonprefix_bt.txt', 'w').write(sys.prefix)" && python -m pip install {project}/dependency""",
"CIBW_TEST_REQUIRES": "pytest",
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
Expand Down

0 comments on commit 91ec139

Please sign in to comment.