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