diff --git a/pkgs/development/python-modules/pdoc/default.nix b/pkgs/development/python-modules/pdoc/default.nix new file mode 100644 index 000000000000..2572b8c04611 --- /dev/null +++ b/pkgs/development/python-modules/pdoc/default.nix @@ -0,0 +1,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; + + checkInputs = [ + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 34cced4ec221..48112b1033cb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6406,6 +6406,8 @@ in { pdm-pep517 = callPackage ../development/python-modules/pdm-pep517 { }; + pdoc = callPackage ../development/python-modules/pdoc { }; + pdoc3 = callPackage ../development/python-modules/pdoc3 { }; peaqevcore = callPackage ../development/python-modules/peaqevcore { };