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 pythonOlder,
25 responses,
26 requests,
27 starlette,
28 webob,
29 werkzeug,
30}:
31
32buildPythonPackage rec {
33 pname = "openapi-core";
34 version = "0.19.4";
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-JvWusDokov8G0UO9oOkGicAI7wYZTnNywbvKMZKQWiQ=";
44 };
45
46 build-system = [ poetry-core ];
47
48 dependencies = [
49 isodate
50 more-itertools
51 parse
52 openapi-schema-validator
53 openapi-spec-validator
54 werkzeug
55 jsonschema-path
56 jsonschema
57 ];
58
59 optional-dependencies = {
60 aiohttp = [
61 aiohttp
62 multidict
63 ];
64 django = [ django ];
65 falcon = [ falcon ];
66 fastapi = [ fastapi ];
67 flask = [ flask ];
68 requests = [ requests ];
69 starlette = [
70 aioitertools
71 starlette
72 ];
73 };
74
75 __darwinAllowLocalNetworking = true;
76
77 nativeCheckInputs = [
78 httpx
79 pytest-aiohttp
80 pytest-cov-stub
81 pytestCheckHook
82 responses
83 webob
84 ] ++ lib.flatten (lib.attrValues optional-dependencies);
85
86 disabledTestPaths = [
87 # Requires secrets and additional configuration
88 "tests/integration/contrib/django/"
89 ];
90
91 pythonImportsCheck = [
92 "openapi_core"
93 "openapi_core.validation.request.validators"
94 "openapi_core.validation.response.validators"
95 ];
96
97 meta = with lib; {
98 changelog = "https://github.com/python-openapi/openapi-core/releases/tag/${version}";
99 description = "Client-side and server-side support for the OpenAPI Specification v3";
100 homepage = "https://github.com/python-openapi/openapi-core";
101 license = licenses.bsd3;
102 maintainers = with maintainers; [ dotlambda ];
103 };
104}