summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/mdformat
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/mdformat')
-rw-r--r--pkgs/development/python-modules/mdformat/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/mdformat/default.nix b/pkgs/development/python-modules/mdformat/default.nix
new file mode 100644
index 000000000000..159310035b8f
--- /dev/null
+++ b/pkgs/development/python-modules/mdformat/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, importlib-metadata
+, markdown-it-py
+, poetry-core
+, pytestCheckHook
+, pythonOlder
+, typing-extensions
+}:
+
+buildPythonPackage rec {
+ pname = "mdformat";
+ version = "0.7.6";
+ format = "pyproject";
+ disabled = pythonOlder "3.6";
+
+ src = fetchFromGitHub {
+ owner = "executablebooks";
+ repo = pname;
+ rev = version;
+ sha256 = "0mnbi3vp7zgllpcpf6vrjw9y6jas95shphn99ayr8b8wgxsaqkif";
+ };
+
+ nativeBuildInputs = [
+ poetry-core
+ ];
+
+ propagatedBuildInputs = [
+ markdown-it-py
+ ] ++ lib.optionals (pythonOlder "3.10") [
+ importlib-metadata
+ ] ++ lib.optionals (pythonOlder "3.7") [
+ typing-extensions
+ ];
+
+ checkInputs = [
+ pytestCheckHook
+ ];
+
+ pythonImportsCheck = [ "mdformat" ];
+
+ meta = with lib; {
+ description = "CommonMark compliant Markdown formatter";
+ homepage = "https://mdformat.rtfd.io/";
+ license = with licenses; [ mit ];
+ maintainers = with maintainers; [ fab ];
+ };
+}