From 41a762d8586ea8171a74880bcb156cbec2cce33d Mon Sep 17 00:00:00 2001 From: nikstur <61635709+nikstur@users.noreply.github.com> Date: Fri, 29 Jul 2022 22:19:10 +0200 Subject: [PATCH] python3Packages.plantuml-markdown: init at 3.6.2 (#183637) Co-authored-by: Sandro --- .../plantuml-markdown/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/plantuml-markdown/default.nix diff --git a/pkgs/development/python-modules/plantuml-markdown/default.nix b/pkgs/development/python-modules/plantuml-markdown/default.nix new file mode 100644 index 000000000000..b33f43ef9357 --- /dev/null +++ b/pkgs/development/python-modules/plantuml-markdown/default.nix @@ -0,0 +1,65 @@ +{ buildPythonPackage +, fetchFromGitHub +, lib +, plantuml +, markdown +, requests +, six +, runCommand +, writeText +, plantuml-markdown +}: +let + pname = "plantuml-markdown"; + version = "3.6.2"; +in +buildPythonPackage { + inherit pname version; + + src = fetchFromGitHub { + owner = "mikitex70"; + repo = pname; + rev = version; + sha256 = "sha256-IADKU4EQHLLH5uD5iBAUiumFp5nyTNGt1LWoWdfbvJM="; + }; + + propagatedBuildInputs = [ + plantuml + markdown + requests + six + ]; + + # The package uses a custom script that downloads a certain version of plantuml for testing. + doCheck = false; + + pythonImportsCheck = [ "plantuml_markdown" ]; + + passthru.tests.example-doc = + let + exampleDoc = writeText "plantuml-markdown-example-doc.md" '' + ```plantuml + Bob -> Alice: Hello + ``` + ''; + in + runCommand "plantuml-markdown-example-doc" + { + nativeBuildInputs = [ plantuml-markdown ]; + } '' + markdown_py -x plantuml_markdown ${exampleDoc} > $out + + ! grep -q "Error" $out + ''; + + meta = with lib; { + description = "PlantUML plugin for Python-Markdown"; + longDescription = '' + This plugin implements a block extension which can be used to specify a PlantUML + diagram which will be converted into an image and inserted in the document. + ''; + homepage = "https://github.com/mikitex70/plantuml-markdown"; + license = licenses.bsd2; + maintainers = with maintainers; [ nikstur ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dfa493883041..902d3b9be6fa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6775,6 +6775,10 @@ in { plantuml = callPackage ../development/python-modules/plantuml { }; + plantuml-markdown = callPackage ../development/python-modules/plantuml-markdown { + inherit (pkgs) plantuml; + }; + plaster = callPackage ../development/python-modules/plaster { }; plaster-pastedeploy = callPackage ../development/python-modules/plaster-pastedeploy { };