2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
poetry-core,
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# propagates
|
|
|
|
importlib-resources,
|
|
|
|
jsonschema,
|
|
|
|
jsonschema-path,
|
|
|
|
lazy-object-proxy,
|
|
|
|
openapi-schema-validator,
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
2022-04-15 01:41:22 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openapi-spec-validator";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.7.1";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-03-08 16:32:21 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# no tests via pypi sdist
|
|
|
|
src = fetchFromGitHub {
|
2024-01-13 08:15:51 +00:00
|
|
|
owner = "python-openapi";
|
2023-08-10 07:59:29 +00:00
|
|
|
repo = "openapi-spec-validator";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-X0ePdHQeBSWjsCFQgCoNloQZRhKbvPBE43aavBppvmg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/--cov/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jsonschema
|
2024-01-13 08:15:51 +00:00
|
|
|
jsonschema-path
|
2022-09-30 11:47:45 +00:00
|
|
|
lazy-object-proxy
|
2022-08-12 12:06:08 +00:00
|
|
|
openapi-schema-validator
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ 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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "openapi-spec-validator";
|
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;
|
|
|
|
};
|
|
|
|
}
|