1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-20 16:39:31 +03:00

python312Packages.dm-tree: 0.1.8 -> 0.1.9 (#378247)

This commit is contained in:
Gaétan Lepage 2025-01-31 22:05:30 +01:00 committed by GitHub
commit c45e04423d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,7 @@
{ {
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchpatch,
fetchFromGitHub, fetchFromGitHub,
stdenv,
# nativeBuildInputs # nativeBuildInputs
cmake, cmake,
@ -15,41 +13,35 @@
# build-system # build-system
setuptools, setuptools,
# checks # dependencies
absl-py, absl-py,
attrs, attrs,
numpy, numpy,
wrapt, wrapt,
}: }:
let
patchCMakeAbseil = fetchpatch {
name = "0001-don-t-rebuild-abseil.patch";
url = "https://raw.githubusercontent.com/conda-forge/dm-tree-feedstock/93a91aa2c13240cecf88133e2885ade9121b464a/recipe/patches/0001-don-t-rebuild-abseil.patch";
hash = "sha256-bho7lXAV5xHkPmWy94THJtx+6i+px5w6xKKfThvBO/M=";
};
patchCMakePybind = fetchpatch {
name = "0002-don-t-fetch-pybind11.patch";
url = "https://raw.githubusercontent.com/conda-forge/dm-tree-feedstock/93a91aa2c13240cecf88133e2885ade9121b464a/recipe/patches/0002-don-t-fetch-pybind11.patch";
hash = "sha256-41XIouQ4Fm1yewaxK9erfcnkGBS6vgdvMm/DyF0rsKg=";
};
in
buildPythonPackage rec { buildPythonPackage rec {
pname = "dm-tree"; pname = "dm-tree";
version = "0.1.8"; version = "0.1.9";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "deepmind"; owner = "deepmind";
repo = "tree"; repo = "tree";
tag = version; tag = version;
hash = "sha256-VvSJTuEYjIz/4TTibSLkbg65YmcYqHImTHOomeorMJc="; hash = "sha256-cHuaqA89r90TCPVHNP7B1cfK+WxqmfTXndJ/dRdmM24=";
}; };
patches = [ # Allows to forward cmake args through the conventional `cmakeFlags`
patchCMakeAbseil postPatch = ''
patchCMakePybind substituteInPlace setup.py \
] ++ (lib.optional stdenv.hostPlatform.isDarwin ./0003-don-t-configure-apple.patch); --replace-fail \
"cmake_args = [" \
'cmake_args = [ *os.environ.get("cmakeFlags", "").split(),'
'';
cmakeFlags = [
(lib.cmakeBool "USE_SYSTEM_ABSEIL" true)
(lib.cmakeBool "USE_SYSTEM_PYBIND11" true)
];
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
nativeBuildInputs = [ nativeBuildInputs = [
@ -64,7 +56,9 @@ buildPythonPackage rec {
build-system = [ setuptools ]; build-system = [ setuptools ];
nativeCheckInputs = [ # It is unclear whether those are runtime dependencies or simply test dependencies
# https://github.com/google-deepmind/tree/issues/127
dependencies = [
absl-py absl-py
attrs attrs
numpy numpy