pythonPackages.optree: init 0.11.0

(cherry picked from commit 254a66bf4e)
This commit is contained in:
Pandapip1
2024-05-10 11:00:51 -05:00
committed by nicoo
parent 8ac3898662
commit 53ee3b2cf7
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, lib
, cmake
, setuptools
, typing-extensions
, pybind11
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "optree";
version = "0.11.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "metaopt";
repo = pname;
rev = "v${version}";
hash = "sha256-VnnnEoXkYJO+S7baH+JZvsW18Tk3TiY9+Cd230OlZWo=";
};
dontUseCmakeConfigure = true;
propagatedBuildInputs = [
typing-extensions
];
nativeBuildInputs = [
setuptools
pybind11
cmake
];
nativeCheckInputs = [
pytestCheckHook
];
# prevent import failures from pytest
preCheck = ''
rm -r optree
'';
disabledTests = [
# Fails because the 'test_treespec' module can't be found
"test_treespec_pickle_missing_registration"
];
pythonImportsCheck = [
"optree"
];
meta = with lib; {
homepage = "https://github.com/metaopt/optree";
changelog = "https://github.com/metaopt/optree/releases/tag/v${version}";
description = "Optimized PyTree Utilities";
maintainers = with maintainers; [ pandapip1 ];
license = licenses.asl20;
};
}

View File

@@ -8620,6 +8620,8 @@ self: super: with self; {
optimum = callPackage ../development/python-modules/optimum { };
optree = callPackage ../development/python-modules/optree { };
optuna = callPackage ../development/python-modules/optuna { };
opuslib = callPackage ../development/python-modules/opuslib { };