2018-11-21 12:19:56 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-06-04 03:40:59 +00:00
|
|
|
, setuptools_scm
|
|
|
|
, toml
|
|
|
|
, 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 {
|
|
|
|
pname = "importlib_resources";
|
2021-03-12 19:12:22 +00:00
|
|
|
version = "5.1.2";
|
2018-11-21 12:19:56 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-12 19:12:22 +00:00
|
|
|
sha256 = "642586fc4740bd1cad7690f836b3321309402b20b332529f25617ff18e8e1370";
|
2018-11-21 12:19:56 +01:00
|
|
|
};
|
|
|
|
|
2020-06-04 03:40:59 +00:00
|
|
|
nativeBuildInputs = [ setuptools_scm toml ];
|
2018-11-21 12:19:56 +01:00
|
|
|
propagatedBuildInputs = [
|
2020-06-04 03:40:59 +00:00
|
|
|
importlib-metadata
|
|
|
|
] ++ lib.optional (pythonOlder "3.4") singledispatch
|
2018-11-21 12:19:56 +01:00
|
|
|
++ lib.optional (pythonOlder "3.5") typing
|
|
|
|
;
|
|
|
|
|
2018-12-27 09:22:53 +01:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
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;
|
|
|
|
};
|
2020-03-31 21:11:51 -04:00
|
|
|
}
|