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