otter-service-stdalone 0.0.51__py3-none-any.whl → 0.0.55__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.
- otter_service_stdalone/__init__.py +1 -1
- otter_service_stdalone/app.py +19 -1
- {otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/METADATA +1 -1
- otter_service_stdalone-0.0.55.dist-info/RECORD +9 -0
- {otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/WHEEL +1 -1
- otter_service_stdalone-0.0.51.dist-info/RECORD +0 -9
- {otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/entry_points.txt +0 -0
- {otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.0.
|
1
|
+
__version__ = "0.0.55"
|
otter_service_stdalone/app.py
CHANGED
@@ -11,13 +11,32 @@ import async_timeout
|
|
11
11
|
__UPLOADS__ = "/tmp/uploads"
|
12
12
|
|
13
13
|
class GradeNotebooks():
|
14
|
+
def get_otter_version(self, auto_path):
|
15
|
+
zip_folder = auto_path.split(".")[0]
|
16
|
+
with ZipFile(auto_path, 'r') as zObject:
|
17
|
+
zObject.extractall(path=zip_folder)
|
18
|
+
with open(f"{zip_folder}/requirements.txt") as file:
|
19
|
+
for line in file:
|
20
|
+
if "otter-grader" in line:
|
21
|
+
version = line.split("==")[1].split(".")[0]
|
22
|
+
log.write_logs("Preparation: Grading", f"Otter Version: {version}", "info", f'{os.environ.get("ENVIRONMENT")}-logs')
|
23
|
+
if int(version) < 3:
|
24
|
+
log.write_logs("Preparation: Grading", f"Otter Version less than 3: {version} - changed to version 3", "info", f'{os.environ.get("ENVIRONMENT")}-logs')
|
25
|
+
version = "3"
|
26
|
+
|
27
|
+
return version
|
28
|
+
return Exception("Otter-Grader version not found in requirements")
|
29
|
+
|
14
30
|
async def grade(self, p, notebooks_zip):
|
15
31
|
try:
|
16
32
|
zip_folder = notebooks_zip.split(".")[0]
|
17
33
|
with ZipFile(notebooks_zip, 'r') as zObject:
|
18
34
|
zObject.extractall(path=zip_folder)
|
19
35
|
|
36
|
+
otter_version = self.get_otter_version(p)
|
37
|
+
path = f"/etc/venv-otter{otter_version}/bin/python3"
|
20
38
|
command = [
|
39
|
+
path, "-m"
|
21
40
|
'otter', 'grade',
|
22
41
|
'-a', p,
|
23
42
|
'-p', zip_folder,
|
@@ -100,7 +119,6 @@ class Upload(tornado.web.RequestHandler):
|
|
100
119
|
autograder = self.request.files['autograder'][0] if "autograder" in files else None
|
101
120
|
notebooks = self.request.files['notebooks'][0] if "notebooks" in files else None
|
102
121
|
if autograder is not None and notebooks is not None:
|
103
|
-
print("fileinfo is: ", autograder)
|
104
122
|
notebooks_fname = notebooks['filename']
|
105
123
|
notebooks_extn = os.path.splitext(notebooks_fname)[1]
|
106
124
|
results_path = str(uuid.uuid4())
|
@@ -0,0 +1,9 @@
|
|
1
|
+
otter_service_stdalone/__init__.py,sha256=jXOOiiBG8YrcSzw2nujXNZ67Lc4_BDh5cva6CjfFnJo,23
|
2
|
+
otter_service_stdalone/app.py,sha256=31AeZ6ozyxm70rRJABj2SJMj5sWjBHi7DfyYpX83qmU,7467
|
3
|
+
otter_service_stdalone/fs_logging.py,sha256=BaigFMwt277bW-MXnQKvmiBiyYBNxNRQz_ilPoxcO-w,1734
|
4
|
+
otter_service_stdalone/index.html,sha256=Kxg-itiwyIRvnqjOYBB8Sa73WczkE601jptOfXlIM3w,6024
|
5
|
+
otter_service_stdalone-0.0.55.dist-info/METADATA,sha256=dCzQxCRT0vf2wD5pCFz16hzp0GXeXKcrEqG32FMDW7I,1345
|
6
|
+
otter_service_stdalone-0.0.55.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
7
|
+
otter_service_stdalone-0.0.55.dist-info/entry_points.txt,sha256=cx447chuIEl8ly9jEoF5-2xNhaKsWcIMDdhUMH_00qQ,75
|
8
|
+
otter_service_stdalone-0.0.55.dist-info/top_level.txt,sha256=6UP22fD4OhbLt23E01v8Kvjn44vPRbyTIg_GqMYL-Ng,23
|
9
|
+
otter_service_stdalone-0.0.55.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
otter_service_stdalone/__init__.py,sha256=a8pM17WeWYYAxbOZmoVZmj8DiMfrW4RCZSq3ceZABpM,23
|
2
|
-
otter_service_stdalone/app.py,sha256=lZiWeILzK0W_GytBERMxxcdu6na5xisN6gZJVDRYkLg,6456
|
3
|
-
otter_service_stdalone/fs_logging.py,sha256=BaigFMwt277bW-MXnQKvmiBiyYBNxNRQz_ilPoxcO-w,1734
|
4
|
-
otter_service_stdalone/index.html,sha256=Kxg-itiwyIRvnqjOYBB8Sa73WczkE601jptOfXlIM3w,6024
|
5
|
-
otter_service_stdalone-0.0.51.dist-info/METADATA,sha256=ECq4wPScSKTEYAliqyIe4GGPBTSm91W-XmrWSc5RdJM,1345
|
6
|
-
otter_service_stdalone-0.0.51.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
7
|
-
otter_service_stdalone-0.0.51.dist-info/entry_points.txt,sha256=cx447chuIEl8ly9jEoF5-2xNhaKsWcIMDdhUMH_00qQ,75
|
8
|
-
otter_service_stdalone-0.0.51.dist-info/top_level.txt,sha256=6UP22fD4OhbLt23E01v8Kvjn44vPRbyTIg_GqMYL-Ng,23
|
9
|
-
otter_service_stdalone-0.0.51.dist-info/RECORD,,
|
{otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/entry_points.txt
RENAMED
File without changes
|
{otter_service_stdalone-0.0.51.dist-info → otter_service_stdalone-0.0.55.dist-info}/top_level.txt
RENAMED
File without changes
|