Skip to content

Commit f297140

Browse files
authored
Merge pull request #317 from BRAINSia/pixi-platforms
COMP: Replace deprecated pixi system-requirements with rich platforms
2 parents 7fdcc06 + d692b8f commit f297140

3 files changed

Lines changed: 33 additions & 19 deletions

File tree

‎pixi.lock‎

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pixi.toml‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,25 @@ authors = [
1818
name = "ITKPythonPackage"
1919
version = "0.1.0"
2020
channels = ["conda-forge"]
21-
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
21+
platforms = [
22+
"linux-64",
23+
"linux-aarch64",
24+
"osx-arm64",
25+
"win-64",
26+
{ name = "linux-64-manylinux228", platform = "linux-64", glibc = "2.28", linux = "5.4" },
27+
{ name = "linux-aarch64-manylinux228", platform = "linux-aarch64", glibc = "2.28", linux = "5.4" },
28+
{ name = "osx-arm64-macos14", platform = "osx-arm64", macos = "14.0" },
29+
]
2230

2331
########################################
2432
# Common features used by all envs
2533
########################################
2634

35+
# The default environment's platforms; the named entries above are for builds
36+
[feature.host-platforms]
37+
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
38+
39+
2740
# Build tooling shared by all platforms
2841
[feature.build-dev-tools]
2942
[feature.build-dev-tools.dependencies]
@@ -83,11 +96,7 @@ texlive-core = "*" # bibtex, for Doxygen \cite in wrapping docstrings
8396
wheel = "*"
8497

8598
[feature.manylinux228-build]
86-
platforms = ["linux-64", "linux-aarch64"]
87-
88-
[feature.manylinux228-build.system-requirements]
89-
linux = "5.4"
90-
libc = { family = "glibc", version = "2.28" }
99+
platforms = ["linux-64-manylinux228", "linux-aarch64-manylinux228"]
91100

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

99108
[feature.macosx-build]
100-
platforms = ["osx-arm64"]
101-
system-requirements = { macos = "14.0" }
109+
platforms = ["osx-arm64-macos14"]
102110

103111
# delocate is a Python tool; cxx-compiler is the macOS toolchain meta-package
104112
[feature.macosx-build.pypi-dependencies]
@@ -130,6 +138,7 @@ python = ">=3.11,<3.12"
130138
# Publishing feature (no compilers needed)
131139
########################################
132140
[feature.publish]
141+
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
133142
[feature.publish.dependencies]
134143
python = ">=3.11"
135144
gh = "*"
@@ -144,6 +153,7 @@ twine = ">=6.0"
144153
# Never referenced by any build environment.
145154
########################################
146155
[feature.dev]
156+
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "win-64"]
147157
[feature.dev.dependencies]
148158
python = ">=3.11"
149159
pytest = ">=8"
@@ -159,6 +169,7 @@ description = "Run the developer unit test suite"
159169
########################################
160170

161171
[environments]
172+
default = ["host-platforms"]
162173
publish = ["publish"]
163174
dev = ["py311", "dev"]
164175
linux-py311 = ["py311", "linux-build", "build-dev-tools", "python-dev-pkgs"]

‎tests/test_target_platform.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,20 @@ def test_macos_wheel_plat_tag_is_installable_on_arm64() -> None:
223223
def test_pixi_macos_system_requirement_matches_the_deployment_target() -> None:
224224
"""pixi.toml is the third copy of the macOS version; bind it too.
225225
226-
``system-requirements = { macos = "14.0" }`` under
227-
``[feature.macosx-build]`` must agree with
226+
The ``macos`` virtual package on the workspace platform that
227+
``[feature.macosx-build]`` uses must agree with
228228
``target_platform._MACOSX_DEPLOYMENT_TARGET``, or the cached ITK build
229229
and the wheel tag disagree.
230230
"""
231231
pixi_toml = Path(__file__).resolve().parent.parent / "pixi.toml"
232232
config = tomllib.loads(pixi_toml.read_text())
233-
macos_requirement = config["feature"]["macosx-build"]["system-requirements"][
234-
"macos"
233+
(platform_name,) = config["feature"]["macosx-build"]["platforms"]
234+
(platform_entry,) = [
235+
entry
236+
for entry in config["workspace"]["platforms"]
237+
if isinstance(entry, dict) and entry.get("name") == platform_name
235238
]
236-
assert macos_requirement.replace(".", "_") == _MACOSX_DEPLOYMENT_TARGET
239+
assert platform_entry["macos"].replace(".", "_") == _MACOSX_DEPLOYMENT_TARGET
237240

238241

239242
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)