Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c4767899d | ||
|
|
3cd3a9dc77 | ||
|
|
9e40094cfc | ||
|
|
c91d669a90 | ||
|
|
f81c9474d6 | ||
|
|
2610f3220a | ||
|
|
29b0cdb08a | ||
|
|
2b7da3fcbe | ||
|
|
726bcdf372 | ||
|
|
3142806f4b | ||
|
|
e28e43e7f9 |
@@ -17,6 +17,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, windows-latest, macos-latest]
|
os: [ubuntu-18.04, windows-latest, macos-latest]
|
||||||
python_version: ['3.7']
|
python_version: ['3.7']
|
||||||
|
timeout-minutes: 180
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ env:
|
|||||||
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- python3 -m pip install cibuildwheel==1.5.4
|
- python3 -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# build the wheels, put them into './wheelhouse'
|
# build the wheels, put them into './wheelhouse'
|
||||||
@@ -152,6 +152,15 @@ This is similar to static linking, so it might have some licence implications. C
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
### 1.5.5
|
||||||
|
|
||||||
|
_22 July 2020_
|
||||||
|
|
||||||
|
- 🐛 Fix a bug that would cause command substitutions in CIBW_ENVIRONMENT to
|
||||||
|
produce no output on Linux (#411)
|
||||||
|
- 🐛 Fix regression (introduced in 1.5.3) which caused BEFORE_BUILD and
|
||||||
|
BEFORE_ALL to be executed in the wrong directory (#410)
|
||||||
|
|
||||||
### 1.5.4
|
### 1.5.4
|
||||||
|
|
||||||
_19 June 2020_
|
_19 June 2020_
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ jobs:
|
|||||||
|
|
||||||
- job: windows_36
|
- job: windows_36
|
||||||
pool: {vmImage: 'vs2017-win2016'}
|
pool: {vmImage: 'vs2017-win2016'}
|
||||||
|
timeoutInMinutes: 180
|
||||||
steps:
|
steps:
|
||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
inputs:
|
inputs:
|
||||||
@@ -33,6 +34,7 @@ jobs:
|
|||||||
|
|
||||||
- job: windows_38
|
- job: windows_38
|
||||||
pool: {vmImage: 'vs2017-win2016'}
|
pool: {vmImage: 'vs2017-win2016'}
|
||||||
|
timeoutInMinutes: 180
|
||||||
steps:
|
steps:
|
||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = '1.5.4'
|
__version__ = '1.5.5'
|
||||||
|
|||||||
@@ -27,12 +27,14 @@ class DockerContainer:
|
|||||||
bash_stdin: IO[bytes]
|
bash_stdin: IO[bytes]
|
||||||
bash_stdout: IO[bytes]
|
bash_stdout: IO[bytes]
|
||||||
|
|
||||||
def __init__(self, docker_image: str, simulate_32_bit=False):
|
def __init__(self, docker_image: str, simulate_32_bit: bool = False, cwd: Optional[Union[str, PathLike]] = None):
|
||||||
self.docker_image = docker_image
|
self.docker_image = docker_image
|
||||||
self.simulate_32_bit = simulate_32_bit
|
self.simulate_32_bit = simulate_32_bit
|
||||||
|
self.cwd = cwd
|
||||||
|
|
||||||
def __enter__(self) -> 'DockerContainer':
|
def __enter__(self) -> 'DockerContainer':
|
||||||
self.name = f'cibuildwheel-{uuid.uuid4()}'
|
self.name = f'cibuildwheel-{uuid.uuid4()}'
|
||||||
|
cwd_args = ['-w', str(self.cwd)] if self.cwd else []
|
||||||
shell_args = ['linux32', '/bin/bash'] if self.simulate_32_bit else ['/bin/bash']
|
shell_args = ['linux32', '/bin/bash'] if self.simulate_32_bit else ['/bin/bash']
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
@@ -41,6 +43,7 @@ class DockerContainer:
|
|||||||
'--name', self.name,
|
'--name', self.name,
|
||||||
'-i',
|
'-i',
|
||||||
'-v', '/:/host', # ignored on CircleCI
|
'-v', '/:/host', # ignored on CircleCI
|
||||||
|
*cwd_args,
|
||||||
self.docker_image,
|
self.docker_image,
|
||||||
*shell_args
|
*shell_args
|
||||||
],
|
],
|
||||||
@@ -182,7 +185,7 @@ class DockerContainer:
|
|||||||
|
|
||||||
def environment_executor(self, command: List[str], environment: Dict[str, str]) -> str:
|
def environment_executor(self, command: List[str], environment: Dict[str, str]) -> str:
|
||||||
# used as an EnvironmentExecutor to evaluate commands and capture output
|
# used as an EnvironmentExecutor to evaluate commands and capture output
|
||||||
return self.call(command, env=environment)
|
return self.call(command, env=environment, capture_output=True)
|
||||||
|
|
||||||
|
|
||||||
def shell_quote(path: PurePath) -> str:
|
def shell_quote(path: PurePath) -> str:
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ def build(options: BuildOptions) -> None:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with DockerContainer(docker_image, simulate_32_bit=platform_tag.endswith('i686')) as docker:
|
with DockerContainer(docker_image, simulate_32_bit=platform_tag.endswith('i686'), cwd='/project') as docker:
|
||||||
docker.copy_into(Path.cwd(), Path('/project'))
|
docker.copy_into(Path.cwd(), PurePath('/project'))
|
||||||
|
|
||||||
if options.before_all:
|
if options.before_all:
|
||||||
env = docker.get_environment()
|
env = docker.get_environment()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ stack: python 3.7
|
|||||||
init:
|
init:
|
||||||
- cmd: set PATH=C:\Python37;C:\Python37\Scripts;%PATH%
|
- cmd: set PATH=C:\Python37;C:\Python37\Scripts;%PATH%
|
||||||
|
|
||||||
install: python -m pip install cibuildwheel==1.5.4
|
install: python -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
build_script: python -m cibuildwheel --output-dir wheelhouse
|
build_script: python -m cibuildwheel --output-dir wheelhouse
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ jobs:
|
|||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
- bash: |
|
- bash: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip3 install cibuildwheel==1.5.4
|
pip3 install cibuildwheel==1.5.5
|
||||||
cibuildwheel --output-dir wheelhouse .
|
cibuildwheel --output-dir wheelhouse .
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
inputs: {pathtoPublish: 'wheelhouse'}
|
inputs: {pathtoPublish: 'wheelhouse'}
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
- bash: |
|
- bash: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip3 install cibuildwheel==1.5.4
|
pip3 install cibuildwheel==1.5.5
|
||||||
cibuildwheel --output-dir wheelhouse .
|
cibuildwheel --output-dir wheelhouse .
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
inputs: {pathtoPublish: 'wheelhouse'}
|
inputs: {pathtoPublish: 'wheelhouse'}
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
displayName: Install Visual C++ for Python 2.7
|
displayName: Install Visual C++ for Python 2.7
|
||||||
- bash: |
|
- bash: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install cibuildwheel==1.5.4
|
pip install cibuildwheel==1.5.5
|
||||||
cibuildwheel --output-dir wheelhouse .
|
cibuildwheel --output-dir wheelhouse .
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
inputs: {pathtoPublish: 'wheelhouse'}
|
inputs: {pathtoPublish: 'wheelhouse'}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Build the Linux wheels.
|
name: Build the Linux wheels.
|
||||||
command: |
|
command: |
|
||||||
pip3 install --user cibuildwheel==1.5.4
|
pip3 install --user cibuildwheel==1.5.5
|
||||||
cibuildwheel --output-dir wheelhouse
|
cibuildwheel --output-dir wheelhouse
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: wheelhouse/
|
path: wheelhouse/
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Build the OS X wheels.
|
name: Build the OS X wheels.
|
||||||
command: |
|
command: |
|
||||||
pip3 install --user cibuildwheel==1.5.4
|
pip3 install --user cibuildwheel==1.5.5
|
||||||
cibuildwheel --output-dir wheelhouse
|
cibuildwheel --output-dir wheelhouse
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: wheelhouse/
|
path: wheelhouse/
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cibuildwheel
|
- name: Install cibuildwheel
|
||||||
run: |
|
run: |
|
||||||
python -m pip install cibuildwheel==1.5.4
|
python -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
- name: Install Visual C++ for Python 2.7
|
- name: Install Visual C++ for Python 2.7
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cibuildwheel
|
- name: Install cibuildwheel
|
||||||
run: |
|
run: |
|
||||||
python -m pip install cibuildwheel==1.5.4
|
python -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
- name: Install Visual C++ for Python 2.7
|
- name: Install Visual C++ for Python 2.7
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ env:
|
|||||||
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
# Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- python3 -m pip install cibuildwheel==1.5.4
|
- python3 -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# build the wheels, put them into './wheelhouse'
|
# build the wheels, put them into './wheelhouse'
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
|
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- python3 -m pip install cibuildwheel==1.5.4
|
- python3 -m pip install cibuildwheel==1.5.5
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# build the wheels, put them into './wheelhouse'
|
# build the wheels, put them into './wheelhouse'
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- stage: deploy
|
- stage: deploy
|
||||||
name: Build and deploy Linux wheels
|
name: Build and deploy Linux wheels
|
||||||
services: docker
|
services: docker
|
||||||
install: python3 -m pip install cibuildwheel==1.5.4
|
install: python3 -m pip install cibuildwheel==1.5.5
|
||||||
script: python3 -m cibuildwheel --output-dir wheelhouse
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
||||||
after_success: |
|
after_success: |
|
||||||
python3 -m pip install twine
|
python3 -m pip install twine
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
name: Build and deploy macOS wheels
|
name: Build and deploy macOS wheels
|
||||||
os: osx
|
os: osx
|
||||||
language: shell
|
language: shell
|
||||||
install: python3 -m pip install cibuildwheel==1.5.4
|
install: python3 -m pip install cibuildwheel==1.5.5
|
||||||
script: python3 -m cibuildwheel --output-dir wheelhouse
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
||||||
after_success: |
|
after_success: |
|
||||||
python3 -m pip install twine
|
python3 -m pip install twine
|
||||||
@@ -75,7 +75,7 @@ jobs:
|
|||||||
name: Build and deploy Windows wheels
|
name: Build and deploy Windows wheels
|
||||||
os: windows
|
os: windows
|
||||||
language: shell
|
language: shell
|
||||||
install: python3 -m pip install cibuildwheel==1.5.4
|
install: python3 -m pip install cibuildwheel==1.5.5
|
||||||
script: python3 -m cibuildwheel --output-dir wheelhouse
|
script: python3 -m cibuildwheel --output-dir wheelhouse
|
||||||
after_success: |
|
after_success: |
|
||||||
python3 -m pip install twine
|
python3 -m pip install twine
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ long_description = (this_directory / 'README.md').read_text(encoding='utf-8')
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='cibuildwheel',
|
name='cibuildwheel',
|
||||||
version='1.5.4',
|
version='1.5.5',
|
||||||
install_requires=['bashlex!=0.13', 'toml'],
|
install_requires=['bashlex!=0.13', 'toml'],
|
||||||
description="Build Python wheels on CI with minimal configuration.",
|
description="Build Python wheels on CI with minimal configuration.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
|||||||
+28
-3
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import pytest
|
||||||
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
@@ -21,7 +22,7 @@ def test(tmp_path):
|
|||||||
project_dir = tmp_path / 'project'
|
project_dir = tmp_path / 'project'
|
||||||
project_with_before_build_asserts.generate(project_dir)
|
project_with_before_build_asserts.generate(project_dir)
|
||||||
|
|
||||||
with open(os.path.join(project_dir, "text_info.txt"), mode='w') as ff:
|
with (project_dir / 'text_info.txt').open(mode='w') as ff:
|
||||||
print("dummy text", file=ff)
|
print("dummy text", file=ff)
|
||||||
|
|
||||||
# build the wheels
|
# build the wheels
|
||||||
@@ -33,6 +34,30 @@ def test(tmp_path):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# also check that we got the right wheels
|
# also check that we got the right wheels
|
||||||
os.remove(os.path.join(project_dir, "text_info.txt"))
|
(project_dir / 'text_info.txt').unlink()
|
||||||
|
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
||||||
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|
||||||
|
|
||||||
|
def test_failing_command(tmp_path):
|
||||||
|
project_dir = tmp_path / 'project'
|
||||||
|
test_projects.new_c_project().generate(project_dir)
|
||||||
|
|
||||||
|
with pytest.raises(subprocess.CalledProcessError):
|
||||||
|
utils.cibuildwheel_run(project_dir, add_env={
|
||||||
|
'CIBW_BEFORE_ALL': 'false',
|
||||||
|
'CIBW_BEFORE_ALL_WINDOWS': 'exit /b 1',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
def test_cwd(tmp_path):
|
||||||
|
project_dir = tmp_path / 'project'
|
||||||
|
test_projects.new_c_project().generate(project_dir)
|
||||||
|
|
||||||
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
||||||
|
'CIBW_BEFORE_ALL': f'''python -c "import os; assert os.getcwd() == {str(project_dir)!r}"''',
|
||||||
|
'CIBW_BEFORE_ALL_LINUX': '''python -c "import os; assert os.getcwd() == '/project'"''',
|
||||||
|
})
|
||||||
|
|
||||||
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
||||||
assert set(actual_wheels) == set(expected_wheels)
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import pytest
|
||||||
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
@@ -32,14 +34,41 @@ def test(tmp_path):
|
|||||||
project_dir = tmp_path / 'project'
|
project_dir = tmp_path / 'project'
|
||||||
project_with_before_build_asserts.generate(project_dir)
|
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)"''')
|
||||||
|
|
||||||
# build the wheels
|
# build the wheels
|
||||||
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
||||||
# write python version information to a temporary file, this is
|
# write python version information to a temporary file, this is
|
||||||
# checked in setup.py
|
# checked in setup.py
|
||||||
'CIBW_BEFORE_BUILD': '''python -c "import sys; open('/tmp/pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('/tmp/pythonexecutable.txt', 'w').write(sys.executable)"''',
|
'CIBW_BEFORE_BUILD': before_build.format(output_dir='/tmp/'),
|
||||||
'CIBW_BEFORE_BUILD_WINDOWS': '''python -c "import sys; open('c:\\pythonversion.txt', 'w').write(sys.version)" && python -c "import sys; open('c:\\pythonexecutable.txt', 'w').write(sys.executable)"''',
|
'CIBW_BEFORE_BUILD_WINDOWS': before_build.format(output_dir=r'c:\\'),
|
||||||
})
|
})
|
||||||
|
|
||||||
# also check that we got the right wheels
|
# also check that we got the right wheels
|
||||||
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
||||||
assert set(actual_wheels) == set(expected_wheels)
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|
||||||
|
|
||||||
|
def test_failing_command(tmp_path):
|
||||||
|
project_dir = tmp_path / 'project'
|
||||||
|
test_projects.new_c_project().generate(project_dir)
|
||||||
|
|
||||||
|
with pytest.raises(subprocess.CalledProcessError):
|
||||||
|
utils.cibuildwheel_run(project_dir, add_env={
|
||||||
|
'CIBW_BEFORE_BUILD': 'false',
|
||||||
|
'CIBW_BEFORE_BUILD_WINDOWS': 'exit /b 1',
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
def test_cwd(tmp_path):
|
||||||
|
project_dir = tmp_path / 'project'
|
||||||
|
test_projects.new_c_project().generate(project_dir)
|
||||||
|
|
||||||
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
||||||
|
'CIBW_BEFORE_BUILD': f'''python -c "import os; assert os.getcwd() == {str(project_dir)!r}"''',
|
||||||
|
'CIBW_BEFORE_BUILD_LINUX': '''python -c "import os; assert os.getcwd() == '/project'"''',
|
||||||
|
})
|
||||||
|
|
||||||
|
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
||||||
|
assert set(actual_wheels) == set(expected_wheels)
|
||||||
|
|||||||
@@ -13,12 +13,15 @@ project_with_environment_asserts = test_projects.new_c_project(
|
|||||||
# explode if environment isn't correct, as set in CIBW_ENVIRONMENT
|
# explode if environment isn't correct, as set in CIBW_ENVIRONMENT
|
||||||
CIBW_TEST_VAR = os.environ.get("CIBW_TEST_VAR")
|
CIBW_TEST_VAR = os.environ.get("CIBW_TEST_VAR")
|
||||||
CIBW_TEST_VAR_2 = os.environ.get("CIBW_TEST_VAR_2")
|
CIBW_TEST_VAR_2 = os.environ.get("CIBW_TEST_VAR_2")
|
||||||
|
CIBW_TEST_VAR_3 = os.environ.get("CIBW_TEST_VAR_3")
|
||||||
PATH = os.environ.get("PATH")
|
PATH = os.environ.get("PATH")
|
||||||
|
|
||||||
if CIBW_TEST_VAR != "a b c":
|
if CIBW_TEST_VAR != "a b c":
|
||||||
raise Exception('CIBW_TEST_VAR should equal "a b c". It was "%s"' % CIBW_TEST_VAR)
|
raise Exception('CIBW_TEST_VAR should equal "a b c". It was "%s"' % CIBW_TEST_VAR)
|
||||||
if CIBW_TEST_VAR_2 != "1":
|
if CIBW_TEST_VAR_2 != "1":
|
||||||
raise Exception('CIBW_TEST_VAR_2 should equal "1". It was "%s"' % CIBW_TEST_VAR_2)
|
raise Exception('CIBW_TEST_VAR_2 should equal "1". It was "%s"' % CIBW_TEST_VAR_2)
|
||||||
|
if CIBW_TEST_VAR_3 != "test string 3":
|
||||||
|
raise Exception('CIBW_TEST_VAR_3 should equal "test string 3". It was "%s"' % CIBW_TEST_VAR_3)
|
||||||
if "/opt/cibw_test_path" not in PATH:
|
if "/opt/cibw_test_path" not in PATH:
|
||||||
raise Exception('PATH should contain "/opt/cibw_test_path". It was "%s"' % PATH)
|
raise Exception('PATH should contain "/opt/cibw_test_path". It was "%s"' % PATH)
|
||||||
if "$PATH" in PATH:
|
if "$PATH" in PATH:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from pathlib import Path, PurePath
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from cibuildwheel.docker_container import DockerContainer
|
from cibuildwheel.docker_container import DockerContainer
|
||||||
|
from cibuildwheel.environment import EnvironmentAssignment
|
||||||
|
|
||||||
# for these tests we use manylinux2014 images, because they're available on
|
# for these tests we use manylinux2014 images, because they're available on
|
||||||
# multi architectures and include python3.8
|
# multi architectures and include python3.8
|
||||||
@@ -40,6 +41,13 @@ def test_environment():
|
|||||||
assert container.call(['sh', '-c', 'echo $TEST_VAR'], env={'TEST_VAR': '1'}, capture_output=True) == '1\n'
|
assert container.call(['sh', '-c', 'echo $TEST_VAR'], env={'TEST_VAR': '1'}, capture_output=True) == '1\n'
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.docker
|
||||||
|
def test_cwd():
|
||||||
|
with DockerContainer(DEFAULT_IMAGE, cwd='/cibuildwheel/working_directory') as container:
|
||||||
|
assert container.call(['pwd'], capture_output=True) == '/cibuildwheel/working_directory\n'
|
||||||
|
assert container.call(['pwd'], capture_output=True, cwd='/opt') == '/opt\n'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.docker
|
@pytest.mark.docker
|
||||||
def test_container_removed():
|
def test_container_removed():
|
||||||
with DockerContainer(DEFAULT_IMAGE) as container:
|
with DockerContainer(DEFAULT_IMAGE) as container:
|
||||||
@@ -145,3 +153,10 @@ def test_dir_operations(tmp_path: Path):
|
|||||||
container.copy_out(dst_dir, new_test_dir)
|
container.copy_out(dst_dir, new_test_dir)
|
||||||
|
|
||||||
assert test_binary_data == (new_test_dir / 'test.dat').read_bytes()
|
assert test_binary_data == (new_test_dir / 'test.dat').read_bytes()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.docker
|
||||||
|
def test_environment_executor():
|
||||||
|
with DockerContainer(DEFAULT_IMAGE) as container:
|
||||||
|
assignment = EnvironmentAssignment("TEST=$(echo 42)")
|
||||||
|
assert assignment.evaluated_value({}, container.environment_executor) == "42"
|
||||||
|
|||||||
Reference in New Issue
Block a user