moves-rwth/stormpy

Package stormpy as a wheel

Opened this issue · 6 comments

Hi,
it is easy to compile stormpy as a python wheel:

python3 -m build --wheel
=> Successfully built stormpy-1.8.0-cp312-cp312-macosx_14_0_arm64.whl

pip install ./dist/stormpy-1.8.0-cp312-cp312-macosx_14_0_arm64.whl

Why not package it as a wheel? The stormpy installation would go from compiling storm on the right version, compiling stormpy, etc., to just doing a pip install stormpy. There would need to be someone on a Linux and someone on a MacOS system compiling it every release, but I don't see this as a big issue.
You could also package it as a wheel under a different name or under a toggle, like pip install stormpy[prebuilt].

That reminds me that I should keep an eye on the stormpy package at pypi. At the moment, the package needs to be compiled though and we do not distribute a pre-compiled python wheel.
A potential problem might be that users have different configurations of Storm installed and I am not sure how well a pre-compiled package would work here. Do you have experience with it?

I would also first start with providing binaries for Storm (see moves-rwth/storm#527) before looking at stormpy.

A potential problem might be that users have different configurations of Storm installed and I am not sure how well a pre-compiled package would work here. Do you have experience with it?

As far as I understand, a python wheel is supposed to be a self-contained binary, but there might be issues with linking dependencies, I'll have to look closer. One probably has to do some configuration before it works well.

I would also first start with providing binaries for Storm (see moves-rwth/storm#527) before looking at stormpy.

Maybe, I don't know. I can still install storm through homebrew or the AUR more or less easily, but this isn't the case for stormpy. I also kind of subjectively expect a python tool to be easily installable with pip, but I don't have the same expectations of a C++ tool. But of course, doing both would be great for prospective users :)

Regarding easy to install via pip: it should work in principle with pip install stormpy using the existing pypi package. It will need to compile stormpy but it should not require any more steps from your side.
I have not tested it recently, so let me know in case of problems.

Regarding easy to install via pip: it should work in principle with pip install stormpy using the existing pypi package. It will need to compile stormpy but it should not require any more steps from your side. I have not tested it recently, so let me know in case of problems.

That package looks for my local storm install and compiles using that, so I guess you need storm installed? I was suggesting to put storm into the prebuilt wheel (I'm not sure if this is what I'm doing with the above commands though).

Ok, now I understand your idea. As far as I am aware the wheel package will only contain the stormpy libraries but not Storm itself.
Personally, I would try to keep Storm and stormpy in separate libraries as stormpy is supposed to be an addon to Storm. Moreover, Storm itself depends on other packages which must be installed via a package manager and not via Python.
But I can understand that we want to have an easier installation process, especially if most people want to access Storm through Python. If we would have a pre-built Storm binary, we could maybe ship it in a pre-built stormpy package. One other way currently supported is to go via Python notebooks in a Docker container.

As far as I am aware the wheel package will only contain the stormpy libraries but not Storm itself.

That makes sense. We can probably get storm in there though :)

Storm itself depends on other packages which must be installed via a package manager and not via Python

This is true for many Python packages, but as long as it's only via the package manager, it's still quite a bit easier than compiling Storm.

stormpy is supposed to be an addon to Storm

Yes, but it's also the easiest way to use Storm as a backend and glue it together with other projects :)

One other way currently supported is to go via Python notebooks in a Docker container.

Yes, but that is more difficult to set up locally. It's a different thing, more a playground for stormpy than something you would use in a small project where you also have other dependencies.

If we would have a pre-built Storm binary, we could maybe ship it in a pre-built stormpy package.

Exactly, I think that would be great for users.