2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
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
|
2024-07-27 06:49:29 +00:00
|
|
|
looseversion,
|
2024-06-05 15:53:02 +00:00
|
|
|
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-10-11 05:15:48 +00:00
|
|
|
version = "0.11.8";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Lightning-AI";
|
|
|
|
repo = "utilities";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-1npXzPqasgtI5KLq791hfneKFO5GrSiRdqfRd13//6M=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/lightning_utilities/install/requirements.py \
|
|
|
|
--replace-fail "from distutils.version import LooseVersion" "from looseversion import LooseVersion"
|
|
|
|
'';
|
|
|
|
|
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 = [
|
2024-07-27 06:49:29 +00:00
|
|
|
looseversion
|
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
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
meta = {
|
2023-01-20 10:41:00 +00:00
|
|
|
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";
|
2024-07-01 15:47:52 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
}
|