Package: ploomber-extension
ploomber-extension[!TIP]
Deploy AI apps for free onPloomber Cloud!Installpipinstallploomber-extensionContributingDevelopment installcondacreate--nameploomber-extensionpython=3--channelconda-forge--yes
condaactivateploomber-extension
condainstallnodejs--channelconda-forge--yes
pipinstall-rrequirements.txt
pipinstall-rrequirements.dev.txt

jlpminstallNote:pkgmt formatcan be used to format and lint Python files before committing code.
To format JavaScript and TypeScript files, useyarn run eslint. To lint without formatting,
useyarn run eslint:check# Note: this command will take some time the first time as it has to compile the# frontend code. If the command fails, see the "troubleshooting setup" section belowpipinstall-e"."# upon installation, both the frontend and backend extensions must be activated# automatically, you can verify it by ensuring ploomber-extension appears here:jupyterlabextensionlist# frontend extensionjupyterserverextensionlist# backend extension# if they don't appear, you can activate them manually, but this means that# the setup is incorrect! see pyproject.toml, under# tool.hatch.build.targets.wheel.shared-data, and fix any issues# activate manuallyjupyterserverextensionenableploomber_extension
jupyterlabextensionenableploomber_extension


jupyterlabextensiondevelop.--overwrite# NOTE: the two previous commands will fail if there are missing dependencies# rebuild extension Typescript# important: we had to set skipLibCheck: true# https://discourse.jupyter.org/t/struggling-with-extensions-and-dependencies-versions/19550jlpmbuildTo watch for changes and reload:# in one terminaljlpmwatch# another terminaljupyterlabRefresh JupyterLab to load the change in your browser.By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseTroubleshooting setupIf you encounter errors when installing the package for development, you can try the
following to configure an environment from scratch:# remove conda environmentcondaenvremove--nameploomber-extension# delete yarn.lockrmyarn.lock# delete all temporary filesgitclean-fdxThen, create the conda environment again, install dependencies (jlpm install), and
build the extension manually (jupyter labextension build --development True .).
Finally, verify ifpip install -e "."works.Adding dependenciesjlpmaddPACKAGE# examplejlpmadd@jupyter-widgets/baseDevelopment uninstallpipuninstallploomber-extensionIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedploomber-extensionwithin that folder.Testing the extensionThis extension is usingJestfor JavaScript code testing.This extension usesPlaywrightfor the integration tests (aka user level tests).
More precisely, the JupyterLab helperGalatais used to handle testing the extension in JupyterLab. More information are provided within theui-testsREADME.To run the tests:pipinstallnoxpyyaml# unit testsnox--sessiontest# ui testsnox--sessionui_test# to only run the python unit testspytesttestsReleasing the extensionSeeRELEASEConfigurationThepackage.jsonfile contains ajupyterlabextension. More information about
this section ishere(you might need to switch the git branch dependin on which version JupyterLab version you're building for). The schema ishere.Ploomber Cloud API EndpointYou can set thePLOOMBER_CLOUD_HOSTvariable to switch the API endpoint (by default, it's set to our production API endpoint).exportPLOOMBER_CLOUD_HOST=https://cloudapi-dev.ploomber.io