sagemathinc / cocalc-example-files

Collection of examples to get started with CoCalc
45 stars 35 forks source link

parts of sagews-jupyter example fail on newly installed cocalc docker instance #21

Open edgimar opened 3 years ago

edgimar commented 3 years ago

When trying to run this worksheet on a self-hosted cocalc instance (docker container built/pulled on 2021-04-15), various cells fail to run. For example:

# embed external web page
from IPython.core.display import HTML
HTML('<iframe src="https://en.m.wikipedia.org/" width="95%" height=350>')

results in the following:

Error in lines 1-1
Traceback (most recent call last):
  File "/usr/local/sage/local/lib/python3.8/site-packages/smc_sagews/sage_server.py", line 1230, in execute
    exec(
  File "", line 1, in <module>
  File "/usr/local/sage/local/lib/python3.8/site-packages/smc_sagews/sage_server.py", line 1324, in execute_with_code_decorators
    code = code_decorator(code)
  File "/usr/local/sage/local/lib/python3.8/site-packages/smc_sagews/sage_jupyter.py", line 360, in run_code
    display_mime(content['data'])
  File "/usr/local/sage/local/lib/python3.8/site-packages/smc_sagews/sage_jupyter.py", line 292, in display_mime
    show(msg_data['text/latex'])
KeyError: 'text/latex'

Either the example code is no longer valid, or is there a bug in sage/cocalc, it seems.

haraldschilly commented 3 years ago

yes, that's a bug in sage. in particular, it's that jupyter( ... ) mode, which somehow can't deal with a certain message type. I made a ticket.

edgimar commented 3 years ago

With all of the CI tools available now, I wonder if it would be possible to use the worksheets in this repository as tests that run for new commits to the sage codebase. Is that possible currently?

haraldschilly commented 3 years ago

Well, Sage can't run CoCalc's Sage Worksheets. One would have to write code that ties up the part of CoCalc running the worksheet with sage. However, this is in any way a Sage specific issue, because it happens when you run the jupyter kernel for python.