otter-service-stdalone 1.1.25__py3-none-any.whl → 1.1.27__py3-none-any.whl

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 +1 @@
1
- __version__ = "1.1.25"
1
+ __version__ = "1.1.27"
@@ -3,6 +3,7 @@ import tornado.ioloop
3
3
  import tornado.web
4
4
  import tornado.auth
5
5
  import os
6
+ import re
6
7
  import uuid
7
8
  import tornado.websocket
8
9
  from otter_service_stdalone import fs_logging as log
@@ -37,7 +38,7 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler):
37
38
  if user_id not in session_callbacks:
38
39
  session_callbacks[user_id] = tornado.ioloop.PeriodicCallback(lambda: self.send_results(user_id), 1000)
39
40
  session_callbacks[user_id].start()
40
-
41
+
41
42
  def on_message(self, message):
42
43
  pass # No action needed on incoming message
43
44
 
@@ -255,7 +256,8 @@ class Upload(BaseHandler):
255
256
  if autograder is not None and notebooks is not None:
256
257
  log.write_logs(results_path, "Step 1: Upload accepted", "", "debug", log_debug)
257
258
  notebooks_fname = notebooks['filename']
258
- results_path = f"{os.path.splitext(notebooks_fname)[0]}-{results_path}"
259
+ sanitized_filename = re.sub(r"[ ,./\\\[\]{}()]", "", os.path.splitext(notebooks_fname)[0])
260
+ results_path = f"{sanitized_filename}-{results_path}"
259
261
  notebooks_extn = os.path.splitext(notebooks_fname)[1]
260
262
  if notebooks_extn == ".zip":
261
263
  notebooks_name = results_path + notebooks_extn
@@ -279,12 +281,14 @@ class Upload(BaseHandler):
279
281
  m = "Step 3A: Uploaded autograder.zip files written to disk - now checking otter version"
280
282
  log.write_logs(results_path, m, f"Results Code: {results_path}", "debug", log_debug)
281
283
  if not otter_version_correct(auto_p):
282
- m = "Step 3A-1: autograder.zip is wrong version of otter-grader; must be >= 6.0.4"
284
+ m = "Step 3A-1: autograder.zip is made with the wrong version of otter-grader; must be >="
285
+ m += os.environ.get("TARGET_OTTER_VERSION")
283
286
  log.write_logs(results_path, m, f"Results Code: {results_path}", "debug", log_debug)
284
287
  m = "If you are teaching Data 8, please get the latest autograder.zips from materials-sp22-private. "
285
288
  m += "If you are NOT teaching Berkeley's Data 8, you need to make sure the autograder.zip uses "
286
- m += "otter-grader version >=6.0.4; due to breaking changes in "
287
- m += "otter-grader dependencies you need to run otter assign with otter-grader >= 6.0.4 to generate working "
289
+ m += f"otter-grader version >={os.environ.get('TARGET_OTTER_VERSION')}; due to breaking changes in "
290
+ m += "otter-grader dependencies you need to run otter assign with "
291
+ m += f"otter-grader >={os.environ.get('TARGET_OTTER_VERSION')} to generate working "
288
292
  m += "solution files(autograder.zips)."
289
293
  self.render("index.html", message=m)
290
294
  else:
@@ -1,5 +1,7 @@
1
1
  import re
2
2
  import zipfile
3
+ from packaging import version
4
+ import os
3
5
 
4
6
 
5
7
  def is_version_6_or_greater(zip_ref, target_file, reg):
@@ -8,10 +10,13 @@ def is_version_6_or_greater(zip_ref, target_file, reg):
8
10
  content = file.read().decode('utf-8')
9
11
  match = reg.search(content)
10
12
  if match:
11
- version = match.group(2)
12
- version_nums = version.split(".")
13
- if len(version_nums) >= 3 and int(version_nums[0]) >= 6 and int(version_nums[2]) >= 4:
14
- return True
13
+ version_str = match.group(2)
14
+ try:
15
+ current_ver = version.parse(version_str)
16
+ target_ver = version.parse(os.environ.get("TARGET_OTTER_VERSION"))
17
+ return current_ver >= target_ver
18
+ except Exception:
19
+ pass
15
20
  return False
16
21
 
17
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: otter_service_stdalone
3
- Version: 1.1.25
3
+ Version: 1.1.27
4
4
  Summary: Grading Service for Instructors using Otter Grader
5
5
  Home-page: https://github.com/sean-morris/otter-service-stdalone
6
6
  Author: Sean Morris
@@ -1,12 +1,12 @@
1
- otter_service_stdalone/__init__.py,sha256=GUhBe-u2VIxlWj6VnsQTa5f-5Y_9NH483RwP3bh4950,23
1
+ otter_service_stdalone/__init__.py,sha256=Ic1q5iNlYFlxryUNn49tIjp1KtV-8DMqDsPQHB0fNtY,23
2
2
  otter_service_stdalone/access_sops_keys.py,sha256=nboU5aZ84Elrm5vO0dMgpIF5LLcnecpNAwpxKvj6DvU,2129
3
- otter_service_stdalone/app.py,sha256=CR6QaQlPO0I04Llxn48eTDJEWUaALI-nTrri1nf1wkI,15990
3
+ otter_service_stdalone/app.py,sha256=MALn80A-zWUw2QfWQG7kll7gSZIsnvISKDb6zRRYVrs,16244
4
4
  otter_service_stdalone/fs_logging.py,sha256=IKFZkc5TmpI6G3vTYFAU9jDjQ-GT5aRxk8kdZ0h0kJE,2390
5
5
  otter_service_stdalone/grade_notebooks.py,sha256=x19MK_ResW-xM3mdwEUALsdsCiX4I1OHmODUHodcIow,3817
6
6
  otter_service_stdalone/index.html,sha256=eEbFGxbV-plE5bAggGYHTv1q7yqoTN4kJbzL729uMmk,7276
7
7
  otter_service_stdalone/upload_handle.py,sha256=PbpQEyUIPKercJ9hegKwvxHBvSc9uylhIfwjvHybjs0,5061
8
8
  otter_service_stdalone/user_auth.py,sha256=L9Kfj1BsQttAteHhRn71IUY8WX9nvBy3MXVGq1yjTtE,4253
9
- otter_service_stdalone/util.py,sha256=O8NKOFZiS2cg6feHlPjMCumFqnfshwC7nyyJ-T-RIAo,1404
9
+ otter_service_stdalone/util.py,sha256=HtPmi0vEi2v7CZft3GYfpppbkd8UOb_IMubUplpTWi8,1544
10
10
  otter_service_stdalone/scripts/web_socket.js,sha256=0h71SNvaD7WNQ735KvuqAPsLYvqHyxzUbLWMu-8qYds,6348
11
11
  otter_service_stdalone/secrets/gh_key.dev.yaml,sha256=ORUVDu8SDcv0OE2ThwROppeg7y8oLkJJbPTCMn0s5l0,1138
12
12
  otter_service_stdalone/secrets/gh_key.local.yaml,sha256=NtPXXyGf1iSgJ9Oa2ahvIEf_fcmflB3dwd3LWyCgxis,1138
@@ -15,8 +15,8 @@ otter_service_stdalone/secrets/gh_key.staging.yaml,sha256=cKVqj4dcwuz2LhXwMNQy_1
15
15
  otter_service_stdalone/static_files/README_DO_NOT_DISTRIBUTE.txt,sha256=eMqBa1du1u0c07fuG3Eu9DDHuixRTFEbiQwrlvAnL1Y,353
16
16
  otter_service_stdalone/static_templates/403.html,sha256=7eO3XQsEkl4nF8PEeFkLwCzGBfdZ3kkkeu_Kgpgbh0k,1440
17
17
  otter_service_stdalone/static_templates/500.html,sha256=t6DeEMp8piSWyBToHb_JpTrw3GStAHFrozlmeuXyamg,1421
18
- otter_service_stdalone-1.1.25.dist-info/METADATA,sha256=dzDrh9QLpjRvaf2g4vvWoRfhy6FeSPEE1ffnmOt5v90,1468
19
- otter_service_stdalone-1.1.25.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
- otter_service_stdalone-1.1.25.dist-info/entry_points.txt,sha256=cx447chuIEl8ly9jEoF5-2xNhaKsWcIMDdhUMH_00qQ,75
21
- otter_service_stdalone-1.1.25.dist-info/top_level.txt,sha256=6UP22fD4OhbLt23E01v8Kvjn44vPRbyTIg_GqMYL-Ng,23
22
- otter_service_stdalone-1.1.25.dist-info/RECORD,,
18
+ otter_service_stdalone-1.1.27.dist-info/METADATA,sha256=pP3hdyM-IOBCq_s3rJbvqWB_1lB3NqXFfEWNmOnhE8c,1468
19
+ otter_service_stdalone-1.1.27.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
+ otter_service_stdalone-1.1.27.dist-info/entry_points.txt,sha256=cx447chuIEl8ly9jEoF5-2xNhaKsWcIMDdhUMH_00qQ,75
21
+ otter_service_stdalone-1.1.27.dist-info/top_level.txt,sha256=6UP22fD4OhbLt23E01v8Kvjn44vPRbyTIg_GqMYL-Ng,23
22
+ otter_service_stdalone-1.1.27.dist-info/RECORD,,