Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip, wheel and console_scripts

I'm running into the following problem with python whl packages:

I have a package with a single entrypoint defined in my setup.py. When I run pip install ., it installs the package AND the entry point wrapper properly. When I run python setup.py bdist_wheel followed by pip install thing.whl, it only install the package, but not the entrypoint.

How do I install the entrypoint properly from the created wheel package?

PS: When I unzip the wheel package, I do find "entrypoints.txt" with the expected entry. It just doesn't get installed in the environment bin.

like image 854
A.J.Rouvoet Avatar asked Nov 08 '14 03:11

A.J.Rouvoet


1 Answers

Wheels used to include pre-generated console script wrappers in the package, but this was sub-optimal and the files were removed. The installer is supposed to generate these wrapper scripts instead, but pip has not yet been updated to follow suit, see issue 1067.

Until pull request 1251 is part of a release, you'll have to use a separate command to install console scripts:

python -m wheel install-scripts thing.whl

See Setuptools scripts handling in the Wheel documentation.

The pull request was merged earlier this month (November 2014), and will be part of the upcoming 6.0 release. You could also use pip to upgrade itself to the development version from GitHub with:

pip install git+https://github.com/pypa/pip.git
like image 190
Martijn Pieters Avatar answered Sep 18 '22 13:09

Martijn Pieters