2018-11-21 12:19:56 +01:00
|
|
|
{ lib
|
2021-12-31 09:10:25 +01:00
|
|
|
, isPy27
|
2018-11-21 12:19:56 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-04-28 17:38:29 +02:00
|
|
|
, setuptools-scm
|
2020-06-04 05:40:59 +02:00
|
|
|
, importlib-metadata
|
2021-03-25 08:23:40 +01:00
|
|
|
, typing ? 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 17:38:29 +02:00
|
|
|
pname = "importlib-resources";
|
2022-03-31 01:05:09 +02:00
|
|
|
version = "5.6.0";
|
2022-04-02 02:57:49 +02:00
|
|
|
format = "pyproject";
|
2021-12-31 09:10:25 +01:00
|
|
|
disabled = isPy27;
|
2018-11-21 12:19:56 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2021-04-28 17:38:29 +02:00
|
|
|
pname = "importlib_resources";
|
|
|
|
inherit version;
|
2022-03-31 01:05:09 +02:00
|
|
|
sha256 = "sha256-G5MjjL8jtM3jQkDdgyHZnpvy60vJHAyZsohig+e6rYU=";
|
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 05:40:59 +02:00
|
|
|
importlib-metadata
|
2021-10-31 00:16:55 +02:00
|
|
|
] ++ 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-04-01 03:11:51 +02:00
|
|
|
homepage = "https://importlib-resources.readthedocs.io/";
|
2018-11-21 12:19:56 +01:00
|
|
|
license = licenses.asl20;
|
2021-04-28 17:38:29 +02:00
|
|
|
maintainers = [ ];
|
2018-11-21 12:19:56 +01:00
|
|
|
};
|
2020-04-01 03:11:51 +02:00
|
|
|
}
|