push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
{
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 = with lib; {
description = "API client to develop tools for competitive programming";
mainProgram = "oj-api";
homepage = "https://github.com/online-judge-tools/api-client";
license = licenses.mit;
maintainers = with maintainers; [ sei40kr ];
};
}

View File

@@ -0,0 +1,39 @@
diff --git a/onlinejudge/service/library_checker.py b/onlinejudge/service/library_checker.py
index b63c7b7..e062490 100644
--- a/onlinejudge/service/library_checker.py
+++ b/onlinejudge/service/library_checker.py
@@ -51,7 +51,7 @@ class LibraryCheckerService(onlinejudge.type.Service):
return
try:
- subprocess.check_call(['git', '--version'], stdout=sys.stderr, stderr=sys.stderr)
+ subprocess.check_call(['@git@/bin/git', '--version'], stdout=sys.stderr, stderr=sys.stderr)
except FileNotFoundError:
logger.error('git command not found')
raise
@@ -60,12 +60,12 @@ class LibraryCheckerService(onlinejudge.type.Service):
if not path.exists():
# init the problem repository
url = 'https://github.com/yosupo06/library-checker-problems'
- logger.info('$ git clone %s %s', url, path)
- subprocess.check_call(['git', 'clone', url, str(path)], stdout=sys.stderr, stderr=sys.stderr)
+ logger.info('$ @git@/bin/git clone %s %s', url, path)
+ subprocess.check_call(['@git@/bin/git', 'clone', url, str(path)], stdout=sys.stderr, stderr=sys.stderr)
else:
# sync the problem repository
- logger.info('$ git -C %s pull', str(path))
- subprocess.check_call(['git', '-C', str(path), 'pull'], stdout=sys.stderr, stderr=sys.stderr)
+ logger.info('$ @git@/bin/git -C %s pull', str(path))
+ subprocess.check_call(['@git@/bin/git', '-C', str(path), 'pull'], stdout=sys.stderr, stderr=sys.stderr)
cls.is_repository_updated = True
@@ -100,7 +100,7 @@ class LibraryCheckerProblem(onlinejudge.type.Problem):
logger.warning("generate.py may not work on Windows")
problem_spec = str(self._get_problem_directory_path() / 'info.toml')
- command = [sys.executable, str(path / 'generate.py'), problem_spec]
+ command = ['@pythonInterpreter@', str(path / 'generate.py'), problem_spec]
if compile_checker:
command.append('--compile-checker')
logger.info('$ %s', ' '.join(command))