1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, typing-extensions
6, pytestCheckHook
7, pytest-cov
8}:
9
10buildPythonPackage rec {
11 pname = "injector";
12 version = "0.21.0";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "python-injector";
17 repo = pname;
18 rev = "refs/tags/${version}";
19 hash = "sha256-5O4vJSXfYNTrUzmv5XuT9pSUndNSvTZTxfVwiAd+0ck=";
20 };
21
22 propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [
23 typing-extensions
24 ];
25
26 nativeCheckInputs = [
27 pytestCheckHook
28 pytest-cov
29 ];
30
31 pythonImportsCheck = [ "injector" ];
32
33 meta = with lib; {
34 description = "Python dependency injection framework, inspired by Guice";
35 homepage = "https://github.com/alecthomas/injector";
36 maintainers = [ maintainers.ivar ];
37 license = licenses.bsd3;
38 };
39}