clyngor-with-clingo


Nameclyngor-with-clingo JSON
Version 5.3.post1 PyPI version JSON
download
home_pagehttps://github.com/aluriak/clyngor-with-clingo
SummaryInstallation of clingo binary along clyngor
upload_time2019-05-15 16:36:40
maintainer
docs_urlNone
authorLucas Bourneuf
requires_python
licenseGPL
keywords answer set programming wrapper clingo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Clyngor with clingo
This is a python package installing a clingo binary along the [clyngor package](https://github.com/aluriak/clyngor),
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](https://github.com/potassco/clingo/releases/)

# 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](https://zestreleaser.readthedocs.io) 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](https://stackoverflow.com/questions/24686838/distributing-a-binary-utility-in-setuptools). Thanks !

I end up [reproducing the same entry point implementation, using pkg_resource](clyngor_with_clingo/__init__.py), and it works:
binaries are embedded in the package using the [MANIFEST.in](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](https://github.com/sthiele/pyasp/blob/master/setup.py#L136).

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](https://stackoverflow.com/questions/12461603/setting-up-setup-py-for-packaging-of-a-single-py-file-and-a-single-data-file-wi).


### platform-specific magic
Setuptools provides since [PEP 508](https://www.python.org/dev/peps/pep-0508) the environment markers,
theoretically [usable in setup.cfg](https://stackoverflow.com/questions/44878440/correct-use-of-pep-508-environment-markers-in-setup-cfg)
with [setuptools](https://github.com/pypa/setuptools/pull/1520):

    [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](https://github.com/pypa/setuptools/issues/1728), also [on SO](https://stackoverflow.com/q/56004271/3077939).

Probably it's because data_files does not support environment markers. Hence this solution has been abandonned.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aluriak/clyngor-with-clingo",
    "name": "clyngor-with-clingo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Answer Set Programming,wrapper,clingo",
    "author": "Lucas Bourneuf",
    "author_email": "lucas.bourneuf@laposte.net",
    "download_url": "https://files.pythonhosted.org/packages/c5/7f/33858be8415afdda144479faae76e91e12880bcee5792f383c218ee613a6/clyngor-with-clingo-5.3.post1.tar.gz",
    "platform": "",
    "description": "# Clyngor with clingo\nThis is a python package installing a clingo binary along the [clyngor package](https://github.com/aluriak/clyngor),\nso the end-user will not have to care about the clingo installation.\n\nThe clingo binary is taken for Linux, OSX and Windows on [the official release page](https://github.com/potassco/clingo/releases/)\n\n# Installation\nWhen someone (who doesn't understand \"install clingo binary in your path\") have to install clyngor, give them that line instead:\n\n    pip install clyngor-with-clingo\n\nA clingo executable will appear in their `bin`. May need root access if the said someone is working at system level.\n\n\n## Maintenance\nThe package must be updated to use new clingo binaries.\n\n- Script `retrieve-clingo.sh <clingo version>` will automatically retrieve the given clingo version.\n- Script `put-clingo-version.sh <clingo version>` will automatically push the given clingo version into the package.\n\nUse [zest.releaser](https://zestreleaser.readthedocs.io) to upload new versions ; be careful to **match clingo version with package version**.\n\n\n\n# How to perform this magic\n\n## The current solution: faking clingo as a python script\n[Link to the way of doing that](https://stackoverflow.com/questions/24686838/distributing-a-binary-utility-in-setuptools). Thanks !\n\nI end up [reproducing the same entry point implementation, using pkg_resource](clyngor_with_clingo/__init__.py), and it works:\nbinaries are embedded in the package using the [MANIFEST.in](MANIFEST.in), and the package only real operation\nis to delegate command line arguments to the proper clingo binary.\n\nThis seems to work, but:\n\n- 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\u2026 Experienced users should never use it)\n- the 3 binaries are sent to the user, and the choice is made at execution time.\n\n\n## The on-the-fly solution: hack upon setuptools to download binary at installation\nMethod used by [pyasp](https://github.com/sthiele/pyasp/blob/master/setup.py#L136).\n\nHas 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.\n\n\n## The proper but non-working solution: embed a platform-specific binary into a python package\nThe python part of the package is simplistic (well, there could be **no** python in this package),\nbe [we still need a basic architecture](https://stackoverflow.com/questions/12461603/setting-up-setup-py-for-packaging-of-a-single-py-file-and-a-single-data-file-wi).\n\n\n### platform-specific magic\nSetuptools provides since [PEP 508](https://www.python.org/dev/peps/pep-0508) the environment markers,\ntheoretically [usable in setup.cfg](https://stackoverflow.com/questions/44878440/correct-use-of-pep-508-environment-markers-in-setup-cfg)\nwith [setuptools](https://github.com/pypa/setuptools/pull/1520):\n\n    [options.data_files]\n    bin/clingo =\n        bin/linux/clingo; platform_system==\"Linux\"\n        bin/macos/clingo; platform_system==\"Darwin\"\n        bin/win/clingo.exe; platform_system==\"Windows\"\n\nBut it does not works. [A question has been asked about it](https://github.com/pypa/setuptools/issues/1728), also [on SO](https://stackoverflow.com/q/56004271/3077939).\n\nProbably it's because data_files does not support environment markers. Hence this solution has been abandonned.",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Installation of clingo binary along clyngor",
    "version": "5.3.post1",
    "split_keywords": [
        "answer set programming",
        "wrapper",
        "clingo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c57f33858be8415afdda144479faae76e91e12880bcee5792f383c218ee613a6",
                "md5": "a6750e911d3fd0d14fcc3aef43f6dc5a",
                "sha256": "cb5eace851fdf65e57369b28c44853436a424aa928615f0d2c1d46ca69dcfdf4"
            },
            "downloads": -1,
            "filename": "clyngor-with-clingo-5.3.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "a6750e911d3fd0d14fcc3aef43f6dc5a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5779814,
            "upload_time": "2019-05-15T16:36:40",
            "upload_time_iso_8601": "2019-05-15T16:36:40.858064Z",
            "url": "https://files.pythonhosted.org/packages/c5/7f/33858be8415afdda144479faae76e91e12880bcee5792f383c218ee613a6/clyngor-with-clingo-5.3.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-05-15 16:36:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "aluriak",
    "github_project": "clyngor-with-clingo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "clyngor-with-clingo"
}
        
Elapsed time: 0.10869s