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}:
15
16buildPythonPackage rec {
17 pname = "apispec";
18 version = "6.8.4";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-/Q7RSvcaKUnZrrlrcs4VF8tKSKXFVmfNBIO37TMVaio=";
26 };
27
28 build-system = [ flit-core ];
29
30 dependencies = [ packaging ];
31
32 optional-dependencies = {
33 marshmallow = [ marshmallow ];
34 yaml = [ pyyaml ];
35 validation = [
36 openapi-spec-validator
37 prance
38 ]
39 ++ prance.optional-dependencies.osv;
40 };
41
42 nativeCheckInputs = [
43 mock
44 pytestCheckHook
45 ]
46 ++ lib.flatten (builtins.attrValues optional-dependencies);
47
48 pythonImportsCheck = [ "apispec" ];
49
50 meta = with lib; {
51 changelog = "https://github.com/marshmallow-code/apispec/blob/${version}/CHANGELOG.rst";
52 description = "Pluggable API specification generator with support for the OpenAPI Specification";
53 homepage = "https://github.com/marshmallow-code/apispec";
54 license = licenses.mit;
55 maintainers = [ ];
56 };
57}