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