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