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