From 07ed3ff369faf94568c31bf41b05f87d82df9ead Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 21 Jul 2022 19:41:54 +0200 Subject: [PATCH] python3Packages.etils: init at 0.6.0 --- .../python-modules/etils/default.nix | 89 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 91 insertions(+) create mode 100644 pkgs/development/python-modules/etils/default.nix diff --git a/pkgs/development/python-modules/etils/default.nix b/pkgs/development/python-modules/etils/default.nix new file mode 100644 index 000000000000..25f956480681 --- /dev/null +++ b/pkgs/development/python-modules/etils/default.nix @@ -0,0 +1,89 @@ +{ 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 = "0.6.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-ZnckEFGDXQ2xHElHvK2Tj1e1HqECKQYk+JLx5OUbcOU="; + }; + + nativeBuildInputs = [ + flit-core + ]; + + passthru.optional-dependencies = rec { + array-types = enp; + 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 ] ++ etree; + all = array-types ++ ecolab ++ edc ++ enp ++ epath ++ epy ++ etqdm + ++ etree ++ etree-dm ++ etree-jax ++ etree-tf; + }; + + doCheck = false; # disable tests until https://github.com/NixOS/nixpkgs/issues/185273 is resolved + + pythonImportsCheck = [ + "etils" + ]; + + checkInputs = [ + chex + jaxlib + pytest-subtests + pytest-xdist + pytestCheckHook + yapf + ] + ++ passthru.optional-dependencies.all; + + disabledTests = [ + "test_repr" # known to fail on Python 3.10, see https://github.com/google/etils/issues/143 + "test_public_access" # requires network access + "test_resource_path" # known to fail on Python 3.10, see https://github.com/google/etils/issues/143 + ]; + + meta = with lib; { + description = "Collection of eclectic utils for python"; + homepage = "https://github.com/google/etils"; + license = licenses.asl20; + maintainers = with maintainers; [ mcwitt ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 00bdc71c0ee9..6baa37bbb771 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2900,6 +2900,8 @@ in { eth-utils = callPackage ../development/python-modules/eth-utils { }; + etils = callPackage ../development/python-modules/etils { }; + etuples = callPackage ../development/python-modules/etuples { }; et_xmlfile = callPackage ../development/python-modules/et_xmlfile { };