nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, attrs
3, buildPythonPackage
4, dictpath
5, django
6, djangorestframework
7, falcon
8, fetchFromGitHub
9, flask
10, isodate
11, lazy-object-proxy
12, mock
13, more-itertools
14, openapi-schema-validator
15, openapi-spec-validator
16, parse
17, pytestCheckHook
18, pythonOlder
19, responses
20, six
21, webob
22, werkzeug
23, python
24}:
25
26buildPythonPackage rec {
27 pname = "openapi-core";
28 version = "0.14.2";
29 format = "setuptools";
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchFromGitHub {
34 owner = "p1c2u";
35 repo = "openapi-core";
36 rev = version;
37 hash = "sha256-+VyNPSq7S1Oz4eGf+jaeRTx0lZ8pUA+G+KZ/5PyK+to=";
38 };
39
40 postPatch = ''
41 sed -i "/^addopts/d" setup.cfg
42 '';
43
44 propagatedBuildInputs = [
45 attrs
46 dictpath
47 isodate
48 lazy-object-proxy
49 more-itertools
50 openapi-schema-validator
51 openapi-spec-validator
52 parse
53 six
54 werkzeug
55 ];
56
57 checkInputs = [
58 django
59 djangorestframework
60 falcon
61 flask
62 mock
63 pytestCheckHook
64 responses
65 webob
66 ];
67
68 disabledTestPaths = [
69 # AttributeError: 'str' object has no attribute '__name__'
70 "tests/integration/validation"
71 # requires secrets and additional configuration
72 "tests/integration/contrib/test_django.py"
73 # Unable to detect SECRET_KEY and ROOT_URLCONF
74 "tests/integration/contrib/test_django.py"
75 ];
76
77 disabledTests = [
78 # TypeError: Unexpected keyword arguments passed to pytest.raises: message
79 "test_string_format_invalid_value"
80 # Needs a fix for new PyYAML
81 "test_django_rest_framework_apiview"
82 ];
83
84 pythonImportsCheck = [
85 "openapi_core"
86 "openapi_core.validation.request.validators"
87 "openapi_core.validation.response.validators"
88 ];
89
90 meta = with lib; {
91 description = "Client-side and server-side support for the OpenAPI Specification v3";
92 homepage = "https://github.com/p1c2u/openapi-core";
93 license = licenses.bsd3;
94 maintainers = with maintainers; [ dotlambda ];
95 };
96}