2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-01-03 16:56:52 +00:00
|
|
|
, isPy27
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-05-03 20:48:10 +00:00
|
|
|
, setuptools-scm
|
2020-06-18 07:06:33 +00:00
|
|
|
, importlib-metadata
|
2021-04-26 19:14:03 +00:00
|
|
|
, typing ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-05-03 20:48:10 +00:00
|
|
|
pname = "importlib-resources";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "5.6.0";
|
|
|
|
format = "pyproject";
|
2022-01-03 16:56:52 +00:00
|
|
|
disabled = isPy27;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2021-05-03 20:48:10 +00:00
|
|
|
pname = "importlib_resources";
|
|
|
|
inherit version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-G5MjjL8jtM3jQkDdgyHZnpvy60vJHAyZsohig+e6rYU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-06-18 07:06:33 +00:00
|
|
|
importlib-metadata
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optional (pythonOlder "3.5") [
|
|
|
|
typing
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"importlib_resources"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Read resources from Python packages";
|
|
|
|
homepage = "https://importlib-resources.readthedocs.io/";
|
|
|
|
license = licenses.asl20;
|
2021-05-03 20:48:10 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|