1{ lib
2, aiohttp
3, buildPythonPackage
4, fastapi
5, fetchFromGitHub
6, flask
7, httpx
8, mypy-boto3-s3
9, numpy
10, pydantic
11, pytest-asyncio
12, pytestCheckHook
13, pythonOlder
14, pyyaml
15, scipy
16, six
17}:
18
19buildPythonPackage rec {
20 pname = "dependency-injector";
21 version = "4.41.0";
22 format = "setuptools";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "ets-labs";
28 repo = "python-dependency-injector";
29 rev = version;
30 hash = "sha256-U3U/L8UuYrfpm4KwVNmViTbam7QdZd2vp1p+ENtOJlw=";
31 };
32
33 propagatedBuildInputs = [
34 six
35 ];
36
37 passthru.optional-dependencies = {
38 aiohttp = [
39 aiohttp
40 ];
41 pydantic = [
42 pydantic
43 ];
44 flask = [
45 flask
46 ];
47 yaml = [
48 pyyaml
49 ];
50 };
51
52 nativeCheckInputs = [
53 fastapi
54 httpx
55 mypy-boto3-s3
56 numpy
57 pytest-asyncio
58 pytestCheckHook
59 scipy
60 ] ++ passthru.optional-dependencies.aiohttp
61 ++ passthru.optional-dependencies.pydantic
62 ++ passthru.optional-dependencies.yaml
63 ++ passthru.optional-dependencies.flask;
64
65 pythonImportsCheck = [
66 "dependency_injector"
67 ];
68
69 disabledTestPaths = [
70 # Exclude tests for EOL Python releases
71 "tests/unit/ext/test_aiohttp_py35.py"
72 "tests/unit/wiring/test_*_py36.py"
73 ];
74
75 meta = with lib; {
76 description = "Dependency injection microframework for Python";
77 homepage = "https://github.com/ets-labs/python-dependency-injector";
78 changelog = "https://github.com/ets-labs/python-dependency-injector/blob/${version}/docs/main/changelog.rst";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ gerschtli ];
81 };
82}