There's a 3rd party program (VeraCrypt) that'd I'd like to use in python, so I'm looking at creating a python package around it. I want to make it so if you download the package, it will "just work" and not rely on having veracrypt pre-installed. I can then use python's subprocess to call veracrypts CLI, and have a class that has the different mount/unmount et-all cli commands abstracted away.
The problem is if you look at their downloads page, there's no binaries, just package formats (exe, rpm, deb, etc).
- For Windows, is the right idea to use the
Portable exeversion, and add it directly to setup.py withpackage_data? I'd only want it included for the windows-specific platform wheel though, not linux's. I guess I should have setup.py figure out what platform it's currently building for, and adjust this package_data list accordingly?- Technically portable mode must run as root, but I can use it as a fall-back if it's not installed on the system here.
- For linux, I'm guessing there's no way to use anything pre-built on the downloads page directly (deb, rpm). But that might work out. Is the "best practice" path to compile veracrypt and get the executable, build a wheel, then try to run auditwheel on it to obtain a manylinux wheel? I would only have to build one for "all of linux" then.
And from there, just use importlib.resources to grab whichever binary was included in your specific platform wheel, and save the path to it for subprocess. (Unless maybe I should somehow save the path when I figure out which binary to include in the package_data list?). I have experience with pure-python packages, but this is the first time I've thought about adding a binary to one and still have it be cross-platform.
The reason I don't just use python's cryptography, is veracrypt offers a lot of features other tools don't.
auditwheelwouldn't fix it.