Skip to content

Commit b7d4fe3

Browse files
committed
reorg install docs to separate the customization stuff; add some comments about site-wide installation; fixes #87
1 parent bae9862 commit b7d4fe3

File tree

1 file changed

+53
-31
lines changed

1 file changed

+53
-31
lines changed

docs/en/install.rst

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,37 @@ add it to your user local directory (usually `~/.local`).
4141

4242
$ pip install --install-option="--user" virtualenvwrapper
4343

44-
WORKON_HOME
44+
.. _install-shell-config:
45+
46+
Shell Startup File
47+
==================
48+
49+
Add two lines to your shell startup file (``.bashrc``, ``.profile``,
50+
etc.) to set the location where the virtual environments should live
51+
and the location of the script installed with this package::
52+
53+
export WORKON_HOME=$HOME/.virtualenvs
54+
source /usr/local/bin/virtualenvwrapper.sh
55+
56+
After editing it, reload the startup file (e.g., run ``source
57+
~/.bashrc``).
58+
59+
Quick-Start
4560
===========
4661

62+
1. Run: ``workon``
63+
2. A list of environments, empty, is printed.
64+
3. Run: ``mkvirtualenv temp``
65+
4. A new environment, ``temp`` is created and activated.
66+
5. Run: ``workon``
67+
6. This time, the ``temp`` environment is included.
68+
69+
Customization
70+
=============
71+
72+
WORKON_HOME
73+
-----------
74+
4775
The variable ``WORKON_HOME`` tells virtualenvwrapper where to place
4876
your virtual environments. The default is ``$HOME/.virtualenvs``. If
4977
the directory does not exist when virtualenvwrapper is loaded, it will
@@ -52,7 +80,7 @@ be created automatically.
5280
.. _variable-VIRTUALENVWRAPPER_HOOK_DIR:
5381

5482
VIRTUALENVWRAPPER_HOOK_DIR
55-
==========================
83+
--------------------------
5684

5785
The variable ``VIRTUALENVWRAPPER_HOOK_DIR`` tells virtualenvwrapper
5886
where the user-defined hooks should be placed. The default is
@@ -61,35 +89,20 @@ where the user-defined hooks should be placed. The default is
6189
.. _variable-VIRTUALENVWRAPPER_LOG_DIR:
6290

6391
VIRTUALENVWRAPPER_LOG_DIR
64-
==========================
92+
-------------------------
6593

6694
The variable ``VIRTUALENVWRAPPER_LOG_DIR`` tells virtualenvwrapper
6795
where the user-defined logs should be written. The default is
6896
``$WORKON_HOME``.
6997

70-
.. _install-shell-config:
71-
72-
Shell Startup File
73-
==================
74-
75-
Add two lines to your shell startup file (``.bashrc``, ``.profile``,
76-
etc.) to set the location where the virtual environments should live
77-
and the location of the script installed with this package::
78-
79-
export WORKON_HOME=$HOME/.virtualenvs
80-
source /usr/local/bin/virtualenvwrapper.sh
81-
82-
After editing it, reload the startup file (e.g., run: ``source
83-
~/.bashrc``).
84-
8598
.. _variable-VIRTUALENVWRAPPER_VIRTUALENV:
8699

87100
.. _variable-VIRTUALENVWRAPPER_VIRTUALENV_ARGS:
88101

89102
.. _variable-VIRTUALENVWRAPPER_PYTHON:
90103

91104
Python Interpreter, virtualenv, and $PATH
92-
=========================================
105+
-----------------------------------------
93106

94107
During startup, ``virtualenvwrapper.sh`` finds the first ``python``
95108
and ``virtualenv`` programs on the ``$PATH`` and remembers them to use
@@ -114,7 +127,7 @@ sourcing ``virtualenvwrapper.sh``. For example::
114127
source /usr/local/bin/virtualenvwrapper.sh
115128

116129
Default Arguments for virtualenv
117-
================================
130+
--------------------------------
118131

119132
If the application identified by ``VIRTUALENVWRAPPER_VIRTUALENV``
120133
needs arguments, they can be set in
@@ -127,24 +140,33 @@ environments are isolated from the system ``site-packages`` directory.
127140

128141
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
129142

130-
Quick-Start
131-
===========
132-
133-
1. Run: ``workon``
134-
2. A list of environments, empty, is printed.
135-
3. Run: ``mkvirtualenv temp``
136-
4. A new environment, ``temp`` is created and activated.
137-
5. Run: ``workon``
138-
6. This time, the ``temp`` environment is included.
139-
140143
Temporary Files
141-
===============
144+
---------------
142145

143146
virtualenvwrapper creates temporary files in ``$TMPDIR``. If the
144147
variable is not set, it uses ``/tmp``. To change the location of
145148
temporary files just for virtualenvwrapper, set
146149
``VIRTUALENVWRAPPER_TMPDIR``.
147150

151+
Site-wide Configuration
152+
-----------------------
153+
154+
Most UNIX systems include the ability to change the configuration for
155+
all users. This typically takes one of two forms: editing the
156+
*skeleton* files for new accounts or editing the global startup file
157+
for a shell.
158+
159+
Editing the skeleton files for new accounts means that each new user
160+
will have their private startup files preconfigured to load
161+
virtualenvwrapper. They can disable it by commenting out or removing
162+
those lines. Refer to the documentation for the shell and operating
163+
system to identify the appropriate file to edit.
164+
165+
Modifying the global startup file for a given shell means that all
166+
users of that shell will have virtualenvwrapper enabled, and they
167+
cannot disable it. Refer to the documentation for the shell to
168+
identify the appropriate file to edit.
169+
148170
Upgrading from 1.x
149171
==================
150172

0 commit comments

Comments
 (0)