-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: include manylinux, minor redesign
- Loading branch information
Showing
5 changed files
with
177 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
[tool.cibuildwheel.global] | ||
[tool.cibuildwheel] | ||
build = "*" | ||
skip = "" | ||
test-skip = "" | ||
output-dir = "wheelhouse" | ||
|
||
|
||
[tool.cibuildwheel.manylinux] | ||
x86_64-image = "manylinux2010" | ||
i686-image = "manylinux2010" | ||
pypy_x86_64-image = "manylinux2010" | ||
aarch64-image = "manylinux2014" | ||
ppc64le-image = "manylinux2014" | ||
s390x-image = "manylinux2014" | ||
|
||
archs = "auto" | ||
|
||
[tool.cibuildwheel.global] | ||
archs = "auto" | ||
dependency-versions = "pinned" | ||
environment = "" | ||
build-verbosity = "" | ||
|
||
before-all = "" | ||
before-build = "" | ||
|
||
repair-command = "" | ||
|
||
dependency-versions = "pinned" | ||
repair-wheel-command = "" | ||
|
||
test-command = "" | ||
before-test = "" | ||
test-requires = "" | ||
test-extras = "" | ||
|
||
build-verbosity = "" | ||
|
||
|
||
[tool.cibuildwheel.linux] | ||
repair-command = "auditwheel repair -w {dest_dir} {wheel}" | ||
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" | ||
|
||
[tool.cibuildwheel.macos] | ||
repair-command = "delocate-listdeps {wheel} && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}" | ||
repair-wheel-command = "delocate-listdeps {wheel} && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}" | ||
|
||
[tool.cibuildwheel.windows] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import pytest | ||
|
||
from cibuildwheel.options import ConfigNamespace, ConfigOptions | ||
|
||
PYPROJECT_1 = """ | ||
[tool.cibuildwheel] | ||
build = "cp39*" | ||
[tool.cibuildwheel.manylinux] | ||
x86_64-image = "manylinux1" | ||
[tool.cibuildwheel.global] | ||
test-command = "pyproject" | ||
test-requires = "something" | ||
[tool.cibuildwheel.macos] | ||
test-requires = "else" | ||
[tool.cibuildwheel.linux] | ||
test-requires = "other" | ||
""" | ||
|
||
|
||
@pytest.fixture(params=["linux", "macos", "windows"]) | ||
def platform(request): | ||
return request.param | ||
|
||
|
||
def test_simple_settings(tmp_path, platform): | ||
with tmp_path.joinpath("pyproject.toml").open("w") as f: | ||
f.write(PYPROJECT_1) | ||
|
||
options = ConfigOptions(tmp_path, platform=platform) | ||
|
||
assert options("build", namespace=ConfigNamespace.MAIN) == "cp39*" | ||
assert options("output-dir", namespace=ConfigNamespace.MAIN) == "wheelhouse" | ||
|
||
assert options("test-command") == "pyproject" | ||
assert options("archs") == "auto" | ||
assert ( | ||
options("test-requires") | ||
== {"windows": "something", "macos": "else", "linux": "other"}[platform] | ||
) | ||
|
||
assert options("x86_64-image", namespace=ConfigNamespace.MANYLINUX) == "manylinux1" | ||
assert options("i686-image", namespace=ConfigNamespace.MANYLINUX) == "manylinux2010" | ||
|
||
|
||
def test_envvar_override(tmp_path, platform, monkeypatch): | ||
monkeypatch.setenv("CIBW_BUILD", "cp38*") | ||
monkeypatch.setenv("CIBW_MANYLINUX_X86_64_IMAGE", "manylinux2014") | ||
monkeypatch.setenv("CIBW_TEST_COMMAND", "mytest") | ||
monkeypatch.setenv("CIBW_TEST_REQUIRES", "docs") | ||
monkeypatch.setenv("CIBW_TEST_REQUIRES_LINUX", "scod") | ||
|
||
with tmp_path.joinpath("pyproject.toml").open("w") as f: | ||
f.write(PYPROJECT_1) | ||
|
||
options = ConfigOptions(tmp_path, platform=platform) | ||
|
||
assert options("archs") == "auto" | ||
|
||
assert options("build", namespace=ConfigNamespace.MAIN) == "cp38*" | ||
assert options("x86_64-image", namespace=ConfigNamespace.MANYLINUX) == "manylinux2014" | ||
assert options("i686-image", namespace=ConfigNamespace.MANYLINUX) == "manylinux2010" | ||
|
||
assert ( | ||
options("test-requires") == {"windows": "docs", "macos": "docs", "linux": "scod"}[platform] | ||
) | ||
assert options("test-command") == "mytest" |