2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-03-08 16:32:21 +00:00
|
|
|
, pythonOlder
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchFromGitHub
|
2022-04-15 01:41:22 +00:00
|
|
|
, poetry-core
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# propagates
|
2022-09-30 11:47:45 +00:00
|
|
|
, importlib-resources
|
2022-08-12 12:06:08 +00:00
|
|
|
, jsonschema
|
2022-09-30 11:47:45 +00:00
|
|
|
, jsonschema-spec
|
|
|
|
, lazy-object-proxy
|
2022-08-12 12:06:08 +00:00
|
|
|
, openapi-schema-validator
|
|
|
|
, pyyaml
|
|
|
|
|
|
|
|
# optional
|
2022-04-15 01:41:22 +00:00
|
|
|
, requests
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
2022-04-15 01:41:22 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openapi-spec-validator";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "0.5.5";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# no tests via pypi sdist
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p1c2u";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-t7u0p6V2woqIFsqywv7k5s5pbbnmcn45YnlFWH1PEi4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jsonschema
|
2022-09-30 11:47:45 +00:00
|
|
|
jsonschema-spec
|
|
|
|
lazy-object-proxy
|
2022-08-12 12:06:08 +00:00
|
|
|
openapi-schema-validator
|
2023-03-08 16:32:21 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
importlib-resources
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies.requests = [
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
sed -i '/--cov/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabledTests = [
|
|
|
|
# network access
|
|
|
|
"test_default_valid"
|
|
|
|
"test_urllib_valid"
|
|
|
|
"test_valid"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"openapi_spec_validator"
|
|
|
|
"openapi_spec_validator.readers"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-09-30 11:47:45 +00:00
|
|
|
changelog = "https://github.com/p1c2u/openapi-spec-validator/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0.0 specification";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://github.com/p1c2u/openapi-spec-validator";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ rvl ];
|
|
|
|
};
|
|
|
|
}
|