ð pvx
Python version & venv management (maybe more ...)
ðĪŠ What can pvx do ?
ðĶ Install
-
Use pipx (recommend)
pipx install pvx
-
Use pip
pip install pvx
ð§ Usage
-
List version number that you can download.
pvx py archive # If you want to filter it, do this pvx py archive 3.10
-
Install.
pvx py insetall 3.10.4
-
List versions of installed.
pvx py list
-
Remove the specified version of Python.
pvx py remove 3.10.4
-
Create a virtual environment (pvx use Python Venv)
# All default (current python and default venv prompt) pvx venv new # Specify the version (which install by pvx) pvx venv new 3.10.4 # Use existing Python pvx venv new ~/.pyenv/versions/3.10.4/bin/python # Use venv's parameters, such as specifying prompt pvx venv new 3.10.4 --prompt venv_prompt_name # Use current python and venv's parameters pvx venv new --prompt venv_prompt_name
-
List all virtual environments
# You'll see a table , highlight the activate one. pvx venv list
-
Activate virtual environment with
PROMPT
# use `pvx venv list` to show prompt pvx venv activate prompt_name
-
Remove virtual environment with
PROMPT
# use `pvx venv list` to show prompt pvx venv remove prompt_name
ð Extend functionality
If you want to extend commands, be familiar with the following points.
- The folder where the
pvx.py
file resides is theroot
. -
root/commands
is the folder where the.py
command scripts are stored. - If
filenamed
is true, use the file name command, otherwise use the argument to@click.command
. - The.py
files are namedpvx_{group}_{command}.py
.For example:pvx_py_install.py
, which means we can call it withpvx py install
. -
.py
file must have a method calledcli
and decorated with@click.command
.
ðŧ Thanks
- python-build (pyenv's plugin), which pvx depend to install different versions of Python
- rich, a Python library for rich text and beautiful formatting in the terminal.
- click, a python composable command line interface toolkit