Files
nixpkgs/pkgs/development/python-modules/optree/default.nix
Martin Weinelt e38884895d python3Packages.optree: 0.14.1 -> 0.17.0
https://github.com/metaopt/optree/releases

This commit was automatically generated using update-python-libraries.
2025-08-09 19:02:10 +02:00

59 lines
1.3 KiB
Nix

{
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
lib,
cmake,
setuptools,
typing-extensions,
pybind11,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "optree";
version = "0.17.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "metaopt";
repo = "optree";
tag = "v${version}";
hash = "sha256-4ZkUdGF+Fauy6KWbyrGQ684Ay5XlFT2S2I9lv/1KeWs=";
};
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"
# optree import during tests raises CalledProcessError
"test_warn_deprecated_import"
"test_import_no_warnings"
"test_treespec_construct"
];
pythonImportsCheck = [ "optree" ];
meta = {
description = "Optimized PyTree Utilities";
homepage = "https://github.com/metaopt/optree";
changelog = "https://github.com/metaopt/optree/releases";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pandapip1 ];
};
}