Skip to main content

a lightweight python venv wrapper to manage venvs

Project description

pvw

A lightweight (~10kB) python venv wrapper for virtual environment management.

Create venv or standard project in simple command line tool.

Based on the built-in venv since python 3.6.

Pre-requirement

  • Python >= 3.6
  • python-venv

Installation

pip install pvw

Usage

You can either start a raw project with pvw init, or just manage virtual envs with core commands .

Start a project

pvw init PROJ_NAME

Initialize a python project, with a simple template as:

|- pyproject.toml
|- src
    |- PROJ_NAME
          |- cli.py
|- README.md
|- License

You can decide whether creating a specific env for this project.

Configuration

Get or set the directory venv_path where venvs are stored in default.

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

Core commands

We use base as a demo

Show

# show name, path, and size(optional) of existing venvs.
> pvw ls [--show-size]

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

Create

# Create venv `base` in either way:
pvw create base  # in default venv path
pvw create ./base  # in current directory
pvw create /home/venvs/base  # in specific directory

Activate/deactivate

# For Windows
pvw activate base  # standard way
pvw base  # or a shorter way

deactivate  # exit
# For Linux/MacOS
source pvw activate base  # standard way
source pvw base  # or a shorter way

deactivate # exit

Copy or move

# copy or rename from a existing venv
pvw cp base dev  # copy `base` to a new venv `dev`
pvw mv dev foo  # rename `dev` to a new venv `foo`

Remove

# remove both `dev` and `foo`
pvw rm dev foo
# remove envs that starts with `test`
pvw rm test.*

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.

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

To-do list

  • Simplify activate command in Linux/Mac OS
  • Enable setting default venv in terminal
  • Add unit tests
  • Support specific python version (if installed)

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.7.tar.gz (11.9 kB view details)

Uploaded Source

Built Distributions

pvw-0.0.7-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

pvw-0.0.7-1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pvw-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a336344486a13b5b680b071eacd28d4daf2084ee714e8b69c7dfc113020bae21
MD5 577907c60c26279d9b12709c433740ab
BLAKE2b-256 d1de2a6b20885d427e5bb58f753dacd40507aa0898e8a9e97fdf0e8720c07275

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pvw-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f8a7455412010fd77960f1cb87dce598cae247d1b249fe6f6d7209d6bd9edc39
MD5 6599a49814d220f4e39aa666c0ba16f1
BLAKE2b-256 94816711baf5d78034d62c03e1821bee4f6ddcd61c6443f534a8f232a251fc3a

See more details on using hashes here.

File details

Details for the file pvw-0.0.7-1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pvw-0.0.7-1-py3-none-any.whl
Algorithm Hash digest
SHA256 69a1ed8c2db151ebd3606bd156d5bfdf695e61d01821d2d8660e4d40873344ee
MD5 f1ba823b0f5ed9c77f0ceffca19da3d1
BLAKE2b-256 0d309263c427aa1373cee830e24777dd67186a71a78b8ff1a44ed8320a6046fe

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