PyKubeGrader 0.2.13__tar.gz → 0.2.15__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/.gitignore +1 -0
  2. {pykubegrader-0.2.13/src/PyKubeGrader.egg-info → pykubegrader-0.2.15}/PKG-INFO +1 -1
  3. {pykubegrader-0.2.13 → pykubegrader-0.2.15/src/PyKubeGrader.egg-info}/PKG-INFO +1 -1
  4. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/build/build_folder.py +3 -2
  5. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/tokens/tokens.py +10 -7
  6. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/.coveragerc +0 -0
  7. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/.github/workflows/main.yml +0 -0
  8. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/.readthedocs.yml +0 -0
  9. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/AUTHORS.rst +0 -0
  10. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/CHANGELOG.rst +0 -0
  11. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/CONTRIBUTING.rst +0 -0
  12. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/LICENSE.txt +0 -0
  13. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/README.rst +0 -0
  14. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/Makefile +0 -0
  15. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/_static/Drexel_blue_Logo_square_Dark.png +0 -0
  16. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/_static/Drexel_blue_Logo_square_Light.png +0 -0
  17. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/_static/custom.css +0 -0
  18. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/authors.rst +0 -0
  19. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/changelog.rst +0 -0
  20. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/conf.py +0 -0
  21. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/contributing.rst +0 -0
  22. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/index.rst +0 -0
  23. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/license.rst +0 -0
  24. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/readme.rst +0 -0
  25. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/docs/requirements.txt +0 -0
  26. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/examples/.responses.json +0 -0
  27. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/examples/true_false.ipynb +0 -0
  28. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/pyproject.toml +0 -0
  29. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/setup.cfg +0 -0
  30. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/setup.py +0 -0
  31. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/SOURCES.txt +0 -0
  32. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/dependency_links.txt +0 -0
  33. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/entry_points.txt +0 -0
  34. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/not-zip-safe +0 -0
  35. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/requires.txt +0 -0
  36. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/PyKubeGrader.egg-info/top_level.txt +0 -0
  37. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/__init__.py +0 -0
  38. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/build/__init__.py +0 -0
  39. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/build/api_notebook_builder.py +0 -0
  40. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/build/clean_folder.py +0 -0
  41. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/graders/__init__.py +0 -0
  42. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/graders/late_assignments.py +0 -0
  43. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/initialize.py +0 -0
  44. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/log_parser/__init__.py +0 -0
  45. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/log_parser/parse.ipynb +0 -0
  46. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/log_parser/parse.py +0 -0
  47. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/submit/submit_assignment.py +0 -0
  48. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/telemetry.py +0 -0
  49. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/utils.py +0 -0
  50. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/validate.py +0 -0
  51. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/__init__.py +0 -0
  52. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/multiple_choice.py +0 -0
  53. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/reading_question.py +0 -0
  54. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/select_many.py +0 -0
  55. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/student_info.py +0 -0
  56. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/style.py +0 -0
  57. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/true_false.py +0 -0
  58. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets/types_question.py +0 -0
  59. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets_base/__init__.py +0 -0
  60. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets_base/multi_select.py +0 -0
  61. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets_base/reading.py +0 -0
  62. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/src/pykubegrader/widgets_base/select.py +0 -0
  63. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/tests/conftest.py +0 -0
  64. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/tests/import_test.py +0 -0
  65. {pykubegrader-0.2.13 → pykubegrader-0.2.15}/tox.ini +0 -0
@@ -57,3 +57,4 @@ MANIFEST
57
57
  .ruff_cache/
58
58
  password.py
59
59
  passwords.py
60
+ src/pykubegrader/tokens/token_test.ipynb
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.2.13
3
+ Version: 0.2.15
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyKubeGrader
3
- Version: 0.2.13
3
+ Version: 0.2.15
4
4
  Summary: Add a short description here!
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: jagar2
@@ -567,6 +567,7 @@ class NotebookProcessor:
567
567
 
568
568
  # Make the code cell non-editable and non-deletable
569
569
  code_cell.metadata = {"editable": False, "deletable": False}
570
+ code_cell.metadata["tags"] = ["skip-execution"]
570
571
 
571
572
  # Add the cells to the notebook
572
573
  notebook.cells.append(markdown_cell)
@@ -1810,7 +1811,7 @@ def generate_select_many_file(data_dict, output_file="select_many_questions.py")
1810
1811
  )
1811
1812
  f.write(" def __init__(self):\n")
1812
1813
  f.write(" super().__init__(\n")
1813
- f.write(f" title=f'{q_value['question_text']}',\n")
1814
+ f.write(f' title=f"{q_value['question_text']}",\n')
1814
1815
  f.write(" style=MultiSelect,\n")
1815
1816
  f.write(
1816
1817
  f" question_number={q_value['question number']},\n"
@@ -1887,7 +1888,7 @@ def generate_tf_file(data_dict, output_file="tf_questions.py"):
1887
1888
  )
1888
1889
  f.write(" def __init__(self):\n")
1889
1890
  f.write(" super().__init__(\n")
1890
- f.write(f" title=f'{q_value['question_text']}',\n")
1891
+ f.write(f' title=f"{q_value['question_text']}",\n')
1891
1892
  f.write(" style=TFStyle,\n")
1892
1893
  f.write(
1893
1894
  f" question_number={q_value['question number']},\n"
@@ -1,26 +1,29 @@
1
1
  import requests
2
+ import os
3
+ import json
4
+
2
5
 
3
6
  try:
4
- from pykubegrader.build.passwords import password, user, juptyerhub_user
7
+ from pykubegrader.build.passwords import password, user
5
8
  except: # noqa: E722
6
9
  print("Passwords not found, cannot access database")
7
10
 
8
11
 
9
12
  def build_token_payload(token: str, duration: int) -> dict:
10
13
 
11
- if juptyerhub_user() is None:
14
+ if os.getenv("JUPYTERHUB_USER", None) is None:
12
15
  raise ValueError("JupyterHub user not found")
13
16
 
14
17
  # Return the extracted details as a dictionary
15
18
  return {
16
19
  "value": token,
17
- "requester": juptyerhub_user(),
20
+ "requester": os.getenv("JUPYTERHUB_USER", None),
18
21
  "duration": duration,
19
22
  }
20
23
 
21
24
 
22
25
  # Need to do for add token as well
23
- def add_token(self, token, duration=20):
26
+ def add_token(token, duration=20):
24
27
  """
25
28
  Sends a POST request to add a notebook.
26
29
  """
@@ -28,16 +31,16 @@ def add_token(self, token, duration=20):
28
31
  url = "https://engr-131-api.eastus.cloudapp.azure.com/tokens"
29
32
 
30
33
  # Build the payload
31
- payload = self.build_token_payload(token= token, duration=duration)
34
+ payload = build_token_payload(token=token, duration=duration)
32
35
 
33
36
  # Define HTTP Basic Authentication
34
- auth = (user(), password())
37
+ auth = ("user", "password")
35
38
 
36
39
  # Define headers
37
40
  headers = {"Content-Type": "application/json"}
38
41
 
39
42
  # Serialize the payload with the custom JSON encoder
40
- serialized_payload = json.dumps(payload, default=self.json_serial)
43
+ serialized_payload = json.dumps(payload)
41
44
 
42
45
  # Send the POST request
43
46
  response = requests.post(url, data=serialized_payload, headers=headers, auth=auth)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes