2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
chardet,
|
|
|
|
click,
|
|
|
|
flex,
|
|
|
|
packaging,
|
|
|
|
pyicu,
|
|
|
|
requests,
|
|
|
|
ruamel-yaml,
|
|
|
|
setuptools-scm,
|
|
|
|
six,
|
|
|
|
swagger-spec-validator,
|
|
|
|
pytestCheckHook,
|
|
|
|
openapi-spec-validator,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "prance";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "23.06.21.0";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "pyproject";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RonnyPfannschmidt";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-p+LZbQal4DPeMp+eJ2O83rCaL+QIUDcU34pZhYdN4bE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
2023-03-08 16:32:21 +00:00
|
|
|
--replace "--cov=prance --cov-report=term-missing --cov-fail-under=90" ""
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
chardet
|
2023-03-08 16:32:21 +00:00
|
|
|
packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
requests
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2020-04-24 23:36:52 +00:00
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
cli = [ click ];
|
|
|
|
flex = [ flex ];
|
|
|
|
icu = [ pyicu ];
|
|
|
|
osv = [ openapi-spec-validator ];
|
|
|
|
ssv = [ swagger-spec-validator ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-20 04:20:00 +00:00
|
|
|
pytestCheckHook
|
2023-03-08 16:32:21 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
# Disable tests that require network
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths = [ "tests/test_convert.py" ];
|
2021-03-20 04:20:00 +00:00
|
|
|
disabledTests = [
|
2023-03-08 16:32:21 +00:00
|
|
|
"test_convert_defaults"
|
|
|
|
"test_convert_output"
|
2021-03-20 04:20:00 +00:00
|
|
|
"test_fetch_url_http"
|
2023-08-10 07:59:29 +00:00
|
|
|
"test_openapi_spec_validator_validate_failure"
|
2021-03-20 04:20:00 +00:00
|
|
|
];
|
|
|
|
pythonImportsCheck = [ "prance" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-03-08 16:32:21 +00:00
|
|
|
changelog = "https://github.com/RonnyPfannschmidt/prance/blob/${src.rev}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "prance";
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://github.com/RonnyPfannschmidt/prance";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|