Skip to content

Commit 67e41f4

Browse files
authored
Merge pull request #194 from xhochy/fix-wheel-tag
Mark Python wheels as any platform
2 parents 5902bbc + 62e13ac commit 67e41f4

File tree

3 files changed

+33
-52
lines changed

3 files changed

+33
-52
lines changed

recipe/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set name = "xgboost" %}
22
{% set version = "2.1.1" %}
3-
{% set build_number = 3 %}
3+
{% set build_number = 4 %}
44
{% set min_python = "3.9" %}
55

66
{% set string_prefix = "cuda" ~ (cuda_compiler_version | replace('.', '')) if (cuda_compiler_version or "None") != "None" else "cpu" %}
@@ -16,7 +16,7 @@ source:
1616
# xgboost patches
1717
- patches/0001-Enable-latest-libcxx-on-MacOS.patch # [osx]
1818
- patches/0002-Remove-nvidia-nccl-cu12-from-pyproject.toml.patch
19-
- patches/0003-Use-correct-platform-tag-from-Pip.patch
19+
- patches/0003-Mark-wheels-as-any-platform-compatible.patch
2020

2121
build:
2222
number: {{ build_number }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 3cff598144b2843b21eeccb42075f47c84127bb7 Mon Sep 17 00:00:00 2001
2+
From: "Uwe L. Korn" <[email protected]>
3+
Date: Sat, 28 Sep 2024 21:12:02 +0200
4+
Subject: [PATCH 3/3] Mark wheels as any platform compatible
5+
6+
---
7+
python-package/hatch_build.py | 4 +---
8+
1 file changed, 1 insertion(+), 3 deletions(-)
9+
10+
diff --git a/python-package/hatch_build.py b/python-package/hatch_build.py
11+
index 925c917..710530c 100644
12+
--- a/python-package/hatch_build.py
13+
+++ b/python-package/hatch_build.py
14+
@@ -3,7 +3,6 @@ Custom hook to customize the behavior of Hatchling.
15+
Here, we customize the tag of the generated wheels.
16+
"""
17+
18+
-import sysconfig
19+
from typing import Any, Dict
20+
21+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
22+
@@ -11,8 +10,7 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
23+
24+
def get_tag() -> str:
25+
"""Get appropriate wheel tag according to system"""
26+
- tag_platform = sysconfig.get_platform().replace("-", "_").replace(".", "_")
27+
- return f"py3-none-{tag_platform}"
28+
+ return f"py3-none-any"
29+
30+
31+
class CustomBuildHook(BuildHookInterface):

recipe/patches/0003-Use-correct-platform-tag-from-Pip.patch

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)