Skip to main content

a lightweight python venv wrapper to manage venvs

Project description

pvw

A lightweight python venv wrapper for virtual environment management.

Based on the built-in venv since python 3.6.

Pre-requirement

  • Python >= 3.6
  • python-venv

Installation

pip install pvw

Usage

pvw [-h] {ls,config,activate,create,rm,mv,cp}

Manage python venv environments

positional arguments:
  {ls,config,activate,create,rm,mv,cp}
    ls                  List all venvs.
    config              Get or set pvw config.
    activate            Activate venv.
    create              Create a new venv.
    rm                  Remove a venv.
    mv                  Move(rename) venv to another place.
    cp                  Copy venv.

You will be asked to set a venv_path to store venvs at the first time you use pvw.

List venvs

pvw ls [--show-size]

List all created venvs, including name, path and size. Note that size will only be displayed when the --show-size modifier is used, which would take a few seconds.

Name   Path                  Size
--------------------------------------
env1   C:\Users\venvs\env1   199.42MB
env2   C:\Users\venvs\env2   21.83MB
st     C:\Users\venvs\st     313.99MB
v2     C:\Users\venvs\v2     21.86MB
v3     C:\Users\venvs\v3     21.85MB

Get or set configs

Get or set the directory venv_path where venvs are stored.

pvw config get venv_path # get venv_path variable
pvw config set venv_path=PATH/TO/VENV # set venv_path

Create venv

pvw create ENV_NAME

Activate venv

For Windows, activate an existing venv with:

pvw activate ENV_NAME

For Linux/Mac, activate venv with source command:

source pvw activate 

or simply use a shorter command

source pvw ENV_NAME

if your environment name is not conflict with our keywords.

To deactivate current venv, just type deactivate inside environment. E.g. in Windows

(ENV_NAME) PS D:\Users> deactivate

Use python, pip or any other commands inside environment as usual as in venv.

Remove venv

pvw rm env_name

You may be asked to confirm the venv to be removed.

Move or rename venv

Move env1 to a venv env2, the original venv would disappear.

pvw mv env1 env2

You may be asked to confirm the venv to be moved.

Copy venv

Copy env1 to a new venv env2

pvw cp env1 env2

Build From Source

Using Makefile

cd src/pvw
make
sudo make install

The executable binary pvw and pvw_py will be installed in your /usr/bin/ directory.

Note that pyinstaller and termcolor will also be installed.

Using setuptools

pip install --upgrade build setuptools # skip if already installed
python -m build
pip install dist/pvw-x.x.x.tar.gz # x.x.x is the built version of pvw

Architecture

To Be Continued...

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

pvw-0.0.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

pvw-0.0.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pvw-0.0.2.tar.gz.

File metadata

  • Download URL: pvw-0.0.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pvw-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c561d6d79b12ffc5d432defabc5df6b9ee9970e263fb69c82a59b8f2e975c5eb
MD5 578a53a950bd7d4b788c99c5f6d8901d
BLAKE2b-256 6ff0d01c61160d02325d55addf59d8f8200bfc0fbe0ec60f7606fc4358248305

See more details on using hashes here.

File details

Details for the file pvw-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pvw-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pvw-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d42561cb6ca33d17dd88f222dd9ce8c9eb1d49e1a422bc6be4dc1f34303df2
MD5 939fb1a4b2b0b479d16159177035ca1b
BLAKE2b-256 5976a81757a4aa975c5c8cb822ca47e197a3f636da9c3d3fff0b676b52f94332

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