2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-04-15 01:41:22 +00:00
|
|
|
, poetry-core
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# propagates
|
|
|
|
, jsonschema
|
|
|
|
, 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";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "0.4.0";
|
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# no tests via pypi sdist
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "p1c2u";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-mGgHlDZTUo72RNZ/448gkGdza4EntYU9YoBpSKDUCeA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'openapi-schema-validator = "^0.2.0"' 'openapi-schema-validator = "*"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jsonschema
|
|
|
|
openapi-schema-validator
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies.requests = [
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
sed -i '/--cov/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
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; {
|
|
|
|
homepage = "https://github.com/p1c2u/openapi-spec-validator";
|
|
|
|
description = "Validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0.0 specification";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ rvl ];
|
|
|
|
};
|
|
|
|
}
|