Zipapp doesn't support c extensions though? And that is a large chunk of libraries that I use.
Let's try an example with numpy:
$ py -m venv foo
$ foo\Scripts\activate
$ pip install numpy
$ code hello_numpy.py
# import numpy as np
# def main():
# print(np.arange(15).reshape(3, 5))
$ python hello_numpy.py
[[ 0 1 2 3 4]
[ 5 6 7 8 9]
[10 11 12 13 14]]
Now with shiv: $ copy hello_numpy.py foo\Lib\site-packages
$ shiv -e hello_numpy.main --site-packages test\Lib\site-packages\ -o hello_numpy.pyz
$ python hello_numpy.pyz
[[ 0 1 2 3 4]
[ 5 6 7 8 9]
[10 11 12 13 14]]
So it works fine, but remember:- it will only run on the system this particular numpy wheel has been designed to run on. In my case cp38-win_amd64.
- it will comes bundle with numpy. Numpy is quite big, which means your hello world pyz will be 14.1 Mo.
- it needs to unzip, so the first run will be slow