1{ lib
2, bleach
3, buildPythonPackage
4, cmarkgfm
5, docutils
6, fetchPypi
7, mock
8, pygments
9, pytestCheckHook
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "readme-renderer";
15 version = "37.3";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchPypi {
21 pname = "readme_renderer";
22 inherit version;
23 hash = "sha256-zWUxht/HMFVlbwkPIn9csioEbX9xqEHfowX1XJpRMnM=";
24 };
25
26 propagatedBuildInputs = [
27 bleach
28 cmarkgfm
29 docutils
30 pygments
31 ];
32
33 nativeCheckInputs = [
34 mock
35 pytestCheckHook
36 ];
37
38 postPatch = ''
39 substituteInPlace setup.py \
40 --replace "cmarkgfm>=0.5.0,<0.7.0" "cmarkgfm>=0.5.0,<1"
41 '';
42
43 disabledTests = [
44 # https://github.com/pypa/readme_renderer/issues/221
45 "test_GFM_"
46 # https://github.com/pypa/readme_renderer/issues/274
47 "test_CommonMark_008.md"
48 "test_rst_008.rst"
49 # Relies on old distutils behaviour removed by setuptools (TypeError: dist must be a Distribution instance)
50 "test_valid_rst"
51 "test_invalid_rst"
52 "test_malicious_rst"
53 "test_invalid_missing"
54 "test_invalid_empty"
55 ];
56
57 pythonImportsCheck = [
58 "readme_renderer"
59 ];
60
61 meta = with lib; {
62 description = "Python library for rendering readme descriptions";
63 homepage = "https://github.com/pypa/readme_renderer";
64 license = with licenses; [ asl20 ];
65 maintainers = with maintainers; [ fab ];
66 };
67}