ygrader 1.1.23__tar.gz → 1.1.25__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.23
3
+ Version: 1.1.25
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.23",
6
+ version="1.1.25",
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",
@@ -18,25 +18,35 @@ def clone_repo(git_path, tag, student_repo_path):
18
18
  "already cloned. Re-fetching tag",
19
19
  )
20
20
 
21
- if tag:
22
- # Fetch
23
- cmd = ["git", "fetch", "--tags", "-f"]
24
- try:
25
- subprocess.run(cmd, cwd=student_repo_path, check=True)
26
- except subprocess.CalledProcessError:
27
- print_color(TermColors.RED, "git fetch failed")
28
- return False
29
-
30
- # Checkout tag
31
- if tag not in ("master", "main"):
32
- tag = "tags/" + tag
33
- cmd = ["git", "checkout", tag, "-f"]
34
- try:
35
- subprocess.run(cmd, cwd=student_repo_path, check=True)
36
- except subprocess.CalledProcessError:
37
- print_color(TermColors.RED, "git checkout of tag failed")
38
- return False
39
- return True
21
+ # Fetch
22
+ cmd = ["git", "fetch", "--tags", "-f"]
23
+ try:
24
+ subprocess.run(cmd, cwd=student_repo_path, check=True)
25
+ except subprocess.CalledProcessError:
26
+ print_color(TermColors.RED, "git fetch failed")
27
+ return False
28
+
29
+ # Checkout tag
30
+ if tag is None:
31
+ # Get the default branch
32
+ stdout = subprocess.run(
33
+ ["git", "symbolic-ref", "refs/remotes/origin/HEAD", "--short"],
34
+ cwd=student_repo_path,
35
+ check=True,
36
+ capture_output=True,
37
+ universal_newlines=True,
38
+ ).stdout
39
+ tag = stdout.split("/")[1].strip()
40
+
41
+ if tag not in ("master", "main"):
42
+ tag = "tags/" + tag
43
+ cmd = ["git", "checkout", tag, "-f"]
44
+ try:
45
+ subprocess.run(cmd, cwd=student_repo_path, check=True)
46
+ except subprocess.CalledProcessError:
47
+ print_color(TermColors.RED, "git checkout of tag failed")
48
+ return False
49
+ return True
40
50
 
41
51
  print_color(TermColors.BLUE, "Cloning repo, tag =", tag)
42
52
  if tag:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ygrader
3
- Version: 1.1.23
3
+ Version: 1.1.25
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
File without changes