python312Packages.kneaddata: init at 0.7.7-alpha (#340230)
[NixPkgs.git] / pkgs / development / python-modules / online-judge-api-client / default.nix
blobcc346e19231d28a996934f68df756c38272c0092
2   lib,
3   appdirs,
4   beautifulsoup4,
5   buildPythonPackage,
6   colorlog,
7   fetchFromGitHub,
8   git,
9   jsonschema,
10   lxml,
11   markdown,
12   python,
13   requests,
14   toml,
17 let
18   # NOTE This is needed to download & run another Python program internally in
19   #      order to generate test cases for library-checker problems.
20   pythonEnv = python.withPackages (
21     ps: with ps; [
22       colorlog
23       jinja2
24       markdown
25       toml
26     ]
27   );
29 buildPythonPackage rec {
30   pname = "online-judge-api-client";
31   version = "10.10.1";
32   format = "setuptools";
34   src = fetchFromGitHub {
35     owner = "online-judge-tools";
36     repo = "api-client";
37     rev = "refs/tags/v${version}";
38     hash = "sha256-P0pIjd/YS155dSDpY/ekMp8HnJcM35waV7aoTQiEWHo=";
39   };
41   patches = [ ./fix-paths.patch ];
42   postPatch = ''
43     substituteInPlace onlinejudge/service/library_checker.py \
44       --subst-var-by git               ${git} \
45       --subst-var-by pythonInterpreter ${pythonEnv.interpreter}
46   '';
48   propagatedBuildInputs = [
49     appdirs
50     beautifulsoup4
51     colorlog
52     jsonschema
53     lxml
54     requests
55     toml
56   ];
58   # Requires internet access
59   doCheck = false;
61   pythonImportsCheck = [
62     "onlinejudge"
63     "onlinejudge_api"
64   ];
66   meta = with lib; {
67     description = "API client to develop tools for competitive programming";
68     mainProgram = "oj-api";
69     homepage = "https://github.com/online-judge-tools/api-client";
70     license = licenses.mit;
71     maintainers = with maintainers; [ sei40kr ];
72   };