Thanks. So the extension manager’s Install from file button cannot be used to install a purely scripted module? It has to be done by specifying an additional module path?
The install from file button is intended to install extension packages, which are as @jcfr says are the tar/zip files. When we distribute extensions on the factory machines, pure python extensions are still “built” i.e. cmake and the build system are used to copy and zip the files into the appropriate structure.
The best and most repeatable way to generate the release object is to build and package the extension so that it is compatible with the Slicer extension ecosystem.
It would be nice to build extension package from Python-only extensions without having to build Slicer. There could be several options:
Option A: Use the build tree in slicer/slicer-base docker image. It may be just a single-line command that you need to write to build a package from your extension’s source tree. Unfortunately, it would only create Linux package.
Option B: Create some sham CMake files that would provide an empty Slicer package for find_package and various CMake macros and functions that are used for building an extension. Then CMake could be pip-installed and used for building the package, without a real Slicer build tree and without the need for any additional build tools.
Option C: Create an alternative packaging method for Python-only packages. It could be based on a manifest file that would specify extension metadata and list of files to include in the package. We would then need 1. some Python scripts that could create an extension package based on this manifest, and 2. CMake functions, which would allow building and testing the extension based on information in the manifest file.
Thank you everyone for the responses. So in the end it is possible to install a purely scripted extension using the “Install from file” button. Piecing it together from the replies above, here is what finally worked for me:
mkdir build
cd build
cmake .. -DSlicer_DIR=path/to/my/slicer/inner/build -DCMAKE_BUILD_TYPE:STRING=Release
make package
This created a tar.gz file that I was then able to use with the “Install from file” button.
(This is sort of explained in a scattered way in the extension guide, but was not very straight forward to tease out for me, partly because I have a poor understanding of build systems , so ty for the help)