Files
nixpkgs/pkgs/development/python-modules/online-judge-api-client/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

74 lines
1.5 KiB
Nix

{
lib,
appdirs,
beautifulsoup4,
buildPythonPackage,
colorlog,
fetchFromGitHub,
git,
jsonschema,
lxml,
markdown,
python,
requests,
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";
version = "10.10.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "online-judge-tools";
repo = "api-client";
tag = "v${version}";
hash = "sha256-P0pIjd/YS155dSDpY/ekMp8HnJcM35waV7aoTQiEWHo=";
};
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 = {
description = "API client to develop tools for competitive programming";
mainProgram = "oj-api";
homepage = "https://github.com/online-judge-tools/api-client";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sei40kr ];
};
}