Name | venvx JSON |
Version |
0.4.0
JSON |
| download |
home_page | None |
Summary | Easy-to-use virtual environment manager for bash and zsh |
upload_time | 2023-11-20 19:00:39 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10,<4 |
license | None |
keywords |
venv
virtual environments
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# venvx
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/venvx/0.3.0)](https://pypi.org/project/venvx/)
[![PyPI version](https://badge.fury.io/py/venvx.svg)](https://badge.fury.io/py/venvx)
Create and use virtual environments with ease
## Installation
Install the venvx package with pip
```sh
python -m pip install --user venvx
```
or your favorite Python package manager. To install the `venv` shell extension, enter
```sh
venvx shellext > ~/.venvx.sh
```
Review the content of the file and source it into your bash or zsh profile.
## Usage
Assuming the current directory contains two virtual enviroments called .venv3.10 and .venv3.11:
```sh
% ls -a
./ ../ .venv3.10/ .venv3.11/
```
The command `venv use` activates, and switches between, virtual environments.
```sh
% venv use .venv3.10
(.venv3.10) % which pip
/path/to/.venv3.10/bin/pip
```
If the venv name begins with .venv, it suffices to specify the remainder of the name. For instance, in order to switch to another virtual enviroment:
```sh
(.venv3.10) % venv use 3.11
(.venv3.11) % which pip
/path/to/.venv3.11/bin/pip
```
To quickly run a command in a virtual environment, use the run command.
```sh
(.venv3.11) % venv run 3.10 which python
/path/to/.venv3.10/bin/python
(.venv3.11) %
```
Since venv always activates the virtual environment internally, venv commands may be run within another virtual environment as shown above, or outside:
```sh
(.venv3.11) % venv off
% venv run 3.10 pytest -v tests
%
```
New virtual environments can be created with `venv create`. If the name of the virtual environment is omitted, ".venv" will be used:
```sh
% venv create
```
or use a different name e.g.
```sh
% venv create pyenv
```
The Python version to use within the new virtual environment may be specified with the -v (a.k.a. --versions) option.
```sh
% mkdir newdir && cd newdir
% venv create -v 3.8 3.9
% venv create pyenv -v 3.8 3.9
% ls -a
./ ../ .venv3.8/ .venv3.9/ pyenv3.8/ pyenv3.9/
```
The new virtual environments have already been upgraded to the most recent version of the `pip` package. The command
```sh
% venv upgrade-pip existing_env
```
upgrades the pip module of an existing virtual environment. Obviously, this works in an activated virtual enviroment as well.
```sh
% venv use 3.9
(.venv3.9) % venv upgrade-pip
```
In Git Bash on Windows, the Scripts/activate script defines a VIRTUAL_ENV path that contains both "/" and "\\" path separators. `venv fix [path]` corrects that.
When a virtual environment is copied to a different location, the activate script's VIRTUAL_ENV setting, as well as the shebangs in the various scripts within the venv's bin/ folder, all still refer to the original virtual environment. `venv fix [path]` performs the necessary updates. Example (Darwin or Linux):
```sh
% mv .venv3.9 .venv39
% venv fix 39
Checking if any scripts require patches - yes (6)
Fixing the shebang in pip3 - done
Fixing the shebang in pip - done
Fixing the shebang in pip3.9 - done
Fixing the VIRTUAL_ENV setting in activate.fish - done
Fixing the VIRTUAL_ENV setting in activate - done
Fixing the VIRTUAL_ENV setting in activate.csh - done
```
Enter `venv help` and `venvx -h` for more information on usage.
Raw data
{
"_id": null,
"home_page": null,
"name": "venvx",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10,<4",
"maintainer_email": null,
"keywords": "venv,virtual environments",
"author": null,
"author_email": "Ralf Luetkemeier <foss@rlue.de>",
"download_url": "https://files.pythonhosted.org/packages/15/e2/77aee7f3dde694eae0521d479f28468fc890d52fd19f23a0851f5159dc51/venvx-0.4.0.tar.gz",
"platform": null,
"description": "# venvx\n\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/venvx/0.3.0)](https://pypi.org/project/venvx/)\n[![PyPI version](https://badge.fury.io/py/venvx.svg)](https://badge.fury.io/py/venvx)\n\nCreate and use virtual environments with ease\n\n## Installation\n\nInstall the venvx package with pip\n\n```sh\npython -m pip install --user venvx\n```\n\nor your favorite Python package manager. To install the `venv` shell extension, enter\n\n```sh\nvenvx shellext > ~/.venvx.sh\n```\n\nReview the content of the file and source it into your bash or zsh profile.\n\n## Usage\n\nAssuming the current directory contains two virtual enviroments called .venv3.10 and .venv3.11:\n\n```sh\n% ls -a\n./ ../ .venv3.10/ .venv3.11/\n```\n\nThe command `venv use` activates, and switches between, virtual environments.\n\n```sh\n% venv use .venv3.10\n(.venv3.10) % which pip\n/path/to/.venv3.10/bin/pip\n```\n\nIf the venv name begins with .venv, it suffices to specify the remainder of the name. For instance, in order to switch to another virtual enviroment:\n\n```sh\n(.venv3.10) % venv use 3.11\n(.venv3.11) % which pip\n/path/to/.venv3.11/bin/pip\n```\n\nTo quickly run a command in a virtual environment, use the run command.\n\n```sh\n(.venv3.11) % venv run 3.10 which python\n/path/to/.venv3.10/bin/python\n(.venv3.11) %\n```\n\nSince venv always activates the virtual environment internally, venv commands may be run within another virtual environment as shown above, or outside:\n\n```sh\n(.venv3.11) % venv off\n% venv run 3.10 pytest -v tests\n%\n```\n\nNew virtual environments can be created with `venv create`. If the name of the virtual environment is omitted, \".venv\" will be used:\n\n```sh\n% venv create\n```\n\nor use a different name e.g.\n\n```sh\n% venv create pyenv\n```\n\nThe Python version to use within the new virtual environment may be specified with the -v (a.k.a. --versions) option.\n\n```sh\n% mkdir newdir && cd newdir\n% venv create -v 3.8 3.9\n% venv create pyenv -v 3.8 3.9\n% ls -a\n./ ../ .venv3.8/ .venv3.9/ pyenv3.8/ pyenv3.9/\n```\n\nThe new virtual environments have already been upgraded to the most recent version of the `pip` package. The command\n\n```sh\n% venv upgrade-pip existing_env\n```\nupgrades the pip module of an existing virtual environment. Obviously, this works in an activated virtual enviroment as well.\n\n```sh\n% venv use 3.9\n(.venv3.9) % venv upgrade-pip\n```\n\nIn Git Bash on Windows, the Scripts/activate script defines a VIRTUAL_ENV path that contains both \"/\" and \"\\\\\" path separators. `venv fix [path]` corrects that.\n\nWhen a virtual environment is copied to a different location, the activate script's VIRTUAL_ENV setting, as well as the shebangs in the various scripts within the venv's bin/ folder, all still refer to the original virtual environment. `venv fix [path]` performs the necessary updates. Example (Darwin or Linux):\n\n```sh\n% mv .venv3.9 .venv39\n% venv fix 39\nChecking if any scripts require patches - yes (6)\nFixing the shebang in pip3 - done\nFixing the shebang in pip - done\nFixing the shebang in pip3.9 - done\nFixing the VIRTUAL_ENV setting in activate.fish - done\nFixing the VIRTUAL_ENV setting in activate - done\nFixing the VIRTUAL_ENV setting in activate.csh - done\n```\n\nEnter `venv help` and `venvx -h` for more information on usage.\n",
"bugtrack_url": null,
"license": null,
"summary": "Easy-to-use virtual environment manager for bash and zsh",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [
"venv",
"virtual environments"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "16c3c5a8bf002d6ce17cd1240e040adb4a0199655297a864ce92024394b8df70",
"md5": "c692d0337fbfa926becc2448478c01e7",
"sha256": "6d2a22397a12dcc1138b3be5f5391458749e08c8cf13e482eb324e67939aed64"
},
"downloads": -1,
"filename": "venvx-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c692d0337fbfa926becc2448478c01e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4",
"size": 19082,
"upload_time": "2023-11-20T19:00:37",
"upload_time_iso_8601": "2023-11-20T19:00:37.733107Z",
"url": "https://files.pythonhosted.org/packages/16/c3/c5a8bf002d6ce17cd1240e040adb4a0199655297a864ce92024394b8df70/venvx-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "15e277aee7f3dde694eae0521d479f28468fc890d52fd19f23a0851f5159dc51",
"md5": "c806cbf84df995733ace6cadf446f6a0",
"sha256": "f79184fe7ea2c94228bf19123639ebd050d370dacc50673fa82c4770934348cb"
},
"downloads": -1,
"filename": "venvx-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "c806cbf84df995733ace6cadf446f6a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4",
"size": 26554,
"upload_time": "2023-11-20T19:00:39",
"upload_time_iso_8601": "2023-11-20T19:00:39.762272Z",
"url": "https://files.pythonhosted.org/packages/15/e2/77aee7f3dde694eae0521d479f28468fc890d52fd19f23a0851f5159dc51/venvx-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-20 19:00:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "venvx"
}