Pipenv: Add support for script hooks

Created on 3 Sep 2018  路  4Comments  路  Source: pypa/pipenv

npm and yarn execute scripts with special names like postinstall and so on after/before several actions. Pipenv should do the same.

Is your feature request related to a problem? Please describe.

Our django project has some dependencies, that have to be installed using yarn.

Describe the solution you'd like

It was nice, if pipenv installs those dependcies automatically by executing a postinstall script, that calls yarn install.

Describe alternatives you've considered

Otherwise I have to run pipenv install and yarn install.


$ pipenv --support
Error: no such option: --support
$ pipenv --version
pipenv, version 11.10.4
Requires PEEP

Most helpful comment

I kind of feel that this kind of (install) hooks should be standardised in package metadata. Maybe it would be a good idea to raise this to pip, or distutils-sig for more general consideration.

All 4 comments

I am strongly -1 to this. npm鈥檚 magic script names are asking for trouble, and completely against Python鈥檚 preference to readability and obviousness. I am indifferent toward hooks as an idea (although I suspect Kenneth would object), but npm鈥檚 approach is not a good fit.

In any case, however, consider submitting a PEEP to describe your suggestion, and it will be discussed accordingly :)

(sorry, clicked the wrong button)

Just another use case is enabling jupyter extensions after installing. For example, to install qgrid:

pip install qgrid
jupyter nbextension enable --py --sys-prefix qgrid

# only required if you have not enabled the ipywidgets nbextension yet
jupyter nbextension enable --py --sys-prefix widgetsnbextension

I kind of feel that this kind of (install) hooks should be standardised in package metadata. Maybe it would be a good idea to raise this to pip, or distutils-sig for more general consideration.

Was this page helpful?
0 / 5 - 0 ratings