jupyter-widgets / widget-cookiecutter

A cookiecutter template for creating a custom Jupyter widget project.
BSD 3-Clause "New" or "Revised" License
257 stars 72 forks source link

Tips for making extension building optional #49

Open djhoese opened 5 years ago

djhoese commented 5 years ago

I recently updated the vispy jupyter extension to work with modern notebook/jlab and got everything to work for the extension. However, since vispy is not "just" a jupyter extension we're now running in to issues installing the package from github (from source). The related issue is https://github.com/vispy/vispy/issues/1619. It seems related mostly to users either not having npm installed or not having a recent version (at least that's my guess).

I've been trying to think of the best way to handle this and was hoping people here could give me other suggestions. My top solution so far is to add the static/*.js files to the repository. Other ideas?

Or...am I doing something wrong in vispy's setup.py and this is supposed to work the way I need.

vidartf commented 4 years ago

The ideal solution here would probably be to update the cookiecutter to rely on PEP518, and specify a build time dependency on jupyter_packaging. When used correctly, that package helps ensure that both the sdist and bdist_wheel include the built JS, so that node is only required for jupyterlab or development.