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