depot/third_party/nixpkgs/pkgs/development/python-modules/mdformat/default.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

61 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, importlib-metadata
, markdown-it-py
, poetry-core
, pytestCheckHook
, pythonOlder
, tomli
, typing-extensions
}:
buildPythonPackage rec {
pname = "mdformat";
version = "0.7.14";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "executablebooks";
repo = pname;
rev = version;
sha256 = "sha256-bImBW6r8g/4MQ9yNrBBhk7AGqKRXFyAew6HHEmqelxw=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
markdown-it-py
tomli
] ++ lib.optionals (pythonOlder "3.10") [
importlib-metadata
] ++ lib.optionals (pythonOlder "3.7") [
typing-extensions
];
checkInputs = [
pytestCheckHook
];
disabledTests = [
# AssertionError
"test_no_codeblock_trailing_newline"
# Issue with upper/lower case
"default_style.md-options0"
];
pythonImportsCheck = [
"mdformat"
];
meta = with lib; {
description = "CommonMark compliant Markdown formatter";
homepage = "https://mdformat.rtfd.io/";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}