otter-grader icon indicating copy to clipboard operation
otter-grader copied to clipboard

Clean up Jupyterlite support

Open chrispyles opened this issue 3 years ago • 5 comments

Support for Jupyterlite was added for #458 but this was done before things like open and filesystem access were supported in Jupyterlite. As a result, the implementation (mainly related to the Notebook class and downloading/storing tests) should be cleaned up. (See #458 for details.)

chrispyles avatar Aug 20 '22 22:08 chrispyles

@chrispyles I finally got back here. I am running into the "dill" import problem you spoke about in #458. It looked like you found a way through this problem.

import micropip
await micropip.install('otter-grader==4.3.1')

Ideas?

sean-morris avatar Apr 06 '23 16:04 sean-morris

@sean-morris what errors are you getting specifically? I am able to install and import otter.Notebook on Jupyterlite successfully.

chrispyles avatar Apr 08 '23 19:04 chrispyles

@chrispyles I get this error: image

Trying to run this cell:

# The pip install can take a minute
import micropip
await micropip.install('otter-grader==4.3.1')

# Initialize Otter
import otter
grader = otter.Notebook("hw09.ipynb")

On the Pyodide kernel from the distribution on the jupyterlite site

Thanks

sean-morris avatar Apr 08 '23 19:04 sean-morris

It looks like Otter's method for determining whether it is running on Jupyterlite has been broken by a change to the interpreter. I will add a fix but in the mean time you will need to tell otter.Notebook that it is running on Jupyterlite manually. If this is a notebook generated by Otter Assign, add runs_on: jupyterlite to the assignment config. If not, set jupyterlite=True in otter.Notebook(): otter.Notebook("hw09.ipynb", jupyterlite=True).

chrispyles avatar Apr 08 '23 19:04 chrispyles

It looks like Otter's method for determining whether it is running on Jupyterlite has been broken by a change to the interpreter. I will add a fix but in the mean time you will need to tell otter.Notebook that it is running on Jupyterlite manually. If this is a notebook generated by Otter Assign, add runs_on: jupyterlite to the assignment config. If not, set jupyterlite=True in otter.Notebook(): otter.Notebook("hw09.ipynb", jupyterlite=True).

Thanks @chrispyles this is perfect

sean-morris avatar Apr 12 '23 01:04 sean-morris