depot/third_party/nixpkgs/pkgs/development/python-modules/optree/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

54 lines
1.1 KiB
Nix

{
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
lib,
cmake,
setuptools,
typing-extensions,
pybind11,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "optree";
version = "0.12.1";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "metaopt";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-4GvB9Z7qnEjsUSl+x5wd8czV80F50MwJdlNdylUU0zY=";
};
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;
};
}