Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@ authors = [
name = "ITKPythonPackage"
version = "0.1.0"
channels = ["conda-forge"]
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
platforms = [
"linux-64",
"linux-aarch64",
"osx-arm64",
"win-64",
{ name = "linux-64-manylinux228", platform = "linux-64", glibc = "2.28", linux = "5.4" },
{ name = "linux-aarch64-manylinux228", platform = "linux-aarch64", glibc = "2.28", linux = "5.4" },
{ name = "osx-arm64-macos14", platform = "osx-arm64", macos = "14.0" },
]

########################################
# Common features used by all envs
########################################

# The default environment's platforms; the named entries above are for builds
[feature.host-platforms]
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]


# Build tooling shared by all platforms
[feature.build-dev-tools]
[feature.build-dev-tools.dependencies]
Expand Down Expand Up @@ -83,11 +96,7 @@ texlive-core = "*" # bibtex, for Doxygen \cite in wrapping docstrings
wheel = "*"

[feature.manylinux228-build]
platforms = ["linux-64", "linux-aarch64"]

[feature.manylinux228-build.system-requirements]
linux = "5.4"
libc = { family = "glibc", version = "2.28" }
platforms = ["linux-64-manylinux228", "linux-aarch64-manylinux228"]

[feature.linux-build.activation.env]
PYTHONNOUSERSITE = "1" # Exclude system .local site packages
Expand All @@ -97,8 +106,7 @@ PYTHONNOUSERSITE = "1" # Exclude system .local site packages
########################################

[feature.macosx-build]
platforms = ["osx-arm64"]
system-requirements = { macos = "14.0" }
platforms = ["osx-arm64-macos14"]

# delocate is a Python tool; cxx-compiler is the macOS toolchain meta-package
[feature.macosx-build.pypi-dependencies]
Expand Down Expand Up @@ -130,6 +138,7 @@ python = ">=3.11,<3.12"
# Publishing feature (no compilers needed)
########################################
[feature.publish]
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
[feature.publish.dependencies]
python = ">=3.11"
gh = "*"
Expand All @@ -144,6 +153,7 @@ twine = ">=6.0"
# Never referenced by any build environment.
########################################
[feature.dev]
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
[feature.dev.dependencies]
python = ">=3.11"
pytest = ">=8"
Expand All @@ -159,6 +169,7 @@ description = "Run the developer unit test suite"
########################################

[environments]
default = ["host-platforms"]
publish = ["publish"]
dev = ["py311", "dev"]
linux-py311 = ["py311", "linux-build", "build-dev-tools", "python-dev-pkgs"]
Expand Down
13 changes: 8 additions & 5 deletions tests/test_target_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,20 @@ def test_macos_wheel_plat_tag_is_installable_on_arm64() -> None:
def test_pixi_macos_system_requirement_matches_the_deployment_target() -> None:
"""pixi.toml is the third copy of the macOS version; bind it too.

``system-requirements = { macos = "14.0" }`` under
``[feature.macosx-build]`` must agree with
The ``macos`` virtual package on the workspace platform that
``[feature.macosx-build]`` uses must agree with
``target_platform._MACOSX_DEPLOYMENT_TARGET``, or the cached ITK build
and the wheel tag disagree.
"""
pixi_toml = Path(__file__).resolve().parent.parent / "pixi.toml"
config = tomllib.loads(pixi_toml.read_text())
macos_requirement = config["feature"]["macosx-build"]["system-requirements"][
"macos"
(platform_name,) = config["feature"]["macosx-build"]["platforms"]
(platform_entry,) = [
entry
for entry in config["workspace"]["platforms"]
if isinstance(entry, dict) and entry.get("name") == platform_name
]
assert macos_requirement.replace(".", "_") == _MACOSX_DEPLOYMENT_TARGET
assert platform_entry["macos"].replace(".", "_") == _MACOSX_DEPLOYMENT_TARGET


@pytest.mark.parametrize(
Expand Down
Loading