1{ lib
2, buildPythonPackage
3, fetchPypi
4
5# build-system
6, setuptools
7
8# tests
9, pytestCheckHook
10, wcag-contrast-ratio
11}:
12
13let pygments = buildPythonPackage
14 rec {
15 pname = "pygments";
16 version = "2.16.1";
17 format = "pyproject";
18
19 src = fetchPypi {
20 pname = "Pygments";
21 inherit version;
22 hash = "sha256-Ha/wSUggxpvIlB5AeqIPV3N07og2TuEKmP2+Cuzpbik=";
23 };
24
25 nativeBuildInputs = [
26 setuptools
27 ];
28
29 # circular dependencies if enabled by default
30 doCheck = false;
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 wcag-contrast-ratio
35 ];
36
37 disabledTestPaths = [
38 # 5 lines diff, including one nix store path in 20000+ lines
39 "tests/examplefiles/bash/ltmain.sh"
40 ];
41
42 pythonImportsCheck = [
43 "pygments"
44 ];
45
46 passthru.tests = {
47 check = pygments.overridePythonAttrs (_: { doCheck = true; });
48 };
49
50 meta = with lib; {
51 changelog = "https://github.com/pygments/pygments/releases/tag/${version}";
52 homepage = "https://pygments.org/";
53 description = "A generic syntax highlighter";
54 mainProgram = "pygmentize";
55 license = licenses.bsd2;
56 maintainers = with maintainers; [ ];
57 };
58 };
59in pygments