This is a python package installing a clingo binary along the clyngor package, so the end-user will not have to care about the clingo installation.
The clingo binary is taken for Linux, OSX and Windows on the official release page
When someone (who doesn't understand "install clingo binary in your path") have to install clyngor, give them that line instead:
pip install clyngor-with-clingo
A clingo executable will appear in their bin
. May need root access if the said someone is working at system level.
The package must be updated to use new clingo binaries.
- Script
retrieve-clingo.sh <clingo version>
will automatically retrieve the given clingo version. - Script
put-clingo-version.sh <clingo version>
will automatically push the given clingo version into the package.
Use zest.releaser to upload new versions ; be careful to match clingo version with package version.
Link to the way of doing that. Thanks !
I end up reproducing the same entry point implementation, using pkg_resource, and it works: binaries are embedded in the package using the MANIFEST.in, and the package only real operation is to delegate command line arguments to the proper clingo binary.
This seems to work, but:
- user has not control over the installed binary (however that package is all about having the user to not have to cope with that, but still… Experienced users should never use it)
- the 3 binaries are sent to the user, and the choice is made at execution time.
Method used by pyasp.
Has a lot of drawbacks, such as binary downloading from the client side, and necessity to use --no-cache-dir
pip flag to force pip to execute the hack.
The python part of the package is simplistic (well, there could be no python in this package), be we still need a basic architecture.
Setuptools provides since PEP 508 the environment markers, theoretically usable in setup.cfg with setuptools:
[options.data_files]
bin/clingo =
bin/linux/clingo; platform_system=="Linux"
bin/macos/clingo; platform_system=="Darwin"
bin/win/clingo.exe; platform_system=="Windows"
But it does not works. A question has been asked about it, also on SO.
Probably it's because data_files does not support environment markers. Hence this solution has been abandoned.