Skip to content

Commit

Permalink
fix: remove dangling literals
Browse files Browse the repository at this point in the history
  • Loading branch information
FlickerSoul committed Nov 2, 2023
1 parent 051b3b7 commit 8236d8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/gapper/core/file_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from zipfile import ZipFile

from gapper.core.tester import Tester
from gapper.gradescope.vars import DEFAULT_TESTER_PICKLE_NAME


class AutograderZipper:
Expand Down Expand Up @@ -47,9 +48,9 @@ def _copy_gs_setup(self, zip_file: ZipFile) -> None:

def _copy_tester_pickle(self, zip_file: ZipFile) -> None:
with TemporaryDirectory() as temp_dir:
path = Path(temp_dir) / "tester.pckl"
path = Path(temp_dir) / DEFAULT_TESTER_PICKLE_NAME
self._tester.dump_to(path)
zip_file.write(path, arcname="tester.pckl")
zip_file.write(path, arcname=DEFAULT_TESTER_PICKLE_NAME)

def zip_file_path(self, path: Path, zip_file: ZipFile, root: Path) -> None:
"""Zip a file or folder.
Expand Down
4 changes: 3 additions & 1 deletion src/gapper/gradescope/vars.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from pathlib import Path

DEFAULT_TESTER_PICKLE_NAME = "tester.pckl"

AUTOGRADER_ROOT = Path("/autograder")
AUTOGRADER_SRC = AUTOGRADER_ROOT / "source"
AUTOGRADER_SUBMISSION = AUTOGRADER_ROOT / "submission"
AUTOGRADER_METADATA = AUTOGRADER_ROOT / "submission_metadata.json"
AUTOGRADER_OUTPUT = AUTOGRADER_ROOT / "results/results.json"
AUTOGRADER_TESTER_PICKLE = AUTOGRADER_SRC / "tester.pckl"
AUTOGRADER_TESTER_PICKLE = AUTOGRADER_SRC / DEFAULT_TESTER_PICKLE_NAME

0 comments on commit 8236d8b

Please sign in to comment.