1{
2 lib,
3 buildPythonPackage,
4 cmarkgfm,
5 docutils,
6 fetchPypi,
7 fetchpatch2,
8 nh3,
9 pygments,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "readme-renderer";
17 version = "44.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchPypi {
23 pname = "readme_renderer";
24 inherit version;
25 hash = "sha256-hxIDTqu/poBcrPFAK07rKnMCj3LRFm1vXLf5wEfF0eE=";
26 };
27
28 patches = [
29 # https://github.com/pypa/readme_renderer/pull/325
30 (fetchpatch2 {
31 name = "pygment-2_19-compatibility.patch";
32 url = "https://github.com/pypa/readme_renderer/commit/04d5cfe76850192364eff344be7fe27730af8484.patch";
33 hash = "sha256-QBU3zL3DB8gYYwtKrIC8+H8798pU9Sz3T9e/Q/dXksw=";
34 })
35 ];
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 docutils
41 nh3
42 pygments
43 ];
44
45 optional-dependencies.md = [ cmarkgfm ];
46
47 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.md;
48
49 disabledTests = [
50 "test_rst_fixtures"
51 "test_rst_008.rst"
52 ];
53
54 pythonImportsCheck = [ "readme_renderer" ];
55
56 meta = with lib; {
57 description = "Python library for rendering readme descriptions";
58 homepage = "https://github.com/pypa/readme_renderer";
59 changelog = "https://github.com/pypa/readme_renderer/releases/tag/${version}";
60 license = with licenses; [ asl20 ];
61 maintainers = with maintainers; [ fab ];
62 };
63}