PvP - The Ultimate Python Virtualenv and Package Manager
Python package manager to end all Python package managers
Python virtualenv and Pip (PvP) manager is a modern, standards-compliant, fast, beautiful package manager created with love.
Also, it's a very small shell script.
What's not to like?
Get it directly from the source:
git clone [email protected]:senko/pvp.git cd pvp/
Copy the script somewhere in your
If you're on a modern Linux distribution:
cp pvp ~/.local/bin chmod a+rx ~/.local/bin/pvp
or to install for all users (should work on both Linux and MacOS):
sudo cp pvp /usr/local/bin/ sudo chmod a+rx /usr/local/bin/pvp
Add the contents of
pvp-bashrc to your shell startup script (most likely
~/.bashrc unless you're one of the cool kids and use Zsh, in which case it's probably
Re-enter the shell or source your shell startup script and you're ready to go!
Initialize a Python virtual environment in the current directory:
pvp add pkgname otherpkgname
pvp rm pkgname
See the list of installed packages:
Activate a Python virtual environment that's been initialized in the current directory or any of its ancestors:
Deactivate a Python virtual environment, if it's activated:
Run Python within virtual environment without activating it for the current shell:
pvp run manage.py runserver
How it works
Oh, how it actually works?
It uses the awesome
venv modules from Python 3 standard library and a little bit of shell scripting to make using them easier.
PvP will figure out the virtual environment you're in based on your current directory. It searches for
.venv sub-directory in the current directory, then the parent directory, then its parent, all up to
.venv directory that is found will be used. If none are found, PvP assumes it's not running in a project that has a virtual environment set up.
This is similar what
npm does when searching for
Curious minds are invited to check the source. It's a pretty short read.
If you've found a bug, problem, security issue, have an idea, suggestion, comment, or just want to rewrite it in Rust for speed and memory safety, I've just got two rules:
- Bug reports and patches are more than welcome
- I don't guarantee I'll fix anything or merge any patches you send
But it doesn't do X!
It's really a rite-of-passage for every serious Python developer, you know.
MIT. Gee, I do hope Amazon doesn't fork this and make an AWS product out of it.
Is this a joke?
Obviously. I use it every day.