2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
# build
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, packaging
|
|
|
|
, typing-extensions
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytest-timeout
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "lightning-utilities";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.9.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Lightning-AI";
|
|
|
|
repo = "utilities";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-vSeHtvsIt4L4qJCVlTPVjIjd62+08JWBnr9+9+ujOfw=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"lightning_utilities"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
pytest-timeout
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
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
|
|
|
|
"-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;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|