Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that pip check does not fail due to bad platform tag #10755

Merged
merged 10 commits into from
Aug 28, 2024
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
6 changes: 3 additions & 3 deletions python-package/hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
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):
Expand Down
5 changes: 3 additions & 2 deletions python-package/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
requires = [
"hatchling>=1.12.1"
"hatchling>=1.12.1",
"packaging>=21.3",
]
backend-path = ["."]
build-backend = "packager.pep517"
Expand Down Expand Up @@ -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]
Expand Down
10 changes: 4 additions & 6 deletions tests/buildkite/remove_nccl_dep.patch
Original file line number Diff line number Diff line change
@@ -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'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note to reviewers, GitHub PR diffs of patches can look confusing

Would recommend looking at the patch on Hyunsu's fork (also included below)

This is just dropping the nvidia-nccl-cu12 line

diff --git python-package/pyproject.toml python-package/pyproject.toml
index 20d3f9974..953087ff4 100644
--- python-package/pyproject.toml
+++ python-package/pyproject.toml
@@ -30,7 +30,6 @@ classifiers = [
 dependencies = [
     "numpy",
     "scipy",
-    "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'",
 ]
 
 [project.urls]

]

[project.urls]
Loading