Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / online-judge-api-client / default.nix
blob5a96133a0daa23001a258ec63eddd3e8ed5ef0a8
1 { lib
2 , appdirs
3 , beautifulsoup4
4 , buildPythonPackage
5 , colorlog
6 , fetchFromGitHub
7 , git
8 , jsonschema
9 , lxml
10 , markdown
11 , python
12 , requests
13 , substituteAll
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 (ps: with ps; [ colorlog jinja2 markdown toml ]);
21 in buildPythonPackage rec {
22   pname = "online-judge-api-client";
23   version = "10.10.1";
25   src = fetchFromGitHub {
26     owner = "online-judge-tools";
27     repo = "api-client";
28     rev = "refs/tags/v${version}";
29     hash = "sha256-P0pIjd/YS155dSDpY/ekMp8HnJcM35waV7aoTQiEWHo=";
30   };
32   patches = [ ./fix-paths.patch ];
33   postPatch = ''
34     substituteInPlace onlinejudge/service/library_checker.py \
35       --subst-var-by git               ${git} \
36       --subst-var-by pythonInterpreter ${pythonEnv.interpreter}
37   '';
39   propagatedBuildInputs = [
40     appdirs
41     beautifulsoup4
42     colorlog
43     jsonschema
44     lxml
45     requests
46     toml
47   ];
49   # Requires internet access
50   doCheck = false;
52   pythonImportsCheck = [ "onlinejudge" "onlinejudge_api" ];
54   meta = with lib; {
55     description = "API client to develop tools for competitive programming";
56     homepage = "https://github.com/online-judge-tools/api-client";
57     license = licenses.mit;
58     maintainers = with maintainers; [ sei40kr ];
59   };