depot/third_party/nixpkgs/pkgs/development/python-modules/importlib-resources/default.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

38 lines
805 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, setuptools_scm
, toml
, importlib-metadata
, typing
, singledispatch
, pythonOlder
, python
}:
buildPythonPackage rec {
pname = "importlib_resources";
version = "3.3.1";
src = fetchPypi {
inherit pname version;
sha256 = "0ed250dbd291947d1a298e89f39afcc477d5a6624770503034b72588601bcc05";
};
nativeBuildInputs = [ setuptools_scm toml ];
propagatedBuildInputs = [
importlib-metadata
] ++ lib.optional (pythonOlder "3.4") singledispatch
++ lib.optional (pythonOlder "3.5") typing
;
checkPhase = ''
${python.interpreter} -m unittest discover
'';
meta = with lib; {
description = "Read resources from Python packages";
homepage = "https://importlib-resources.readthedocs.io/";
license = licenses.asl20;
};
}