pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / by-name / ou / outputcheck / package.nix
blobb7ae0b61f27b8b131fd4e30e2a16295290a956d8
1 { lib
2 , python3
3 , fetchFromGitHub
4 , lit
5 }:
7 python3.pkgs.buildPythonApplication rec {
8   pname = "outputcheck";
9   version = "0.4.2";
10   format = "setuptools";
12   src = fetchFromGitHub {
13     owner = "stp";
14     repo = "OutputCheck";
15     rev = "eab62a5dd5129f6a4ebfbe4bbe41d35611f7c48d";
16     hash = "sha256-0D5Lljn66jB/EW/ntC2eTuXAt0w0cceeeqf3aKuyeF0=";
17   };
19   # - Fix deprecated 'U' mode in python 3.11
20   #   https://github.com/python/cpython/blob/3.11/Doc/library/functions.rst?plain=1#L1386
21   # - Fix expected error and actual parser error mismatch
22   # - Fix version number cannot find error
23   postPatch = ''
24     substituteInPlace OutputCheck/Driver.py \
25       --replace "argparse.FileType('rU')" "argparse.FileType('r')"
27     substituteInPlace tests/invalid-regex-syntax.smt2 \
28       --replace "unbalanced parenthesis" "missing ), unterminated subpattern"
30     echo ${version} > RELEASE-VERSION
31   '';
33   nativeCheckInputs = [ lit ];
35   checkPhase = ''
36     runHook preCheck
38     lit -v tests/
40     runHook postCheck
41   '';
43   pythonImportsCheck = [ "OutputCheck" ];
45   meta = with lib; {
46     description = "Tool for checking tool output inspired by LLVM's FileCheck";
47     homepage = "https://github.com/stp/OutputCheck";
48     changelog = "https://github.com/stp/OutputCheck/releases/tag/${version}";
49     license = licenses.bsd3;
50     maintainers = with maintainers; [ fsagbuya ];
51     mainProgram = "OutputCheck";
52   };