sympy / live

SymPy Live Shell based on the JupyterLite and Pyodide
https://live.sympy.org
10 stars 5 forks source link

Update requirements.txt to match changes in jupyterlite/demo #15

Closed ivanistheone closed 1 year ago

ivanistheone commented 1 year ago

In issue https://github.com/sympy/live/issues/14 @sylee957 reports that the live shell is currently using an old version of sympy.

I tried triggering CI pipeline with this commit hoping this would include the latest version in the build, but that didn't do it (the sympy import is done at load time).

I'm therefore trying this new approach in this PR, which is to update the version of jupyterlite and jupyterlab we're using, to match what was done in the jupyterlite/demo/ commits:

asmeurer commented 1 year ago

Will this need to be done every time SymPy is updated, or was this just some bug that prevented it from being updated before?

ivanistheone commented 1 year ago

Will this need to be done every time SymPy is updated, or was this just some bug that prevented it from being updated before?

When we run the command import sympy in during the initialization of the shell, we're getting whatever latest version is available in underlying pyodide.

Previously, the jupyterlite we were using was based on an older version of pyodide, which had sympy 1.10.1 in it, see https://pyodide.org/en/0.21.3/usage/packages-in-pyodide.html

And now, by switching to the latest jupyterlite, we're getting the latest pyodide too, which has 1.11.1

I think pyodide does some pre-processing complilation of sympy package in order to make it work in js-land; possibly because of mpmath. Otherwise pure-Python packages get pulled in directly from PyPI.

So to answer your question, there was no bug, but we're tied to the release cycle of pyodide and by jupyterlite.

asmeurer commented 1 year ago

I think pyodide does some pre-processing complilation of sympy package in order to make it work in js-land; possibly because of mpmath. Otherwise pure-Python packages get pulled in directly from PyPI.

I noticed it deletes the test suite from the package (presumably to shave down the package size). It might not be more than that, although I would be interested to see if they are doing anything else.

That's unfortunate that the pinning of jupyterlite and pyodide itself also effectively pins sympy. I would expect it to pull in sympy from a repository, even if it's a patched sympy from a special pyodide repository, so that the sympy version is independent of the pyodide version.

I was rather hoping this would just automatically always use the latest sympy version. With the previous SymPy Live it was always an issue that people never remembered to update sympy whenever there was a release.