2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonAtLeast,
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build
|
|
|
|
setuptools,
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# runtime
|
|
|
|
packaging,
|
|
|
|
typing-extensions,
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytest-timeout,
|
|
|
|
pytest7CheckHook,
|
2023-01-20 10:41:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "lightning-utilities";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.11.2";
|
|
|
|
pyproject = true;
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Lightning-AI";
|
|
|
|
repo = "utilities";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-IT9aRAUNc2cP2erLr0MglZSVLfDjOxg8PVIIe9AvO0o=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2023-01-20 10:41:00 +00:00
|
|
|
packaging
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "lightning_utilities" ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
pytest-timeout
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest7CheckHook
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"lightning_utilities.core.enums.StrEnum"
|
|
|
|
"lightning_utilities.core.imports.RequirementCache"
|
|
|
|
"lightning_utilities.core.imports.compare_version"
|
|
|
|
"lightning_utilities.core.imports.get_dependency_min_version_spec"
|
2023-03-15 16:39:30 +00:00
|
|
|
# weird doctests fail on imports, but providing the dependency
|
|
|
|
# fails another test
|
|
|
|
"lightning_utilities.core.imports.ModuleAvailableCache"
|
|
|
|
"lightning_utilities.core.imports.requires"
|
2024-05-15 15:35:15 +00:00
|
|
|
# Failed: DID NOT RAISE <class 'AssertionError'>
|
|
|
|
"test_no_warning_call"
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"docs"
|
2023-03-24 00:07:29 +00:00
|
|
|
# doctests that expect docs.txt in the wrong location
|
|
|
|
"src/lightning_utilities/install/requirements.py"
|
|
|
|
];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# warns about distutils removal in python 3.12
|
2024-06-05 15:53:02 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
changelog = "https://github.com/Lightning-AI/utilities/releases/tag/v${version}";
|
|
|
|
description = "Common Python utilities and GitHub Actions in Lightning Ecosystem";
|
|
|
|
homepage = "https://github.com/Lightning-AI/utilities";
|
|
|
|
license = licenses.asl20;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ GaetanLepage ];
|
|
|
|
broken = pythonAtLeast "3.12";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
}
|