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
|
|
|
|
, fetchFromGitHub
|
2022-08-12 12:06:08 +00:00
|
|
|
, flit-core
|
2021-05-20 23:08:51 +00:00
|
|
|
, linkify-it-py
|
2021-12-06 16:07:01 +00:00
|
|
|
, mdurl
|
2020-12-09 12:39:15 +00:00
|
|
|
, psutil
|
2023-01-20 10:41:00 +00:00
|
|
|
, py
|
2020-12-09 12:39:15 +00:00
|
|
|
, pytest-benchmark
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytest-regressions
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, typing-extensions
|
2023-02-02 18:25:31 +00:00
|
|
|
# allow disabling tests for the nixos manual build.
|
|
|
|
# the test suite closure is just too large.
|
|
|
|
, disableTests ? false
|
2020-12-09 12:39:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "markdown-it-py";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "2.1.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}";
|
|
|
|
sha256 = "sha256-6UATJho3SuIbLktZtFcDrCTWIAh52E+n5adcgl49un0=";
|
2020-12-09 12:39:15 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
linkify-it-py
|
|
|
|
mdurl
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
2021-12-06 16:07:01 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
2020-12-09 12:39:15 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
psutil
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optionals (! disableTests) [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-benchmark
|
|
|
|
pytest-regressions
|
2020-12-09 12:39:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--benchmark-skip"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"markdown_it"
|
|
|
|
];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|