Skip to content

Commit

Permalink
tests: skip uv on the dep constraints tests
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Jun 7, 2024
1 parent 319ea4d commit f1a6af4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 8 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ def pytest_addoption(parser) -> None:
@pytest.fixture(
params=[{"CIBW_BUILD_FRONTEND": "pip"}, {"CIBW_BUILD_FRONTEND": "build"}], ids=["pip", "build"]
)
def build_frontend_env(request) -> dict[str, str]:
def build_frontend_env_nouv(request) -> dict[str, str]:
if platform == "pyodide":
pytest.skip("Can't use pip as build frontend for pyodide platform")

if request.param["CIBW_BUILD_FRONTEND"] == "build" and find_uv() is not None:
return request.param # type: ignore[no-any-return]


@pytest.fixture()
def build_frontend_env(build_frontend_env_nouv: dict[str, str]) -> dict[str, str]:
if build_frontend_env_nouv["CIBW_BUILD_FRONTEND"] == "build" and find_uv() is not None:
return {"CIBW_BUILD_FRONTEND": "build[uv]"}

return request.param # type: ignore[no-any-return]
return build_frontend_env_nouv


@pytest.fixture()
Expand Down
10 changes: 6 additions & 4 deletions test/test_dependency_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_versions_from_constraint_file(constraint_file):


@pytest.mark.parametrize("python_version", ["3.6", "3.8", "3.10"])
def test_pinned_versions(tmp_path, python_version, build_frontend_env):
def test_pinned_versions(tmp_path, python_version, build_frontend_env_nouv):
if utils.platform == "linux":
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")
if python_version == "3.6" and utils.platform == "macos" and platform.machine() == "arm64":
Expand All @@ -79,7 +79,7 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env):
add_env={
"CIBW_BUILD": build_pattern,
"CIBW_ENVIRONMENT": cibw_environment_option,
**build_frontend_env,
**build_frontend_env_nouv,
},
)

Expand All @@ -93,21 +93,23 @@ def test_pinned_versions(tmp_path, python_version, build_frontend_env):
assert set(actual_wheels) == set(expected_wheels)


def test_dependency_constraints_file(tmp_path, build_frontend_env):
def test_dependency_constraints_file(tmp_path, build_frontend_env_nouv):
if utils.platform == "linux":
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")

project_dir = tmp_path / "project"
project_with_expected_version_checks.generate(project_dir)

tool_versions = {
"pip": "23.1.2",
"delocate": "0.10.3",
}

constraints_file = tmp_path / "constraints file.txt"
constraints_file.write_text(
textwrap.dedent(
"""
pip=={pip}
delocate=={delocate}
""".format(**tool_versions)
)
Expand All @@ -128,7 +130,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env):
"CIBW_ENVIRONMENT": cibw_environment_option,
"CIBW_DEPENDENCY_VERSIONS": str(constraints_file),
"CIBW_SKIP": "cp36-*",
**build_frontend_env,
**build_frontend_env_nouv,
},
)

Expand Down

0 comments on commit f1a6af4

Please sign in to comment.