Large app size for Python apps

Hi,

I wonder if anyone has any suggestions for keeping app size low with the new Python App SDK. As I’m migrating the Apple TV & HomePod app to Python, I notice that the app currently sits at 36MB zipped in Developer Tools, which is a lot. Unzipped it takes about 60MB in total.

The problem in my case is that PyATV has a lot of required dependencies, of which some are rather large, but it needs all of it. It’s so bad that sometimes even homey app run crashes my development Homey and it has to reboot. I noticed that the python_packages directory has two architectures and I wonder if we need both or that maybe we could do another kind of optimization here by distrubuting two versions, one per architecture?

Dependencies can take up lots of space (also on JS). Maybe you can try to reduce the dependencies by removing features from those dependencies that aren’t needed for your use case?

1 Like

Yeah, that’s a bit of a problem in this case :slight_smile: I can safely remove one or two dependencies, that are optional, but those are too small to make any difference. There is one large dependency that I cannot remove, because all the cryptography used for connecting to the devices is there. It takes up about half of the entire app :sweat_smile:

I thought about forking PyATV, but due to that one large dep, it’s not really an option.