2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, attrs
|
2021-06-28 23:13:55 +00:00
|
|
|
, buildPythonPackage
|
2023-03-15 16:39:30 +00:00
|
|
|
, commonmark
|
2021-06-28 23:13:55 +00:00
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, flit-core
|
2021-05-20 23:08:51 +00:00
|
|
|
, linkify-it-py
|
2023-03-15 16:39:30 +00:00
|
|
|
, markdown
|
2023-10-19 13:55:26 +00:00
|
|
|
, mdit-py-plugins
|
2021-12-06 16:07:01 +00:00
|
|
|
, mdurl
|
2023-03-15 16:39:30 +00:00
|
|
|
, mistletoe
|
|
|
|
, mistune
|
|
|
|
, myst-parser
|
|
|
|
, panflute
|
|
|
|
, pyyaml
|
|
|
|
, sphinx
|
|
|
|
, sphinx-book-theme
|
|
|
|
, sphinx-copybutton
|
|
|
|
, sphinx-design
|
2023-04-29 16:46:19 +00:00
|
|
|
, stdenv
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytest-regressions
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
2023-08-22 20:05:09 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, pythonOlder
|
2020-12-09 12:39:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "markdown-it-py";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "3.0.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "pyproject";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-12-09 12:39:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "executablebooks";
|
2021-05-20 23:08:51 +00:00
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-cmjLElJA61EysTUFMVY++Kw0pI4wOIXOyCY3To9fpQc=";
|
2020-12-09 12:39:15 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# fix downstrem usage of markdown-it-py[linkify]
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"linkify-it-py"
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-08-12 12:06:08 +00:00
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mdurl
|
|
|
|
];
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-regressions
|
2020-12-09 12:39:15 +00:00
|
|
|
pytestCheckHook
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ passthru.optional-dependencies.linkify;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
# disable and remove benchmark tests
|
|
|
|
preCheck = ''
|
|
|
|
rm -r benchmarking
|
|
|
|
'';
|
2023-04-29 16:46:19 +00:00
|
|
|
doCheck = !stdenv.isi686;
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"markdown_it"
|
|
|
|
];
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
compare = [ commonmark markdown mistletoe mistune panflute ];
|
|
|
|
linkify = [ linkify-it-py ];
|
2023-10-19 13:55:26 +00:00
|
|
|
plugins = [ mdit-py-plugins ];
|
2023-03-15 16:39:30 +00:00
|
|
|
rtd = [ attrs myst-parser pyyaml sphinx sphinx-copybutton sphinx-design sphinx-book-theme ];
|
|
|
|
};
|
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Markdown parser in Python";
|
|
|
|
homepage = "https://markdown-it-py.readthedocs.io/";
|
2020-12-09 12:39:15 +00:00
|
|
|
changelog = "https://github.com/executablebooks/markdown-it-py/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bhipple ];
|
|
|
|
};
|
|
|
|
}
|