1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 python,
6 pygments,
7 pythonOlder,
8 wavedrom,
9}:
10
11buildPythonPackage rec {
12 pname = "markdown2";
13 version = "2.4.10";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.5";
17
18 # PyPI does not contain tests, so using GitHub instead.
19 src = fetchFromGitHub {
20 owner = "trentm";
21 repo = "python-markdown2";
22 rev = version;
23 hash = "sha256-1Vs2OMQm/XBOEefV6W58X5hap91aTNuTx8UFf0285uk=";
24 };
25
26 nativeCheckInputs = [ pygments ];
27
28 checkPhase = ''
29 runHook preCheck
30
31 pushd test
32 ${python.interpreter} ./test.py -- -knownfailure
33 popd # test
34
35 runHook postCheck
36 '';
37
38 passthru.optional-dependencies = {
39 code_syntax_highlighting = [ pygments ];
40 wavedrom = [ wavedrom ];
41 all = lib.flatten (
42 lib.attrValues (lib.filterAttrs (n: v: n != "all") passthru.optional-dependencies)
43 );
44 };
45
46 meta = with lib; {
47 changelog = "https://github.com/trentm/python-markdown2/blob/${src.rev}/CHANGES.md";
48 description = "Fast and complete Python implementation of Markdown";
49 mainProgram = "markdown2";
50 homepage = "https://github.com/trentm/python-markdown2";
51 license = licenses.mit;
52 maintainers = with maintainers; [ hbunke ];
53 };
54}