2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
flit-core,
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# tests
|
2024-06-05 15:53:02 +00:00
|
|
|
chex,
|
|
|
|
jaxlib,
|
|
|
|
pytest-subtests,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
yapf,
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# optional
|
2024-06-05 15:53:02 +00:00
|
|
|
jupyter,
|
|
|
|
mediapy,
|
|
|
|
numpy,
|
|
|
|
importlib-resources,
|
|
|
|
typing-extensions,
|
|
|
|
zipp,
|
|
|
|
absl-py,
|
|
|
|
tqdm,
|
|
|
|
dm-tree,
|
|
|
|
jax,
|
|
|
|
tensorflow,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "etils";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.9.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.10";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-+tlQQU8KHKWMcMcJFbABT5lT3ZvPiqlRoPdf+b7L6yQ=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
array-types = enp;
|
2024-06-05 15:53:02 +00:00
|
|
|
eapp = [
|
|
|
|
absl-py # FIXME package simple-parsing
|
|
|
|
] ++ epy;
|
|
|
|
ecolab = [
|
|
|
|
jupyter
|
|
|
|
numpy
|
|
|
|
mediapy
|
|
|
|
] ++ enp ++ epy;
|
2022-08-12 12:06:08 +00:00
|
|
|
edc = epy;
|
|
|
|
enp = [ numpy ] ++ epy;
|
2024-06-05 15:53:02 +00:00
|
|
|
epath = [
|
|
|
|
importlib-resources
|
|
|
|
typing-extensions
|
|
|
|
zipp
|
|
|
|
] ++ epy;
|
2022-08-12 12:06:08 +00:00
|
|
|
epy = [ typing-extensions ];
|
2024-06-05 15:53:02 +00:00
|
|
|
etqdm = [
|
|
|
|
absl-py
|
|
|
|
tqdm
|
|
|
|
] ++ epy;
|
2022-08-12 12:06:08 +00:00
|
|
|
etree = array-types ++ epy ++ enp ++ etqdm;
|
|
|
|
etree-dm = [ dm-tree ] ++ etree;
|
|
|
|
etree-jax = [ jax ] ++ etree;
|
2023-03-24 00:07:29 +00:00
|
|
|
etree-tf = [ tensorflow ] ++ etree;
|
2024-06-05 15:53:02 +00:00
|
|
|
all =
|
|
|
|
array-types
|
|
|
|
++ eapp
|
|
|
|
++ ecolab
|
|
|
|
++ edc
|
|
|
|
++ enp
|
|
|
|
++ epath
|
|
|
|
++ epy
|
|
|
|
++ etqdm
|
|
|
|
++ etree
|
|
|
|
++ etree-dm
|
|
|
|
++ etree-jax
|
|
|
|
++ etree-tf;
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "etils" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
chex
|
|
|
|
jaxlib
|
|
|
|
pytest-subtests
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
yapf
|
2024-10-04 16:56:33 +00:00
|
|
|
] ++ optional-dependencies.all;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_public_access" # requires network access
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
doCheck = false; # error: infinite recursion encountered
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
meta = with lib; {
|
2023-03-24 00:07:29 +00:00
|
|
|
changelog = "https://github.com/google/etils/blob/v${version}/CHANGELOG.md";
|
2024-01-02 11:29:13 +00:00
|
|
|
description = "Collection of eclectic utils";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/google/etils";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ mcwitt ];
|
|
|
|
};
|
|
|
|
}
|