assignment-codeval 0.0.33__tar.gz → 0.0.35__tar.gz

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.
Files changed (26) hide show
  1. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/PKG-INFO +1 -1
  2. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/pyproject.toml +1 -1
  3. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/commons.py +5 -2
  4. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/submissions.py +16 -12
  5. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/PKG-INFO +1 -1
  6. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/README.md +0 -0
  7. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/setup.cfg +0 -0
  8. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/__init__.py +0 -0
  9. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/ai_benchmark.py +0 -0
  10. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/canvas_utils.py +0 -0
  11. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/check_grading.py +0 -0
  12. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/cli.py +0 -0
  13. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/convertMD2Html.py +0 -0
  14. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/create_assignment.py +0 -0
  15. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/evaluate.py +0 -0
  16. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/export_tests.py +0 -0
  17. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/file_utils.py +0 -0
  18. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/github_connect.py +0 -0
  19. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/install_assignment.py +0 -0
  20. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/recent_comments.py +0 -0
  21. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval/test_template.html +0 -0
  22. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/SOURCES.txt +0 -0
  23. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/dependency_links.txt +0 -0
  24. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/entry_points.txt +0 -0
  25. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/requires.txt +0 -0
  26. {assignment_codeval-0.0.33 → assignment_codeval-0.0.35}/src/assignment_codeval.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: assignment-codeval
3
- Version: 0.0.33
3
+ Version: 0.0.35
4
4
  Summary: CodEval for evaluating programming assignments
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "assignment-codeval"
7
- version = "0.0.33"
7
+ version = "0.0.35"
8
8
  description = "CodEval for evaluating programming assignments"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -1,14 +1,17 @@
1
1
  from typing import NoReturn
2
2
 
3
3
  import click
4
+ import re
4
5
  import time
5
6
  import dataclasses
6
7
 
7
8
 
8
9
  def despace(name):
9
- # we need to replace spaces with _ to work well with scripts
10
10
  # we need to remove the : so that it doesn't mess up docker
11
- return name.replace(" ", "_").replace(":","")
11
+ # (removed rather than replaced to keep existing names stable)
12
+ # everything else that isn't a word character, . or - becomes _ so the
13
+ # name is a single path component that is safe in scripts and the shell
14
+ return re.sub(r"[^\w.-]", "_", name.replace(":", ""))
12
15
 
13
16
 
14
17
  @dataclasses.dataclass(init=True, repr=True, frozen=True)
@@ -679,18 +679,22 @@ def evaluate_submissions(codeval_dir, submissions_dir):
679
679
 
680
680
  # Now extract zip files to the correct working directory
681
681
  if not move_to_next_submission:
682
- for zf_name in zip_files:
683
- with ZipFile(os.path.join(codeval_dir, zf_name)) as zf:
684
- if "SUBSTITUTIONS.txt" in zf.namelist():
685
- with open(os.path.join(dirpath, "SUBSTITUTIONS.txt"), "wb") as out_f:
686
- out_f.write(zf.read("SUBSTITUTIONS.txt"))
687
- for f in zf.infolist():
688
- dest_dir = os.path.join(submission_dir, assignment_working_dir)
689
- zf.extract(f, dest_dir)
690
- if not f.is_dir():
691
- perms = f.external_attr >> 16
692
- if perms:
693
- os.chmod(os.path.join(dest_dir, f.filename), perms)
682
+ try:
683
+ for zf_name in zip_files:
684
+ with ZipFile(os.path.join(codeval_dir, zf_name)) as zf:
685
+ if "SUBSTITUTIONS.txt" in zf.namelist():
686
+ with open(os.path.join(dirpath, "SUBSTITUTIONS.txt"), "wb") as out_f:
687
+ out_f.write(zf.read("SUBSTITUTIONS.txt"))
688
+ for f in zf.infolist():
689
+ dest_dir = os.path.join(submission_dir, assignment_working_dir)
690
+ zf.extract(f, dest_dir)
691
+ if not f.is_dir():
692
+ perms = f.external_attr >> 16
693
+ if perms:
694
+ os.chmod(os.path.join(dest_dir, f.filename), perms)
695
+ except Exception as e:
696
+ out = f"Problem extracting test files: {e}".encode('utf-8')
697
+ move_to_next_submission = True
694
698
 
695
699
  if not move_to_next_submission:
696
700
  # Mount the whole submission and cd to the working directory
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: assignment-codeval
3
- Version: 0.0.33
3
+ Version: 0.0.35
4
4
  Summary: CodEval for evaluating programming assignments
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown