Skip to main content

No project description provided

Project description

Pre-pip

pre-pip is a tool that allows you to run something before a pip command is executed.

Suggested use cases:

  • Before installing a package, check it against a list of known malicious packages.
  • Upgrade pip automatically before installing a package.

You can use it to run any custom python code before a pip command is executed.

Supported terminals

Currently only zsh is supported.

Contributions for 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 demo_hook.py in your current directory with the following content:

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 register ./demo_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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre_pip-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

pre_pip-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pre_pip-0.1.0.tar.gz.

File metadata

  • Download URL: pre_pip-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pre_pip-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e909e1f67f454c4442f14084029469a315920ac315b01fbb61ec5aeddaa799fb
MD5 8f949fb87ccee59929c5a43a2762feaa
BLAKE2b-256 b758d0393bc5700ba88cddd4dd3ffd0bf3bea807bc75c88b9124cd39b65bcfda

See more details on using hashes here.

File details

Details for the file pre_pip-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pre_pip-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pre_pip-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ffcd928648d1f8f21dd67e4808b4c018b2209789664b1dd0b10693acae873b7
MD5 078eb485b078e22a47548e399f8ae47d
BLAKE2b-256 d7ea6954d18c48a6347d587e9c3ab71e800b7110a8a1b9fa6dbf3579719b46ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page