0

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 exe version, and add it directly to setup.py with package_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?
  • 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.

2
  • 1
    "compile veracrypt and get the executable, build a wheel, then try to run auditwheel on it to obtain a manylinux wheel?" I don't think this could work. VeraCrypt is not a Python packages, it cannot be built as a wheel, so auditwheel wouldn't fix it. Commented Sep 19, 2024 at 6:58
  • Good point. I wonder if I can compile it to a AppImage or FlatPak instead and just use that. Only maintaining one "manylinux" would be huge. Commented Sep 19, 2024 at 19:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.