ReadMe.org 2.17 KB
Newer Older
Sachin Patil's avatar
Sachin Patil committed
1
* [[./img/logo.png]]
psachin's avatar
psachin committed
2
  /A Lightweight Python virtual environment manager/
Sachin Patil's avatar
Sachin Patil committed
3

Sachin Patil's avatar
Sachin Patil committed
4 5 6
  For more than a year *setV* was lying under [[https://github.com/psachin/bash_scripts][bash_scripts]]. I use it
  as an alternative to [[https://virtualenvwrapper.readthedocs.org/][virtualenvwrapper]]. It is a Bash function which
  provides basic features such as:
psachin's avatar
psachin committed
7 8 9 10 11 12
  - Python 3 support by default
  - Create a new virtual environment.
  - Create a new virtual environment using custom Python path using =-p|--python=.
  - Delete an existing virtual environment(s).
  - List all existing virtual environment(s).
  - In case you don't remember the virtual environment name, TAB completion works :)
Sachin Patil's avatar
Sachin Patil committed
13 14 15 16

** Installation
   Run the command
   #+BEGIN_SRC sh
psachin's avatar
psachin committed
17
     curl https://gitlab.com/psachin/setV/raw/master/install.sh | sh -
Sachin Patil's avatar
Sachin Patil committed
18 19 20
   #+END_SRC

** Usage
psachin's avatar
psachin committed
21
   - First of all, the command is =setv=!!
Sachin Patil's avatar
Sachin Patil committed
22 23 24
   - When you install =setv=, the installation script will ask you to
     source =~/.bashrc= or =~/.bash_profile=. Please do that.

psachin's avatar
psachin committed
25 26
** Screencast(Usage)
   #+HTML: <a href="https://asciinema.org/a/234059" target="_blank"><img src="https://asciinema.org/a/234059.svg" /></a>
psachin's avatar
psachin committed
27

psachin's avatar
psachin committed
28 29
*** Create virtual environment
    #+BEGIN_SRC sh
psachin's avatar
psachin committed
30 31 32 33
      setv --new rango  # setv -n rango

      # Or using a custom Python binary path
      setv --new --python /opt/python/python3 rango  # setv -n -p /opt/python/python3 rango
psachin's avatar
psachin committed
34 35
    #+END_SRC

Sachin Patil's avatar
Sachin Patil committed
36
*** Activate existing environment
Sachin Patil's avatar
Sachin Patil committed
37 38 39 40

    #+BEGIN_SRC sh
      setv VIRTUAL_ENVIRONMENT_NAME

psachin's avatar
psachin committed
41
      # For example
Sachin Patil's avatar
Sachin Patil committed
42 43 44 45 46 47
      setv rango
    #+END_SRC

*** List all virtual environment(s)
    You can list existing virtual environments by typing
    #+BEGIN_SRC sh
48
      setv --list
Sachin Patil's avatar
Sachin Patil committed
49 50 51 52 53 54
      # or
      setv [TAB] [TAB]
    #+END_SRC

*** Delete virtual environment
    #+BEGIN_SRC sh
55
      setv --delete rango
Sachin Patil's avatar
Sachin Patil committed
56 57 58 59 60 61 62 63 64
    #+END_SRC

*** Switch to another virtual environment
    #+BEGIN_SRC sh options
      # Assuming you are in 'rango', switch to 'tango' using
      setv tango
    #+END_SRC

*** In case you don't fully remember virtual environment name
Sachin Patil's avatar
Sachin Patil committed
65
     - Bash-like TAB completion works for virtual environment names
Sachin Patil's avatar
Sachin Patil committed
66

Sachin Patil's avatar
Sachin Patil committed
67
** Contribute
psachin's avatar
psachin committed
68
   - Create a new issue.
Sachin Patil's avatar
Sachin Patil committed
69 70 71 72
   - Patches are welcome for existing issues.

** License
   GNU GPL version 3. See LICENSE file.