From fe3cf0e8786c7dc05e1deced3a1c92cd79094735 Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Mon, 26 Aug 2024 14:33:01 -0700 Subject: [PATCH] Remove custom tag generation --- python-package/hatch_build.py | 23 ----------------------- python-package/packager/pep517.py | 2 -- python-package/pyproject.toml | 2 -- 3 files changed, 27 deletions(-) delete mode 100644 python-package/hatch_build.py diff --git a/python-package/hatch_build.py b/python-package/hatch_build.py deleted file mode 100644 index 925c917b967f..000000000000 --- a/python-package/hatch_build.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -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 - - -def get_tag() -> str: - """Get appropriate wheel tag according to system""" - tag_platform = sysconfig.get_platform().replace("-", "_").replace(".", "_") - return f"py3-none-{tag_platform}" - - -class CustomBuildHook(BuildHookInterface): - """A custom build hook""" - - def initialize(self, version: str, build_data: Dict[str, Any]) -> None: - """This step ccurs immediately before each build.""" - build_data["tag"] = get_tag() diff --git a/python-package/packager/pep517.py b/python-package/packager/pep517.py index d2e671fb6872..52321e3be512 100644 --- a/python-package/packager/pep517.py +++ b/python-package/packager/pep517.py @@ -70,7 +70,6 @@ def build_wheel( logger.info("Copying project files to temporary directory %s", str(workspace)) copy_with_logging(TOPLEVEL_DIR / "pyproject.toml", workspace, logger=logger) - copy_with_logging(TOPLEVEL_DIR / "hatch_build.py", workspace, logger=logger) copy_with_logging(TOPLEVEL_DIR / "README.rst", workspace, logger=logger) pkg_path = workspace / "xgboost" @@ -116,7 +115,6 @@ def build_sdist( logger.info("Copying project files to temporary directory %s", str(workspace)) copy_with_logging(TOPLEVEL_DIR / "pyproject.toml", workspace, logger=logger) - copy_with_logging(TOPLEVEL_DIR / "hatch_build.py", workspace, logger=logger) copy_with_logging(TOPLEVEL_DIR / "README.rst", workspace, logger=logger) copytree_with_logging( diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index 4a76b39e1597..c4b6cec45c6a 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -44,8 +44,6 @@ datatable = ["datatable"] plotting = ["graphviz", "matplotlib"] pyspark = ["pyspark", "scikit-learn", "cloudpickle"] -[tool.hatch.build.targets.wheel.hooks.custom] - [tool.isort] profile = "black"