|
4 | 4 |
|
5 | 5 | ## Overview |
6 | 6 | `venv-cli` is a CLI tool to help create and manage virtual python environments. |
7 | | -It uses `pip` and `python -m venv` underneath, and so only requires core python. This alleviates the bootstrapping problem of needing to install a python package using your system python and pip before you are able to create virtual environments. |
| 7 | +It uses `pip` and `python -m venv` underneath, and so only requires core python. This alleviates the bootstrapping problem of needing to install a python package using your system `python` and `pip` before you are able to create virtual environments. |
8 | 8 |
|
9 | | -You also don't need `conda`, `pyenv`, `pythonz` etc. to manage your python versions. Just make sure the correct version of python is installed on your system, then reference that specific version when creating the virtual environment, and everything just works. No shims, no path hacks, just the _official_ `python` build. |
| 9 | +You also don't need `conda`, `pyenv`, `pythonz` etc. to manage your python versions. Just make sure the correct version of python is installed on your system, then reference that specific version when creating the virtual environment, and everything just works. No shims, no path hacks, just the official `python` build. |
10 | 10 |
|
11 | 11 | ## Installation |
12 | 12 |
|
13 | | -Clone this repository, then add a line to your `~/.bashrc` (or `~/.zshrc`, etc) that sources the `src/venv-cli/venv.sh` file: |
14 | | - |
15 | | -```bash |
16 | | -if [ -f ~/venv-cli/src/venv-cli/venv.sh ]; then |
17 | | - . ~/venv-cli/src/venv-cli/venv.sh |
18 | | -fi |
| 13 | +Clone this repository, then run the `install.sh` script from your favourite shell: |
| 14 | +```console |
| 15 | +$ bash install.sh |
19 | 16 | ``` |
| 17 | +This will install the `venv` source file, along with an uninstall script, in `/usr/local/share/venv/`, and add a line in the appropriate shell `rc`-file (e.g. `~/.bashrc`) sourcing the `venv` source script. |
20 | 18 |
|
21 | 19 | This makes the `venv` command avaiable in your terminal. To check if it works, restart the terminal and run |
22 | 20 | ```console |
23 | 21 | $ venv --version |
24 | 22 | venv-cli 1.0.0 |
25 | 23 | ``` |
26 | 24 |
|
| 25 | +The install script also adds command completions for the invoked shell. |
| 26 | + |
| 27 | +# Uninstall |
| 28 | +To uninstall `venv` and remove all files, run the uninstall script at `/usr/local/share/venv/`: |
| 29 | +```console |
| 30 | +$ bash /usr/local/share/venv/uninstall.sh |
| 31 | +``` |
| 32 | +The script should be run by the user that ran the install script to correctly remove the sourcing lines from the `rc`-file of that user. However, since it also cleans up the files in `/usr/share/local/venv/`, it will ask for `sudo` access. |
| 33 | + |
27 | 34 | ## Usage |
28 | 35 |
|
29 | 36 | To see the help menu, along with a list of available commands, run `venv -h/--help`. |
@@ -100,7 +107,7 @@ are equivalent. |
100 | 107 |
|
101 | 108 | The installed packages are then _locked_ into the corresponding `.lock`-file, e.g. running `venv install dev-requirements.txt` will lock those installed packages into `dev-requirements.lock`. |
102 | 109 |
|
103 | | -Installing packages this way makes sure that they are "tracked", since installing them with `pip install` will keep no record of which packages have been installed in the environment, making it difficult to reproduce later on. |
| 110 | +Installing packages this way makes sure that they are tracked, since installing them with `pip install` will keep no record of which packages have been installed in the environment, making it difficult to reproduce later on. |
104 | 111 |
|
105 | 112 | ### Development packages |
106 | 113 | If you have both production and development package requirements, keep them in separate requirements-files, e.g. `requirements.txt` for production and `dev-requirements.txt` for development. An example of these could be: |
|
0 commit comments