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";
|
2021-02-20 09:09:10 +00:00
|
|
|
version = "3.3.1";
|
2018-11-21 11:19:56 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-02-20 09:09:10 +00:00
|
|
|
sha256 = "0ed250dbd291947d1a298e89f39afcc477d5a6624770503034b72588601bcc05";
|
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
|
|
|
}
|