dev #10

Merged
李衍志523370910113 merged 238 commits from dev into master 2025-03-05 16:20:39 +08:00
3 changed files with 43 additions and 26 deletions
Showing only changes of commit 275f9f981c - Show all commits

View File

@ -1,6 +1,8 @@
import re
jon-lee marked this conversation as resolved

Path should not be relative to JOJ3_CONFIG_ROOT in this file, should be relative to task.toml dir

Path should not be relative to `JOJ3_CONFIG_ROOT` in this file, should be relative to `task.toml` dir

I reckon you said things is relative to JOJ3_CONFIG_ROOT in JTC before. we have a task.type in task.toml to mend the path

I reckon you said things is relative to `JOJ3_CONFIG_ROOT` in JTC before. we have a `task.type` in `task.toml` to mend the path

config.path is relative to JOJ3_CONFIG_ROOT.

`config.path` is relative to `JOJ3_CONFIG_ROOT`.

could you explain further? I m not quite sure my understanding is clear.

could you explain further? I m not quite sure my understanding is clear.

In joj3_config_generator/models/task.py, Config.path is relative to JOJ3_CONFIG_ROOT, so task.toml will located at JOJ3_CONFIG_ROOT / task_conf.path in JTC.

In `joj3_config_generator/models/task.py`, `Config.path` is relative to `JOJ3_CONFIG_ROOT`, so `task.toml` will located at `JOJ3_CONFIG_ROOT / task_conf.path` in JTC.
import shlex
jon-lee marked this conversation as resolved

Some with_.update is still using raw dict, not model with model_dump.

Some `with_.update` is still using raw dict, not model with `model_dump`.
from typing import List, Set
from typing import Callable, Dict, List, Set, Tuple
from pydantic import BaseModel
from joj3_config_generator.models import result, task
from joj3_config_generator.models.const import JOJ3_CONFIG_ROOT
@ -48,6 +50,21 @@ def get_conf_stage(
return conf_stage
# def get_processed_dict(task_stage: task.Stagew) -> Dict[str, Tuple[Callable[[task.Stage, BaseModel], None], BaseModel]]:
# processed_dict: Dict[str, Tuple[Callable[[task.Stage, task.StageDetail], None], BaseModel]] = {
# "clang-tidy": (fix_keyword, result.clang-tidy),
# "keyword": (fix_keyword, result.KeywordConfig),
# "cppcheck": (fix_keyword, result.KeywordConfig),
# "cpplint": (fix_keyword, result.KeywordConfig),
# "result-detail": (fix_result_detail, result.ResultDetailConfig),
# "dummy": (fix_dummy, result.DummyConfig),
# "result-status": (fix_dummy, result.DummyConfig),
# "file": (fix_file, result.FileConfig),
# "diff": (fix_diff, result.DiffConfig),
jon-lee marked this conversation as resolved Outdated

not necessary

not necessary

resolved.

resolved.
# }
# return processed_dict
def get_executor_with(task_stage: task.Stage, cached: Set[str]) -> result.ExecutorWith:
file_import = task_stage.files.import_
copy_in_files = [file for file in file_import if file not in cached]
@ -183,7 +200,7 @@ def fix_diff(
stage_cases.append(
result.OptionalCmd(
stdin=result.LocalFile(
src=str(JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdin),
src=str(JOJ3_CONFIG_ROOT / task_conf.path.parent / stdin),
),
args=shlex.split(command) if command else None,
cpu_limit=cpu_limit,
@ -207,7 +224,7 @@ def fix_diff(
score=diff_output.score,
file_name="stdout",
answer_path=str(
JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdout
JOJ3_CONFIG_ROOT / task_conf.path.parent / stdout
jon-lee marked this conversation as resolved Outdated

Just pass conf_stage.executor to this function rather then the whole conf_stage.

Just pass `conf_stage.executor` to this function rather then the whole `conf_stage`.
),
force_quit_on_diff=diff_output.force_quit,
always_hide=diff_output.hide,

View File

@ -223,10 +223,10 @@
},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -323,10 +323,10 @@
},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -445,10 +445,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -588,10 +588,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -685,10 +685,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -706,7 +706,7 @@
"cases": [
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case0.in"
"src": "/home/tt/.config/joj/case0.in"
},
"cpuLimit": 500000000,
"clockLimit": 1000000000,
@ -715,7 +715,7 @@
},
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case1.in"
"src": "/home/tt/.config/joj/case1.in"
},
"cpuLimit": 1234567890,
"clockLimit": 2469135780,
@ -736,7 +736,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out",
"answerPath": "/home/tt/.config/joj/case0.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false
@ -748,7 +748,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out",
"answerPath": "/home/tt/.config/joj/case1.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false

View File

@ -64,7 +64,7 @@
"cases": [
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case0.in"
"src": "/home/tt/.config/joj/case0.in"
},
"cpuLimit": 1000000000,
"clockLimit": 2000000000,
@ -73,7 +73,7 @@
},
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case1.in"
"src": "/home/tt/.config/joj/case1.in"
},
"cpuLimit": 2000000000,
"clockLimit": 4000000000,
@ -94,7 +94,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out",
"answerPath": "/home/tt/.config/joj/case0.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false
@ -106,7 +106,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out",
"answerPath": "/home/tt/.config/joj/case1.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false