summary refs log tree commit diff
path: root/pkgs/development/python-modules/pdoc/default.nix
blob: c8813208d5e83402fe9af61abbed1ebb78e88e10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, buildPythonPackage
, pythonOlder
, fetchPypi
, fetchFromGitHub
, jinja2
, pygments
, markupsafe
, astunparse
, pytestCheckHook
, hypothesis
}:

buildPythonPackage rec {
  pname = "pdoc";
  version = "12.0.2";
  disabled = pythonOlder "3.7";

  # the Pypi version does not include tests
  src = fetchFromGitHub {
    owner = "mitmproxy";
    repo = "pdoc";
    rev = "v${version}";
    sha256 = "FVfPO/QoHQQqg7QU05GMrrad0CbRR5AQVYUpBhZoRi0=";
  };

  propagatedBuildInputs = [
    jinja2
    pygments
    markupsafe
  ] ++ lib.optional (pythonOlder "3.9") astunparse;

  nativeCheckInputs = [
    pytestCheckHook
    hypothesis
  ];
  disabledTests = [
    # Failing "test_snapshots" parametrization: Output does not match the stored snapshot
    # This test seems to be sensitive to ordering of dictionary items and the version of dependencies.
    # the only difference between the stored snapshot and the produced documentation is a debug javascript comment
    "html-demopackage_dir"
  ];
  pytestFlagsArray = [
    ''-m "not slow"'' # skip tests marked slow
  ];

  pythonImportsCheck = [ "pdoc" ];

  meta = with lib; {
    homepage = "https://pdoc.dev/";
    description = "API Documentation for Python Projects";
    license = licenses.unlicense;
    maintainers = with maintainers; [ pbsds ];
  };
}