2018-11-21 12:19:56 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-04-28 18:38:29 +03:00
|
|
|
, setuptools-scm
|
2020-06-04 03:40:59 +00:00
|
|
|
, importlib-metadata
|
2021-03-25 08:23:40 +01:00
|
|
|
, typing ? null
|
|
|
|
, singledispatch ? null
|
2018-11-21 12:19:56 +01:00
|
|
|
, pythonOlder
|
2018-12-27 09:22:53 +01:00
|
|
|
, python
|
2018-11-21 12:19:56 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-04-28 18:38:29 +03:00
|
|
|
pname = "importlib-resources";
|
2021-10-31 00:16:55 +02:00
|
|
|
version = "5.4.0";
|
2018-11-21 12:19:56 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2021-04-28 18:38:29 +03:00
|
|
|
pname = "importlib_resources";
|
|
|
|
inherit version;
|
2021-10-31 00:16:55 +02:00
|
|
|
sha256 = "sha256-11bi+F3U3iuom+CyHboqO77C6HGkKjoWcZJYoR+HUGs=";
|
2018-11-21 12:19:56 +01:00
|
|
|
};
|
|
|
|
|
2021-10-31 00:16:55 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2018-11-21 12:19:56 +01:00
|
|
|
propagatedBuildInputs = [
|
2020-06-04 03:40:59 +00:00
|
|
|
importlib-metadata
|
2021-10-31 00:16:55 +02:00
|
|
|
] ++ lib.optional (pythonOlder "3.4") [
|
|
|
|
singledispatch
|
|
|
|
] ++ lib.optional (pythonOlder "3.5") [
|
|
|
|
typing
|
|
|
|
];
|
2018-11-21 12:19:56 +01:00
|
|
|
|
2018-12-27 09:22:53 +01:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
2018-11-21 12:19:56 +01:00
|
|
|
|
2021-10-31 00:16:55 +02:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"importlib_resources"
|
|
|
|
];
|
|
|
|
|
2018-11-21 12:19:56 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Read resources from Python packages";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "https://importlib-resources.readthedocs.io/";
|
2018-11-21 12:19:56 +01:00
|
|
|
license = licenses.asl20;
|
2021-04-28 18:38:29 +03:00
|
|
|
maintainers = [ ];
|
2018-11-21 12:19:56 +01:00
|
|
|
};
|
2020-03-31 21:11:51 -04:00
|
|
|
}
|