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