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
16 changes: 15 additions & 1 deletion pact-python-cli/hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,22 @@ def _sys_tag_platform(self) -> str:
Get the platform tag from the current system tags.

This is used to determine the target platform for the Pact binaries.

On Linux, the generic `linux_{arch}` tag conveys no information about
the platform's C library, so the more specific `manylinux`/`musllinux`
tag is preferred when one is available.

Returns:
The most specific platform tag supported by the current system.
"""
return next(t.platform for t in sys_tags())
platforms = (t.platform for t in sys_tags())
preferred = next(platforms)
if preferred.startswith("linux_"):
return next(
(p for p in platforms if not p.startswith("linux_")),
preferred,
)
return preferred

def _install_ruby_cli(self, version: str) -> Mapping[str, str]:
"""
Expand Down
16 changes: 15 additions & 1 deletion pact-python-ffi/hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,22 @@ def _sys_tag_platform(self) -> str:
Get the platform tag from the current system tags.

This is used to determine the target platform for the Pact library.

On Linux, the generic `linux_{arch}` tag conveys no information about
the platform's C library, so the more specific `manylinux`/`musllinux`
tag is preferred when one is available.

Returns:
The most specific platform tag supported by the current system.
"""
return next(t.platform for t in sys_tags())
platforms = (t.platform for t in sys_tags())
preferred = next(platforms)
if preferred.startswith("linux_"):
return next(
(p for p in platforms if not p.startswith("linux_")),
preferred,
)
return preferred

def _install(self, version: str) -> Mapping[str, str]:
"""
Expand Down