1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 flit-core,
6 marshmallow,
7 mock,
8 openapi-spec-validator,
9 packaging,
10 prance,
11 pytestCheckHook,
12 pythonOlder,
13 pyyaml,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "apispec";
19 version = "6.6.1";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-9cqkfO51/gO5xQtVlASLTAUu7KLCEuDawS27YXXZplk=";
27 };
28
29 nativeBuildInputs = [ flit-core ];
30
31 propagatedBuildInputs = [ packaging ];
32
33 passthru.optional-dependencies = {
34 marshmallow = [ marshmallow ];
35 yaml = [ pyyaml ];
36 validation = [
37 openapi-spec-validator
38 prance
39 ] ++ prance.optional-dependencies.osv;
40 };
41
42 nativeCheckInputs = [
43 mock
44 pytestCheckHook
45 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
46
47 pythonImportsCheck = [ "apispec" ];
48
49 meta = with lib; {
50 changelog = "https://github.com/marshmallow-code/apispec/blob/${version}/CHANGELOG.rst";
51 description = "Pluggable API specification generator with support for the OpenAPI Specification";
52 homepage = "https://github.com/marshmallow-code/apispec";
53 license = licenses.mit;
54 maintainers = [ ];
55 };
56}