You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
An increasing amount of users are using mount_chainlit() to deploy from within another FastAPI app.
Some of them are running into issues with dependencies (#731#950) and many of them (including the undersigned) want to make improvements or changes and test them locally.
As it stands, the Python package can be installed from a subdirectory (e.g. poetry add git+https://github.com/myorg/mypackage_with_subdirs.git@main#subdirectory=subdir) but in this case it seems that the frontend is not distributed alongside the package as it would be for PyPI.
Describe the solution you'd like
Ideally, I would suggest that the Python install automatically builds the frontend on install. Alternatively, we should at least have instructions on how to proceed in such a case.
Approaches
Build on install
It's not evidently clear how to call arbitrary code (like pnpm run buildUi to build the frontend) during the Python package installation process, especially not when installing as editable/from source.
Is your feature request related to a problem?
An increasing amount of users are using
mount_chainlit()
to deploy from within another FastAPI app.Some of them are running into issues with dependencies (#731 #950) and many of them (including the undersigned) want to make improvements or changes and test them locally.
As it stands, the Python package can be installed from a subdirectory (e.g.
poetry add git+https://github.com/myorg/mypackage_with_subdirs.git@main#subdirectory=subdir
) but in this case it seems that the frontend is not distributed alongside the package as it would be for PyPI.Describe the solution you'd like
Ideally, I would suggest that the Python install automatically builds the frontend on install. Alternatively, we should at least have instructions on how to proceed in such a case.
Approaches
Build on install
It's not evidently clear how to call arbitrary code (like
pnpm run buildUi
to build the frontend) during the Python package installation process, especially not when installing as editable/from source.Example: https://sam.hooke.me/note/2023/08/poetry-build-py-example/
Build on first launch
One approach might be to build the frontend on first application launch.
We'd check for existence of the frontend dir and if not, we build.
Package frontend separately
Another could be to package the frontend as a separate (binary/blob) type of dependency, so that it can be separately installed.
An example of this: https://pypi.org/project/vite-project/ (source: https://github.com/itayB/vite-project)
Resources/references
https://discuss.python.org/t/running-custom-code-on-package-install/16160/2
The text was updated successfully, but these errors were encountered: