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