2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
python,
|
|
|
|
pygments,
|
|
|
|
pythonOlder,
|
|
|
|
wavedrom,
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "markdown2";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.4.10";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# PyPI does not contain tests, so using GitHub instead.
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trentm";
|
|
|
|
repo = "python-markdown2";
|
|
|
|
rev = version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-1Vs2OMQm/XBOEefV6W58X5hap91aTNuTx8UFf0285uk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pygments ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
pushd test
|
|
|
|
${python.interpreter} ./test.py -- -knownfailure
|
|
|
|
popd # test
|
|
|
|
|
|
|
|
runHook postCheck
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
code_syntax_highlighting = [ pygments ];
|
|
|
|
wavedrom = [ wavedrom ];
|
2024-10-04 16:56:33 +00:00
|
|
|
all = lib.flatten (lib.attrValues (lib.filterAttrs (n: v: n != "all") optional-dependencies));
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/trentm/python-markdown2/blob/${src.rev}/CHANGES.md";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Fast and complete Python implementation of Markdown";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "markdown2";
|
2024-06-05 15:53:02 +00:00
|
|
|
homepage = "https://github.com/trentm/python-markdown2";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hbunke ];
|
|
|
|
};
|
|
|
|
}
|