rbx.cp 0.13.4__py3-none-any.whl → 0.13.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rbx/box/checkers.py +2 -9
- rbx/box/cli.py +0 -1
- rbx/box/code.py +27 -80
- rbx/box/environment.py +16 -6
- rbx/box/generators.py +26 -3
- rbx/box/global_package.py +1 -1
- rbx/box/header.py +13 -1
- rbx/box/package.py +0 -14
- rbx/box/setter_config.py +11 -0
- rbx/box/solutions.py +12 -4
- rbx/box/tasks.py +9 -4
- rbx/box/testing/testing_package.py +7 -2
- rbx/box/ui/screens/run_explorer.py +0 -8
- rbx/box/ui/utils/run_ui.py +7 -3
- rbx/box/ui/widgets/test_output_box.py +1 -1
- rbx/box/validators.py +3 -1
- rbx/grading/caching.py +64 -14
- rbx/grading/judge/program.py +268 -0
- rbx/grading/judge/sandbox.py +30 -193
- rbx/grading/judge/sandboxes/stupid_sandbox.py +232 -241
- rbx/grading/judge/sandboxes/tee.py +31 -0
- rbx/grading/steps.py +87 -199
- rbx/grading/steps_with_caching.py +15 -6
- rbx/resources/presets/default/problem/problem.rbx.yml +0 -2
- rbx/resources/templates/rbx.h +43 -2
- rbx/testing_utils.py +7 -0
- rbx/utils.py +51 -1
- {rbx_cp-0.13.4.dist-info → rbx_cp-0.13.5.dist-info}/METADATA +1 -1
- {rbx_cp-0.13.4.dist-info → rbx_cp-0.13.5.dist-info}/RECORD +32 -34
- rbx/grading/judge/sandboxes/isolate.py +0 -695
- rbx/grading/judge/testiso.py +0 -54
- rbx/resources/envs/isolate.rbx.yml +0 -36
- rbx/resources/presets/default/problem/sols/slow.cpp +0 -15
- {rbx_cp-0.13.4.dist-info → rbx_cp-0.13.5.dist-info}/LICENSE +0 -0
- {rbx_cp-0.13.4.dist-info → rbx_cp-0.13.5.dist-info}/WHEEL +0 -0
- {rbx_cp-0.13.4.dist-info → rbx_cp-0.13.5.dist-info}/entry_points.txt +0 -0
rbx/grading/judge/testiso.py
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
import atexit
|
2
|
-
import pathlib
|
3
|
-
|
4
|
-
from rich.console import Console
|
5
|
-
|
6
|
-
from rbx import grading_utils
|
7
|
-
from rbx.grading.judge import cacher, storage
|
8
|
-
from rbx.grading.judge.sandboxes.isolate import IsolateSandbox
|
9
|
-
|
10
|
-
console = Console()
|
11
|
-
|
12
|
-
|
13
|
-
def main():
|
14
|
-
fs = storage.FilesystemStorage(pathlib.PosixPath('/tmp/rbx-storage'))
|
15
|
-
cache = cacher.FileCacher(fs)
|
16
|
-
|
17
|
-
python_file = cache.put_file_text(
|
18
|
-
"""
|
19
|
-
#include <bits/stdc++.h>
|
20
|
-
|
21
|
-
int main() {
|
22
|
-
std::cout << "Hello, World!" << std::endl;
|
23
|
-
return 0;
|
24
|
-
}
|
25
|
-
"""
|
26
|
-
)
|
27
|
-
|
28
|
-
sandbox = IsolateSandbox(
|
29
|
-
cache, params=grading_utils.build_preprocess_sandbox_params(), debug=True
|
30
|
-
)
|
31
|
-
atexit.register(sandbox.cleanup)
|
32
|
-
sandbox.create_file_from_storage(pathlib.PosixPath('run.cpp'), python_file)
|
33
|
-
|
34
|
-
sandbox.params.stdout_file = pathlib.PosixPath('run.out')
|
35
|
-
sandbox.params.stderr_file = pathlib.PosixPath('run.err')
|
36
|
-
|
37
|
-
sandbox.execute_without_std(
|
38
|
-
['/usr/bin/g++', '-std=c++17', '-o', 'executable', 'run.cpp'],
|
39
|
-
)
|
40
|
-
try:
|
41
|
-
sandbox.hydrate_logs()
|
42
|
-
except Exception:
|
43
|
-
console.print_exception()
|
44
|
-
|
45
|
-
print(sandbox.log)
|
46
|
-
print(sandbox.get_human_exit_description())
|
47
|
-
print(sandbox.get_stats())
|
48
|
-
|
49
|
-
print(sandbox.get_file_to_string(pathlib.PosixPath('run.out')))
|
50
|
-
print(sandbox.get_file_to_string(pathlib.PosixPath('run.err')))
|
51
|
-
|
52
|
-
|
53
|
-
if __name__ == '__main__':
|
54
|
-
main()
|
@@ -1,36 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sandbox: "isolate"
|
3
|
-
defaultCompilation:
|
4
|
-
sandbox:
|
5
|
-
maxProcesses: null
|
6
|
-
timeLimit: null # 10 seconds
|
7
|
-
wallTimeLimit: null # 10 seconds
|
8
|
-
memoryLimit: null # 1gb
|
9
|
-
preserveEnv: true
|
10
|
-
mirrorDirs:
|
11
|
-
- "/etc"
|
12
|
-
- "/usr"
|
13
|
-
defaultExecution:
|
14
|
-
sandbox:
|
15
|
-
# Useful for checkers, validators, etc.
|
16
|
-
timeLimit: 10000 # 10 seconds
|
17
|
-
wallTimeLimit: 10000 # 10 seconds
|
18
|
-
memoryLimit: 1024 # 1gb
|
19
|
-
languages:
|
20
|
-
- name: "cpp"
|
21
|
-
readableName: "C++17"
|
22
|
-
extension: "cpp"
|
23
|
-
compilation:
|
24
|
-
commands:
|
25
|
-
- "/usr/bin/g++ -std=c++17 -O2 -o {executable} {compilable}"
|
26
|
-
execution:
|
27
|
-
command: "./{executable}"
|
28
|
-
fileMapping:
|
29
|
-
compilable: "compilable.cpp"
|
30
|
-
- name: "py"
|
31
|
-
readableName: "Python3"
|
32
|
-
extension: "py"
|
33
|
-
execution:
|
34
|
-
command: "/usr/bin/python3 {executable}"
|
35
|
-
fileMapping:
|
36
|
-
executable: "executable.py"
|
File without changes
|
File without changes
|
File without changes
|