d7dbe45cea
GitOrigin-RevId: 9480bae337095fd24f61380bce3174fdfe926a00
38 lines
793 B
Nix
38 lines
793 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, setuptools_scm
|
|
, toml
|
|
, importlib-metadata
|
|
, typing
|
|
, singledispatch
|
|
, pythonOlder
|
|
, python
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "importlib_resources";
|
|
version = "1.5.0";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "1jilyxyb2z7hzcjhx1ddni52mq00i728wqh8f5k4469yhdkdz1vg";
|
|
};
|
|
|
|
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;
|
|
};
|
|
}
|