-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with nbconvert v6 #1421
Conversation
Windows tests are failing. Seems like it possibly has to do with the execute preprocessor. I am not sure if this is transient or caused by the upgrade to nbconvert but will try to investigate later... |
- From jupyter#1373, thanks @gzagatti - I can't quickly find the latest version of jinja2 that requires this
- Solution from jupyter#1373, thanks to @gzagatti - I don't know how or why this works
…ml.j2 - Necessary when renaming templates
- nbconvert has changed the name of its basic.tpl to classic/index.html.j2. Found via looking into the source code.
- This seems to be about where these changes are. Could be slightly older but not too much.
- Was the wrong variable name - Needed to be extended, not overwritten
It looks like there were breaking changes on Windows + Python 3.8 related to async IO. Some related threads: https://github.com/tornadoweb/tornado/issues/2608 |
Thanks @echuber2 , indeed it looks as though this is due to asyncio issues on windows. The proper fix will have to com from nbclient (jupyter/nbclient#85) but for now I'll see if I can use the workaround. |
Ok, the workaround works, but the nbextensions are still failing the tests for some reason. I tried, and failed, to resurrect my windows dev environment, so I'm blocked on figuring that out for the time being. I'll try to spin up a clean VM and see if I can debug there, but not tonight unfortunately. |
Worked a bit more on this tonight, and just to document my progress:
|
Ok, I worked on this for quite a while tonight as well. I attempted to shell out the autograder and validation code into a subprocess so that it uses a different event loop, and this does indeed work, but creates a whole host of other problems---the subprocess do not inherit configs loaded in the parent process, the validator returns a structured dictionary and so I have to save this to a temporary file and the load the results in the parent process, etc. It's getting to the point where this is a very ugly hack and I'm not feeling comfortable with this direction 😞 What I don't get more generally is why this is a problem for nbclient (nbconvert) but not the notebook itself. I get that the code to execute a notebook is separate (https://github.com/jupyter/nbclient/blob/master/nbclient/client.py vs https://github.com/jupyter/notebook/blob/a5ace13e0a5d99f314e3b933b2b079ff0bffbd5a/notebook/services/kernels/handlers.py) so maybe there is some difference there? I think I'll go comment on the nbclient repo and see if anyone there has any suggestions. |
Whilst the spinout is turning into an ugly hack..... a revisit at later date could be good: if we can un-couple the autograding from the instructors notebook-server... then it makes multiple markers a more interesting solution (shared/centralised gradebook.db-esqu database, shared grading filestore, etc... |
Yeah, that's actually more like how the autograder used to work---it used to be a completely standalone process. We made the move to have it be a notebook extension so that it was easier to install, but I agree that choice has made it more complicated and confusing in some ways as well. Though I'll note, you don't necessarily have to couple it with the instructors' notebook, it can be its own separate notebook server (it just requires a notebook server) which you can grant multiple instructors access to via JupyterHub groups. |
@@ -53,6 +54,12 @@ | |||
}) | |||
|
|||
|
|||
# See https://bugs.python.org/issue37373 :( | |||
# Workaround from https://github.com/jupyter/nbconvert/issues/1372 | |||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at how the extensions are organized, I'm not sure this import happens for the server extensions. Try moving this to a step in nbgrader.apps.baseapp.NbGrader.initialize()
, then it might be enough.
Hello, is nbgrader already compatible with nbconvert v6? Have you managed to fix this issue? Thanks for all your effort. I would like to contribute but my knowledge and time are limited. Thanks again |
Superseded by #1567 |
Following on @rkdarst 's initial PR in #1405, this updates nbgrader to be compatible with nbconvert version 6+. The main changes are:
Closes: #1373, Closes: #1382, Closes: #1367, Closes #1411