diff --git a/python-package/hatch_build.py b/python-package/hatch_build.py index 925c917b9..d81a21cd5 100644 --- a/python-package/hatch_build.py +++ b/python-package/hatch_build.py @@ -3,16 +3,16 @@ Custom hook to customize the behavior of Hatchling. Here, we customize the tag of the generated wheels. """ -import sysconfig from typing import Any, Dict from hatchling.builders.hooks.plugin.interface import BuildHookInterface +from packaging.tags import platform_tags def get_tag() -> str: """Get appropriate wheel tag according to system""" - tag_platform = sysconfig.get_platform().replace("-", "_").replace(".", "_") - return f"py3-none-{tag_platform}" + platform_tag = next(platform_tags()) + return f"py3-none-{platform_tag}" class CustomBuildHook(BuildHookInterface): diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index 4a76b39e1..367f77147 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ - "hatchling>=1.12.1" + "hatchling>=1.12.1", + "packaging>=21.3", ] backend-path = ["."] build-backend = "packager.pep517" @@ -29,7 +30,7 @@ classifiers = [ dependencies = [ "numpy", "scipy", - "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'" + "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'", ] [project.urls] diff --git a/tests/buildkite/remove_nccl_dep.patch b/tests/buildkite/remove_nccl_dep.patch index a2a4a5c88..c5a8fe3ac 100644 --- a/tests/buildkite/remove_nccl_dep.patch +++ b/tests/buildkite/remove_nccl_dep.patch @@ -1,14 +1,12 @@ diff --git python-package/pyproject.toml python-package/pyproject.toml -index 8835def25..46c1451c2 100644 +index 20d3f9974..953087ff4 100644 --- python-package/pyproject.toml +++ python-package/pyproject.toml -@@ -30,8 +30,7 @@ classifiers = [ - ] +@@ -30,7 +30,6 @@ classifiers = [ dependencies = [ "numpy", -- "scipy", -- "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'" -+ "scipy" + "scipy", +- "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'", ] [project.urls]