Command to "reinstall" a plugin?

Hello, The instructions at https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html#bui... talk about how to build and install a bundle plugin (with the "devel build" and "devel install" commands). However, I notice that executing these commands doesn't necessarily reflect the changes I'm making to the plugin I'm actively developing. (The changes I make to the source code don't take effect in ChimeraX.) -- I've figured out that to make the changes show up, I need to execute `toolshed uninstall` first, prior to `devel install`. (I've also noticed that it seems like a separate `devel build` step isn't needed if you are running `devel install`, which is not clear from the documentation.) Is there something like a `devel reinstall` command which will do this for me in a single command? That would make doing things like iterative debugging a bit easier. -- Or am I potentially doing something wrong with how I'm running the install command. Thanks, Rocco

Hi Rocco, Add “reinstall true” to the arguments to your develop command, or install your package in editable mode in the first place (“editable true”). — Zach
On 10 Feb 2025, at 14:25, Rocco Moretti via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Hello,
The instructions at https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html#bui... talk about how to build and install a bundle plugin (with the "devel build" and "devel install" commands).
However, I notice that executing these commands doesn't necessarily reflect the changes I'm making to the plugin I'm actively developing. (The changes I make to the source code don't take effect in ChimeraX.) -- I've figured out that to make the changes show up, I need to execute `toolshed uninstall` first, prior to `devel install`. (I've also noticed that it seems like a separate `devel build` step isn't needed if you are running `devel install`, which is not clear from the documentation.)
Is there something like a `devel reinstall` command which will do this for me in a single command? That would make doing things like iterative debugging a bit easier. -- Or am I potentially doing something wrong with how I'm running the install command.
Thanks, Rocco _______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu

Hi Rocco, I think "devel install" is installing the new Python code in ChimeraX and if you restart ChimeraX it will be using the new code. But probably you don't want to restart ChimeraX. The trouble with that is a general Python issue that once Python has imported a module if it later sees an import of the same module it does not reimport it. Python does not check if the code file changed and reimport, it just continues to use the already imported version. There are tricks to try to fix that (e.g. Python the "reload" function) but it is not easy to try to unload all your previous Python which may be in multiple files and may have registered callbacks to it with ChimeraX. Zach suggested two such tricks using the "editable true" option, or the "reinstall true". I don't see documentation for either of those options which gives you an idea of how well we support them. Our usual answer has been to just restart ChimeraX after installing new code, but of course that slows down development. Tom
On Feb 10, 2025, at 2:31 PM, Zach Pearson via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Hi Rocco,
Add “reinstall true” to the arguments to your develop command, or install your package in editable mode in the first place (“editable true”).
— Zach
On 10 Feb 2025, at 14:25, Rocco Moretti via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Hello,
The instructions at https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html#bui... talk about how to build and install a bundle plugin (with the "devel build" and "devel install" commands).
However, I notice that executing these commands doesn't necessarily reflect the changes I'm making to the plugin I'm actively developing. (The changes I make to the source code don't take effect in ChimeraX.) -- I've figured out that to make the changes show up, I need to execute `toolshed uninstall` first, prior to `devel install`. (I've also noticed that it seems like a separate `devel build` step isn't needed if you are running `devel install`, which is not clear from the documentation.)
Is there something like a `devel reinstall` command which will do this for me in a single command? That would make doing things like iterative debugging a bit easier. -- Or am I potentially doing something wrong with how I'm running the install command.
Thanks, Rocco _______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu
participants (3)
-
Rocco Moretti
-
Tom Goddard
-
Zach Pearson