How to rename an extension being developed?

Hello,

I am new to extension making. I followed the “Let’s Make an Astronomy Picture of the Day JupyterLab Extension”, made it work (so my extension has “jupyterlab_apod” as name), and edited code so that it does what I want it to do (which is nothing to do with fetching and showing a picture). Now, I want to publish it under the name that reflects what it is. How do I rename it from here?

Thanks!

P.S.
The tutorial has a few minor issues if you really try to follow (like the definition of APODWidget does not have closing brace and trying to jlpm add at the suggested points causes an error as the code is not complete yet, etc.

It looks like I just grep for all occurrences of the example name and replace it everywhere, including the directory name the build system does take care of it. So it was okay in the end.

Or not. actually. At one point (I don’t remember changing any workflow nor stopped the server or such) it started picking up the old extension and code modification to the current files does not change the system anymore. In the Chrome debugger’s file tree, it shows the old original name as a package name.

Has anyone seen something like this?

In case anyone else is trying to do this again and fail to do so, I managed to change the extension name (and the released package name) with the following steps :

  1. Inside your conda environment : jlpm clean:all
  2. Search and replace all occurrences of your <extension-name> in all your extension files and replace with the new name (for ex through VS Code Search extension)
  3. Double check for occurrences with or without underscores ‘_’ and hyphens ‘-’
  4. Through your device file explorer, search your extension name, this time to replace all folders or files that are named after your extension
  5. Inside your conda environment : pip uninstall <extension-name>
  6. pip install -ve .
  7. jupyter labextension develop --overwrite .
  8. jlpm run watch to check if the build works fine
  9. jupyter lab test your extension
  10. git add, commit and push
  11. Check the build and check release workflows to make sure nothing is failing
  12. Release the new package with Step 1: Prep Release and Step 2: Publish Release workflows

Now you should have a published package with the new name.

1 Like