depot/third_party/nixpkgs/pkgs/development/python-modules/importlib-resources/default.nix
Default email 9405df4a82 Project import generated by Copybara.
GitOrigin-RevId: 8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17
2021-04-26 15:14:03 -04:00

38 lines
819 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, setuptools_scm
, toml
, importlib-metadata
, typing ? null
, singledispatch ? null
, pythonOlder
, python
}:
buildPythonPackage rec {
pname = "importlib_resources";
version = "5.1.2";
src = fetchPypi {
inherit pname version;
sha256 = "642586fc4740bd1cad7690f836b3321309402b20b332529f25617ff18e8e1370";
};
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;
};
}