summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2022-07-17 20:48:52 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-09-04 19:59:37 +0000
commit7406f167cf1554c133a17a3f1e2a6c1af8230b4f (patch)
tree480c43ec70c0d6685b21407997639d21cf9e39cd
parentMerge pull request #189731 from mweinelt/22.05/papercuts (diff)
downloadnixpkgs-origin/backport-181880-to-release-22.05.tar.gz
python3Packages.pdoc: init at 12.0.2origin/backport-181880-to-release-22.05
(cherry picked from commit 6f3abbd21df1a7d139d25cfba11be7dba0d0d418)
-rw-r--r--pkgs/development/python-modules/pdoc/default.nix56
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 58 insertions, 0 deletions
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 de0a92c240d4..56e65945a9bb 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6266,6 +6266,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 { };