pipenv
pipenv copied to clipboard
Add support for script hooks
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
I am strongly -1 to this. npm’s magic script names are asking for trouble, and completely against Python’s preference to readability and obviousness. I am indifferent toward hooks as an idea (although I suspect Kenneth would object), but npm’s 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.
In my case, I need to update setup.py after each install and I prefer set a post-install script in order to execute
pipenv-setup sync
instead to put this in the doc of the project.
Use case...
After loading Playwright, you must do:
playwright install
Reference: https://playwright.dev/python/docs/intro
Use case, pre-commit.
After installing the environment, pre-commit install must be executed or else the git hook is not installed.
If a project member doesn't run that command post clone/install, commits will bypass that (admittedly thin) layer of code quality assurance. Even if it's redundant, since the same quality is setup on the CI environment, it's a good practice for team members and to prevent some wasted time waiting for CI to run on every broken PR.
Reference: https://pre-commit.com/#3-install-the-git-hook-scripts
need this to install git hooks for enforcing semver
Any temporary solution for this?
Use Case: after installing aws-glue-sessions (docs) jupyter kernel in a virtual environment, you need to run the following commands to install the kernel:
SITE_PACKAGES=$(pip3 show aws-glue-sessions | grep Location | awk '{print $2}')
python3 -m jupyter kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_pyspark --sys-prefix
python3 -m jupyter kernelspec install $SITE_PACKAGES/aws_glue_interactive_sessions_kernel/glue_spark --sys-prefix