jupyterlite / xeus-python-demo

JupyterLite template repository with xeus-python as default kernel
https://jupyterlite.github.io/xeus-python-demo/
48 stars 13 forks source link

Pin Pydantic to <2.0 in build-environment.yml #24

Closed stephenmccalman closed 1 year ago

stephenmccalman commented 1 year ago

Description

xeus-python-demo uses the latest pydantic, which is now v2.0. This appears to create an error in the build of the demo.

/home/runner/micromamba-root/envs/build-env/lib/python3.11/site-packages/jupyterlite_core/addons/__init__.py:69: UserWarning: [lite] [jupyterlite-xeus-python] failed to load: To define root models, use `pydantic.RootModel` rather than a field called '__root__'

While template will build and deploy (despite this error), the environment.yml's package (ipycanvas) is not available in the jupyterlite-xeus-python kernel (after launching the jupyterlite)

Pinning pydantic to <2.0 in the build-environment.yml will allow the demo to build and deploy properly.

Reproduce

Use to template to create a new demo. Add page to github actions

Context

stephenmccalman commented 1 year ago

It appears that empack does not support Pydantic V2 yet.

https://docs.pydantic.dev/2.0/migration/ namely,

We have replaced the use of the root field to specify a "custom root model" with a new type called RootModel which is intended to replace the functionality of using a field called root in Pydantic V1.

martinRenou commented 1 year ago

Thanks for opening an issue! I'm moving it to empack