1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, fetchFromGitHub
7, jinja2
8, pygments
9, markupsafe
10, astunparse
11, pytestCheckHook
12, hypothesis
13}:
14
15buildPythonPackage rec {
16 pname = "pdoc";
17 version = "12.0.2";
18 disabled = pythonOlder "3.7";
19
20 # the Pypi version does not include tests
21 src = fetchFromGitHub {
22 owner = "mitmproxy";
23 repo = "pdoc";
24 rev = "v${version}";
25 sha256 = "FVfPO/QoHQQqg7QU05GMrrad0CbRR5AQVYUpBhZoRi0=";
26 };
27
28 propagatedBuildInputs = [
29 jinja2
30 pygments
31 markupsafe
32 ] ++ lib.optional (pythonOlder "3.9") astunparse;
33
34 checkInputs = [
35 pytestCheckHook
36 hypothesis
37 ];
38 disabledTests = [
39 # Failing "test_snapshots" parametrization: Output does not match the stored snapshot
40 # This test seems to be sensitive to ordering of dictionary items and the version of dependencies.
41 # the only difference between the stored snapshot and the produced documentation is a debug javascript comment
42 "html-demopackage_dir"
43 ];
44 pytestFlagsArray = [
45 ''-m "not slow"'' # skip tests marked slow
46 ];
47
48 pythonImportsCheck = [ "pdoc" ];
49
50 meta = with lib; {
51 homepage = "https://pdoc.dev/";
52 description = "API Documentation for Python Projects";
53 license = licenses.unlicense;
54 maintainers = with maintainers; [ pbsds ];
55 };
56}