ygrader 1.1.27__tar.gz → 1.1.28__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ygrader
3
- Version: 1.1.27
3
+ Version: 1.1.28
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
  setup(
4
4
  name="ygrader",
5
5
  packages=["ygrader"],
6
- version="1.1.27",
6
+ version="1.1.28",
7
7
  description="Grading scripts used in BYU's Electrical and Computer Engineering Department",
8
8
  author="Jeff Goeders",
9
9
  author_email="jeff.goeders@gmail.com",
@@ -1,4 +1,5 @@
1
1
  """ ygrader utility functions"""
2
+
2
3
  import pathlib
3
4
  import sys
4
5
  import shutil
@@ -59,8 +60,12 @@ def clang_format_code(dir_path):
59
60
  cmd = ["clang-format", "-i", path]
60
61
  try:
61
62
  # Run clang-format twice (this shouldn't be necessary, but I've run into it with one students code -- it would be considered a bug in clang)
62
- subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True)
63
- subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True)
63
+ subprocess.run(
64
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True
65
+ )
66
+ subprocess.run(
67
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True
68
+ )
64
69
  except subprocess.CalledProcessError as e:
65
70
  print(e.output)
66
71
  error("Clang format errored", str())
@@ -69,7 +74,11 @@ def clang_format_code(dir_path):
69
74
  def names_to_dir(first_names, last_names, net_ids):
70
75
  """Convert first and last names to a valid filesystem directory name"""
71
76
  return (
72
- first_names[0].replace(" ", "_") + "_" + last_names[0].replace(" ", "_") + "_" + net_ids[0]
77
+ first_names[0].replace(" ", "_")
78
+ + "_"
79
+ + last_names[0].replace(" ", "_")
80
+ + "_"
81
+ + net_ids[0]
73
82
  )
74
83
 
75
84
 
@@ -104,11 +113,11 @@ def verify_workflow_hash(workflow_file_path, hash_str):
104
113
  """Checks that the github workflow is valid (has 1 file and matches given hash)"""
105
114
 
106
115
  if not workflow_file_path.is_file():
107
- error(workflow_file_path, "is missing")
116
+ raise WorkflowHashError(f"{workflow_file_path} is missing")
108
117
 
109
118
  workflow_dir_path = workflow_file_path.parent
110
119
  if len(list(workflow_dir_path.glob("**/*"))) != 1:
111
- error(workflow_dir_path, "has more than one file")
120
+ raise WorkflowHashError(f"{workflow_dir_path} has more than one file")
112
121
 
113
122
  hash_val = hash_file(workflow_file_path)
114
123
  if hash_val != hash_str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ygrader
3
- Version: 1.1.27
3
+ Version: 1.1.28
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes