1{
2 lib,
3 aiohttp,
4 aioitertools,
5 asgiref,
6 buildPythonPackage,
7 django,
8 falcon,
9 fastapi,
10 fetchFromGitHub,
11 flask,
12 httpx,
13 isodate,
14 jsonschema,
15 jsonschema-spec,
16 more-itertools,
17 multidict,
18 openapi-schema-validator,
19 openapi-spec-validator,
20 parse,
21 poetry-core,
22 pytest-aiohttp,
23 pytestCheckHook,
24 pythonOlder,
25 responses,
26 requests,
27 starlette,
28 webob,
29 werkzeug,
30}:
31
32buildPythonPackage rec {
33 pname = "openapi-core";
34 version = "0.19.2";
35 pyproject = true;
36
37 disabled = pythonOlder "3.8";
38
39 src = fetchFromGitHub {
40 owner = "p1c2u";
41 repo = "openapi-core";
42 rev = "refs/tags/${version}";
43 hash = "sha256-6FFJsXObIA9tchTJJmoSu9u+/ZuKuw29AYsLEmvHXrY=";
44 };
45
46 postPatch = ''
47 sed -i "/--cov/d" pyproject.toml
48 '';
49
50 nativeBuildInputs = [ poetry-core ];
51
52 propagatedBuildInputs = [
53 isodate
54 more-itertools
55 parse
56 openapi-schema-validator
57 openapi-spec-validator
58 werkzeug
59 jsonschema-spec
60 asgiref
61 jsonschema
62 ];
63
64 passthru.optional-dependencies = {
65 aiohttp = [
66 aiohttp
67 multidict
68 ];
69 django = [ django ];
70 falcon = [ falcon ];
71 fastapi = [ fastapi ];
72 flask = [ flask ];
73 requests = [ requests ];
74 starlette = [
75 aioitertools
76 starlette
77 ];
78 };
79
80 __darwinAllowLocalNetworking = true;
81
82 nativeCheckInputs = [
83 httpx
84 pytest-aiohttp
85 pytestCheckHook
86 responses
87 webob
88 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
89
90 pytestFlagsArray = [
91 "-W"
92 "ignore::DeprecationWarning"
93 ];
94
95 disabledTestPaths = [
96 # Requires secrets and additional configuration
97 "tests/integration/contrib/django/"
98 ];
99
100 pythonImportsCheck = [
101 "openapi_core"
102 "openapi_core.validation.request.validators"
103 "openapi_core.validation.response.validators"
104 ];
105
106 meta = with lib; {
107 description = "Client-side and server-side support for the OpenAPI Specification v3";
108 homepage = "https://github.com/python-openapi/openapi-core";
109 license = licenses.bsd3;
110 maintainers = with maintainers; [ dotlambda ];
111 };
112}