@@ -24,8 +24,8 @@ Syntax::
24
24
25
25
.. seealso ::
26
26
27
- * :ref: `hooks- scripts-premkvirtualenv `
28
- * :ref: `hooks- scripts-postmkvirtualenv `
27
+ * :ref: `scripts-premkvirtualenv `
28
+ * :ref: `scripts-postmkvirtualenv `
29
29
30
30
rmvirtualenv
31
31
------------
@@ -38,8 +38,8 @@ Syntax::
38
38
39
39
.. seealso ::
40
40
41
- * :ref: `hooks- scripts-prermvirtualenv `
42
- * :ref: `hooks- scripts-postrmvirtualenv `
41
+ * :ref: `scripts-prermvirtualenv `
42
+ * :ref: `scripts-postrmvirtualenv `
43
43
44
44
cpvirtualenv
45
45
------------
@@ -55,6 +55,10 @@ Syntax::
55
55
The environment created by the copy operation is made `relocatable
56
56
<http://virtualenv.openplans.org/#making-environments-relocatable> `__.
57
57
58
+ ==================================
59
+ Controlling the Active Environment
60
+ ==================================
61
+
58
62
workon
59
63
------
60
64
@@ -69,10 +73,10 @@ is printed to stdout.
69
73
70
74
.. seealso ::
71
75
72
- * :ref: `hooks- scripts-predeactivate `
73
- * :ref: `hooks- scripts-postdeactivate `
74
- * :ref: `hooks- scripts-preactivate `
75
- * :ref: `hooks- scripts-postactivate `
76
+ * :ref: `scripts-predeactivate `
77
+ * :ref: `scripts-postdeactivate `
78
+ * :ref: `scripts-preactivate `
79
+ * :ref: `scripts-postactivate `
76
80
77
81
deactivate
78
82
----------
@@ -91,8 +95,8 @@ Syntax::
91
95
92
96
.. seealso ::
93
97
94
- * :ref: `hooks- scripts-predeactivate `
95
- * :ref: `hooks- scripts-postdeactivate `
98
+ * :ref: `scripts-predeactivate `
99
+ * :ref: `scripts-postdeactivate `
96
100
97
101
==================================
98
102
Quickly Navigating to a virtualenv
@@ -104,6 +108,12 @@ currently-active virtualenv.
104
108
cdvirtualenv
105
109
------------
106
110
111
+ Change the current working directory to ``$VIRTUAL_ENV ``.
112
+
113
+ Syntax::
114
+
115
+ cdvirtualenv [subdir]
116
+
107
117
Calling ``cdvirtualenv `` changes the current working directory to the
108
118
top of the virtualenv (``$VIRTUAL_ENV ``). An optional argument is
109
119
appended to the path, allowing navigation directly into a
@@ -124,6 +134,13 @@ subdirectory.
124
134
cdsitepackages
125
135
--------------
126
136
137
+ Change the current working directory to the ``site-packages `` for
138
+ ``$VIRTUAL_ENV ``.
139
+
140
+ Syntax::
141
+
142
+ cdsitepackages [subdir]
143
+
127
144
Because the exact path to the site-packages directory in the
128
145
virtualenv depends on the version of Python, ``cdsitepackages `` is
129
146
provided as a shortcut for ``cdvirtualenv
@@ -132,29 +149,28 @@ allowed, to specify a directory hierarchy within the ``site-packages``
132
149
directory to change into.
133
150
134
151
::
152
+
135
153
$ workon pymotw
136
154
$ echo $VIRTUAL_ENV
137
155
/Users/dhellmann/.virtualenvs/pymotw
138
156
$ cdsitepackages PyMOTW/bisect/
139
157
$ pwd
140
158
/Users/dhellmann/.virtualenvs/pymotw/lib/python2.6/site-packages/PyMOTW/bisect
141
159
160
+ lssitepackages
161
+ --------------
162
+
163
+ Calling ``lssitepackages `` shows the content of the ``site-packages ``
164
+ directory of the currently-active virtualenv.
165
+
166
+ Syntax::
167
+
168
+ lssitepackages
169
+
142
170
===============
143
171
Path Management
144
172
===============
145
173
146
- Sometimes it is desirable to share installed packages that are not in
147
- the system ``site-pacakges `` directory and which you do not want to
148
- install in each virtualenv. In this case, you *could * symlink the
149
- source into the environment ``site-packages `` directory, but it is
150
- also easy to add extra directories to the PYTHONPATH by including them
151
- in a .pth file inside ``site-packages `` using ``add2virtualenv ``.
152
-
153
- 1. Check out the source for a big project, such as Django.
154
- 2. Run: ``add2virtualenv path_to_source ``.
155
- 3. Run: ``add2virtualenv ``.
156
- 4. A usage message and list of current "extra" paths is printed.
157
-
158
174
add2virtualenv
159
175
--------------
160
176
@@ -165,17 +181,20 @@ Syntax::
165
181
166
182
add2virtualenv directory1 directory2 ...
167
183
168
- Path management for packages outside of the virtual env. Based on a
169
- contribution from James Bennett and Jannis Leidel.
170
-
171
- This will be done by placing the directory names in a path file named
172
- ``virtualenv_path_extensions.pth `` inside the virtualenv's
173
- site-packages directory; if this file does not exist, it will be
174
- created first.
184
+ Sometimes it is desirable to share installed packages that are not in
185
+ the system ``site-pacakges `` directory and which should not be
186
+ installed in each virtualenv. One possible solution is to symlink the
187
+ source into the environment ``site-packages `` directory, but it is
188
+ also easy to add extra directories to the PYTHONPATH by including them
189
+ in a ``.pth `` file inside ``site-packages `` using ``add2virtualenv ``.
175
190
191
+ 1. Check out the source for a big project, such as Django.
192
+ 2. Run: ``add2virtualenv path_to_source ``.
193
+ 3. Run: ``add2virtualenv ``.
194
+ 4. A usage message and list of current "extra" paths is printed.
176
195
177
- lssitepackages
178
- --------------
196
+ The directory names are added to a path file named
197
+ ``virtualenv_path_extensions.pth `` inside the site-packages directory
198
+ for the environment.
179
199
180
- Calling ``lssitepackages `` shows the content of the ``site-packages ``
181
- directory of the currently-active virtualenv.
200
+ *Based on a contribution from James Bennett and Jannis Leidel. *
0 commit comments