1{ lib 2, buildPythonPackage 3, fetchPypi 4, setuptools-scm 5, importlib-metadata 6, typing ? null 7, singledispatch ? null 8, pythonOlder 9, python 10}: 11 12buildPythonPackage rec { 13 pname = "importlib-resources"; 14 version = "5.4.0"; 15 16 src = fetchPypi { 17 pname = "importlib_resources"; 18 inherit version; 19 sha256 = "sha256-11bi+F3U3iuom+CyHboqO77C6HGkKjoWcZJYoR+HUGs="; 20 }; 21 22 nativeBuildInputs = [ 23 setuptools-scm 24 ]; 25 26 propagatedBuildInputs = [ 27 importlib-metadata 28 ] ++ lib.optional (pythonOlder "3.4") [ 29 singledispatch 30 ] ++ lib.optional (pythonOlder "3.5") [ 31 typing 32 ]; 33 34 checkPhase = '' 35 ${python.interpreter} -m unittest discover 36 ''; 37 38 pythonImportsCheck = [ 39 "importlib_resources" 40 ]; 41 42 meta = with lib; { 43 description = "Read resources from Python packages"; 44 homepage = "https://importlib-resources.readthedocs.io/"; 45 license = licenses.asl20; 46 maintainers = [ ]; 47 }; 48}