2022-01-25 03:21:06 +00:00
|
|
|
{ lib
|
|
|
|
, appdirs
|
|
|
|
, beautifulsoup4
|
|
|
|
, buildPythonPackage
|
|
|
|
, colorlog
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, jsonschema
|
|
|
|
, lxml
|
|
|
|
, markdown
|
|
|
|
, python
|
|
|
|
, requests
|
|
|
|
, substituteAll
|
|
|
|
, toml
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# NOTE This is needed to download & run another Python program internally in
|
|
|
|
# order to generate test cases for library-checker problems.
|
|
|
|
pythonEnv = python.withPackages (ps: with ps; [ colorlog jinja2 markdown toml ]);
|
|
|
|
in buildPythonPackage rec {
|
|
|
|
pname = "online-judge-api-client";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "10.10.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-01-25 03:21:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "online-judge-tools";
|
|
|
|
repo = "api-client";
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-P0pIjd/YS155dSDpY/ekMp8HnJcM35waV7aoTQiEWHo=";
|
2022-01-25 03:21:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./fix-paths.patch ];
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace onlinejudge/service/library_checker.py \
|
|
|
|
--subst-var-by git ${git} \
|
|
|
|
--subst-var-by pythonInterpreter ${pythonEnv.interpreter}
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
beautifulsoup4
|
|
|
|
colorlog
|
|
|
|
jsonschema
|
|
|
|
lxml
|
|
|
|
requests
|
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
|
|
|
# Requires internet access
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "onlinejudge" "onlinejudge_api" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "API client to develop tools for competitive programming";
|
|
|
|
homepage = "https://github.com/online-judge-tools/api-client";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ sei40kr ];
|
|
|
|
};
|
|
|
|
}
|