Use pip to install non-python?

Jon Ribbens jon+usenet at unequivocal.eu
Thu Aug 4 10:13:03 EDT 2016


On 2016-08-04, Tennis Smith <tennis at nextgxdx.com> wrote:
> I have several utility scripts I want to install in /usr/local/bin.
> Some are python, some are simple bash scripts.  Can I use pip to
> install them?  If so, can anyone point me to some examples? 

By the looks of it*, you should be able to do this:

    setup(
        ....
        scripts=[
            "scripts/bash1",
            "scripts/bash2",
            "scripts/bash3",
        ],
        console_scripts=[
            "foo=package.module:func1",
            "bar=package.module.func2",
            "baz=package.module.func3",
        ],
    )

The first list is the list of bash scripts, which will just be copied
into the right place, and the second list is the Python functions you
want calling, and pip will automagically generate the appropriate
script to call your code when the command is executed.

* Barely documented at https://packaging.python.org/distributing/#scripts



More information about the Python-list mailing list