Skip to main content

Clyngor with clingo

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

Installation

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.

Maintenance

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.

How to perform this magic

The current solution: faking clingo as a python script

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.

The on-the-fly solution: hack upon setuptools to download binary at installation

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 proper but non-working solution: embed a platform-specific binary into a python package

The python part of the package is simplistic (well, there could be no python in this package), be we still need a basic architecture.

platform-specific magic

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clyngor_with_clingo-5.4.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clyngor_with_clingo-5.4.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file clyngor_with_clingo-5.4.0.tar.gz.

File metadata

  • Download URL: clyngor_with_clingo-5.4.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for clyngor_with_clingo-5.4.0.tar.gz
Algorithm Hash digest
SHA256 ffd04fb0f7d0384b9b90dde8d3516f9e6f23d045b9e9d9dd39cce112a1558ee8
MD5 0938502308cd1539dcda72d3c53120fd
BLAKE2b-256 f4766ab5e76ef9ddd52839785b67a833a116c7d91dcfa69a67639db6c71752c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for clyngor_with_clingo-5.4.0.tar.gz:

Publisher: python-publish.yml on Aluriak/clyngor-with-clingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clyngor_with_clingo-5.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for clyngor_with_clingo-5.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4706e1b69e09dad5f54aabc59957d95ef8d8f5c9e18be8560ff052cbb622da9f
MD5 c00a441cd45ab5a9f03b7cc8b355e7ad
BLAKE2b-256 c39f075cb5133e95dc892133d3fc134226d83841ba0dc440cc2eb2aa396f22cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for clyngor_with_clingo-5.4.0-py3-none-any.whl:

Publisher: python-publish.yml on Aluriak/clyngor-with-clingo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page