pvx

Python version & venv management


License
Apache-2.0
Install
pip install pvx==0.0.4

Documentation

🐍 pvx

Python version & venv management (maybe more ...)

ðŸĪŠ What can pvx do ?

pvx-help

ðŸ“Ķ 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.

  1. The folder where the pvx.py file resides is the root.
  2. root/commands is the folder where the .py command scripts are stored.
  3. If filenamed is true, use the file name command, otherwise use the argument to @click.command. - The .py files are named pvx_{group}_{command}.py.For example: pvx_py_install.py, which means we can call it with pvx py install.
  4. .py file must have a method called cli 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