Run some python code just before your pip commands.
Use cases
- Before installing a package, check it against a list of known malicious packages.
- Upgrade pip automatically before installing a package.
- Inject pip proxy settings into the environment before installing a package.
You can use it to run any custom python code before a pip command is executed.
Supported shells
The following shells are currently supported:
zshbash
I'm currently working on adding support for powershell and will thereafter look at fish.
Contributions for any other shells are welcome.
Installation
pip install pre-pip
There is potential to make this pipx installable.
Usage
Install pre-pip into your .*rc file using:
pre-pip install
Register a custom demo hook
Create a new file called hook.py in your current directory with the following content:
# hook.py
from rich import print as rprint
def main(args):
rprint(
f"This [italic green]pre-pip[/italic green] hook received: [italic cyan]{args}[/italic cyan]",
)
Register the hook using:
pre-pip add hook.py
You can view the list of registered hooks using:
pre-pip list
Uninstall
Uninstall pre-pip using:
pre-pip uninstall
This will remove the pre-pip hook from your .*rc file as well as all registered hooks.
To remove the pre-pip package, use:
pip uninstall pre-pip
License
Metadata
Release files for pre-pip 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pre_pip-0.1.3.tar.gz | 5.7 kB | Without provenance | Details for pre_pip-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pre_pip-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for pre_pip-0.1.3-py3-none-any.whl |
Total release size: 12.8 kB
Release files / pre_pip-0.1.3.tar.gz
| Download URL | pre_pip-0.1.3.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbf446b535401622d6338acd69a237a608f27c02d74c16ad50a2416605bcf97b
|
|
BLAKE2b-256 checksum How to use checksums |
ecd7cc698967f57f0b17c9f9b9e694f1837193397de6d1a16248eaa93f5ffe2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / pre_pip-0.1.3-py3-none-any.whl
| Download URL | pre_pip-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1aa4430e14084338fc28b3bf368d3efd403073e318fa570cac34e8ae1e11fc3
|
|
BLAKE2b-256 checksum How to use checksums |
0f03eec098e25c5e902850834b6c334629c978c718585193452a089be0901bbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Security for pre-pip 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.