Files
nixpkgs/pkgs/development/python-modules/etils/default.nix
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00

113 lines
2.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
flit-core,
# tests
chex,
jaxlib,
pytest-subtests,
pytest-xdist,
pytestCheckHook,
yapf,
# optional
jupyter,
mediapy,
numpy,
importlib-resources,
typing-extensions,
zipp,
absl-py,
tqdm,
dm-tree,
jax,
tensorflow,
}:
buildPythonPackage rec {
pname = "etils";
version = "1.12.2";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchPypi {
inherit pname version;
hash = "sha256-xrnh8M5m0bv1T5kgGwimC6OW00RtnrGNS8ObJqLhpe4=";
};
nativeBuildInputs = [ flit-core ];
optional-dependencies = rec {
array-types = enp;
eapp = [
absl-py # FIXME package simple-parsing
] ++ epy;
ecolab =
[
jupyter
numpy
mediapy
]
++ enp
++ epy;
edc = epy;
enp = [ numpy ] ++ epy;
epath = [
importlib-resources
typing-extensions
zipp
] ++ epy;
epy = [ typing-extensions ];
etqdm = [
absl-py
tqdm
] ++ epy;
etree = array-types ++ epy ++ enp ++ etqdm;
etree-dm = [ dm-tree ] ++ etree;
etree-jax = [ jax ] ++ etree;
etree-tf = [ tensorflow ] ++ etree;
all =
array-types
++ eapp
++ ecolab
++ edc
++ enp
++ epath
++ epy
++ etqdm
++ etree
++ etree-dm
++ etree-jax
++ etree-tf;
};
pythonImportsCheck = [ "etils" ];
nativeCheckInputs = [
chex
jaxlib
pytest-subtests
pytest-xdist
pytestCheckHook
yapf
] ++ optional-dependencies.all;
disabledTests = [
"test_public_access" # requires network access
];
doCheck = false; # error: infinite recursion encountered
meta = with lib; {
changelog = "https://github.com/google/etils/blob/v${version}/CHANGELOG.md";
description = "Collection of eclectic utils";
homepage = "https://github.com/google/etils";
license = licenses.asl20;
maintainers = with maintainers; [ mcwitt ];
};
}