Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / openapi-spec-validator / default.nix
blobc43439e36ba0aacad70627fac9ba01fe66db1ab4
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
6 # build-system
7 , poetry-core
9 # propagates
10 , importlib-resources
11 , jsonschema
12 , jsonschema-path
13 , lazy-object-proxy
14 , openapi-schema-validator
16 # tests
17 , pytestCheckHook
20 buildPythonPackage rec {
21   pname = "openapi-spec-validator";
22   version = "0.7.1";
23   pyproject = true;
25   disabled = pythonOlder "3.8";
27   # no tests via pypi sdist
28   src = fetchFromGitHub {
29     owner = "python-openapi";
30     repo = "openapi-spec-validator";
31     rev = "refs/tags/${version}";
32     hash = "sha256-X0ePdHQeBSWjsCFQgCoNloQZRhKbvPBE43aavBppvmg=";
33   };
35   postPatch = ''
36     sed -i '/--cov/d' pyproject.toml
37   '';
39   nativeBuildInputs = [
40     poetry-core
41   ];
43   propagatedBuildInputs = [
44     jsonschema
45     jsonschema-path
46     lazy-object-proxy
47     openapi-schema-validator
48   ] ++ lib.optionals (pythonOlder "3.9") [
49     importlib-resources
50   ];
52   nativeCheckInputs = [
53     pytestCheckHook
54   ];
56   disabledTests = [
57     # network access
58     "test_default_valid"
59     "test_urllib_valid"
60     "test_valid"
61   ];
63   pythonImportsCheck = [
64     "openapi_spec_validator"
65     "openapi_spec_validator.readers"
66   ];
68   meta = with lib; {
69     changelog = "https://github.com/p1c2u/openapi-spec-validator/releases/tag/${version}";
70     description = "Validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0.0 specification";
71     mainProgram = "openapi-spec-validator";
72     homepage = "https://github.com/p1c2u/openapi-spec-validator";
73     license = licenses.asl20;
74   };