'How to package a python project that depends on an external executable?

I'm writing python bindings for an executable written in haskell. How should I handle the dependency on the executable regarding packaging and distribution ?

I could just write the python packages that calls the external command as a supbrocess and crash if it's not found at runtime, but is there a solution that either:

  • check during package installation that the executable is available on the host,
  • triggers the installation of the executable if it is not found

I couldn't find any in the python packaging documentations.

Should this be handled one level up, for example at the os distribution level (apt, nix, docker,…) ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source