2018-11-21 11:19:56 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-06-04 04:40:59 +01:00
|
|
|
, setuptools_scm
|
|
|
|
, toml
|
|
|
|
, importlib-metadata
|
2018-11-21 11:19:56 +00:00
|
|
|
, typing
|
2020-06-04 04:40:59 +01:00
|
|
|
, singledispatch
|
2018-11-21 11:19:56 +00:00
|
|
|
, pythonOlder
|
2018-12-27 08:22:53 +00:00
|
|
|
, python
|
2018-11-21 11:19:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "importlib_resources";
|
2020-06-04 04:40:59 +01:00
|
|
|
version = "1.5.0";
|
2018-11-21 11:19:56 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-04 04:40:59 +01:00
|
|
|
sha256 = "1jilyxyb2z7hzcjhx1ddni52mq00i728wqh8f5k4469yhdkdz1vg";
|
2018-11-21 11:19:56 +00:00
|
|
|
};
|
|
|
|
|
2020-06-04 04:40:59 +01:00
|
|
|
nativeBuildInputs = [ setuptools_scm toml ];
|
2018-11-21 11:19:56 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-06-04 04:40:59 +01:00
|
|
|
importlib-metadata
|
|
|
|
] ++ lib.optional (pythonOlder "3.4") singledispatch
|
2018-11-21 11:19:56 +00:00
|
|
|
++ lib.optional (pythonOlder "3.5") typing
|
|
|
|
;
|
|
|
|
|
2018-12-27 08:22:53 +00:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
2018-11-21 11:19:56 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Read resources from Python packages";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://importlib-resources.readthedocs.io/";
|
2018-11-21 11:19:56 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
2020-04-01 02:11:51 +01:00
|
|
|
}
|