Skip to content

Commit 8bb2541

Browse files
committed
minor doc updates and formatting changes
1 parent d944816 commit 8bb2541

File tree

3 files changed

+94
-134
lines changed

3 files changed

+94
-134
lines changed

docs/source/command_ref.rst

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Syntax::
2020

2121
mkvirtualenv [options] ENVNAME
2222

23-
(where the options are passed directly to virtualenv)
23+
(any options are passed directly to ``virtualenv``)
2424

2525
rmvirtualenv
2626
------------
@@ -54,32 +54,38 @@ Syntax::
5454

5555
workon [environment_name]
5656

57-
If no ``environment_name`` is given the list of available environments is printed to stdout.
57+
If no ``environment_name`` is given the list of available environments
58+
is printed to stdout.
5859

5960
deactivate
6061
----------
6162

62-
Switch from a virtual environment to the system-installed version of Python.
63+
Switch from a virtual environment to the system-installed version of
64+
Python.
6365

6466
Syntax::
6567

6668
deactivate
6769

6870
.. note::
6971

70-
This command is actually part of virtualenv, but is wrapped to provide before and after hooks, just as workon does for activate.
72+
This command is actually part of virtualenv, but is wrapped to
73+
provide before and after hooks, just as workon does for activate.
7174

7275
==================================
7376
Quickly Navigating to a virtualenv
7477
==================================
7578

76-
There are two functions to provide shortcuts to navigate into the the currently-active
77-
virtualenv.
79+
There are two functions to provide shortcuts to navigate into the the
80+
currently-active virtualenv.
7881

7982
cdvirtualenv
8083
------------
8184

82-
Calling ``cdvirtualenv`` changes the current working directory to the top of the virtualenv (``$VIRTUAL_ENV``). An optional argument is appended to the path, allowing navigation directly into a subdirectory.
85+
Calling ``cdvirtualenv`` changes the current working directory to the
86+
top of the virtualenv (``$VIRTUAL_ENV``). An optional argument is
87+
appended to the path, allowing navigation directly into a
88+
subdirectory.
8389

8490
::
8591

@@ -96,10 +102,12 @@ Calling ``cdvirtualenv`` changes the current working directory to the top of the
96102
cdsitepackages
97103
--------------
98104

99-
Because the exact path to the site-packages directory in the virtualenv depends on the
100-
version of Python, ``cdsitepackages`` is provided as a shortcut for ``cdvirtualenv
101-
lib/python${pyvers}/site-packages``. An optional argument is also allowed, to specify
102-
a directory hierarchy within the ``site-packages`` directory to change into.
105+
Because the exact path to the site-packages directory in the
106+
virtualenv depends on the version of Python, ``cdsitepackages`` is
107+
provided as a shortcut for ``cdvirtualenv
108+
lib/python${pyvers}/site-packages``. An optional argument is also
109+
allowed, to specify a directory hierarchy within the ``site-packages``
110+
directory to change into.
103111

104112
::
105113
$ workon pymotw
@@ -113,7 +121,12 @@ a directory hierarchy within the ``site-packages`` directory to change into.
113121
Path Management
114122
===============
115123

116-
Sometimes it is desirable to share installed packages that are not in the system ``site-pacakges`` directory and which you do not want to install in each virtualenv. In this case, you *could* symlink the source into the environment ``site-packages`` directory, but it is also easy to add extra directories to the PYTHONPATH by including them in a .pth file inside ``site-packages`` using ``add2virtualenv``.
124+
Sometimes it is desirable to share installed packages that are not in
125+
the system ``site-pacakges`` directory and which you do not want to
126+
install in each virtualenv. In this case, you *could* symlink the
127+
source into the environment ``site-packages`` directory, but it is
128+
also easy to add extra directories to the PYTHONPATH by including them
129+
in a .pth file inside ``site-packages`` using ``add2virtualenv``.
117130

118131
1. Check out the source for a big project, such as Django.
119132
2. Run: ``add2virtualenv path_to_source``.
@@ -123,22 +136,24 @@ Sometimes it is desirable to share installed packages that are not in the system
123136
add2virtualenv
124137
--------------
125138

126-
Adds the specified directories to the Python path for the currently-active
127-
virtualenv.
139+
Adds the specified directories to the Python path for the
140+
currently-active virtualenv.
128141

129142
Syntax::
130143

131144
add2virtualenv directory1 directory2 ...
132145

133-
Path management for packages outside of the virtual env.
134-
Based on a contribution from James Bennett and Jannis Leidel.
146+
Path management for packages outside of the virtual env. Based on a
147+
contribution from James Bennett and Jannis Leidel.
135148

136-
This will be done by placing the directory names in a path file
137-
named ``virtualenv_path_extensions.pth`` inside the virtualenv's site-packages
138-
directory; if this file does not exist, it will be created first.
149+
This will be done by placing the directory names in a path file named
150+
``virtualenv_path_extensions.pth`` inside the virtualenv's
151+
site-packages directory; if this file does not exist, it will be
152+
created first.
139153

140154

141155
lssitepackages
142156
--------------
143157

144-
Calling ``lssitepackages`` shows the content of the ``site-packages`` directory of the currently-active virtualenv.
158+
Calling ``lssitepackages`` shows the content of the ``site-packages``
159+
directory of the currently-active virtualenv.

docs/source/developers.rst

Lines changed: 25 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -18,127 +18,48 @@ Paver. You will need the following packages in order to build the
1818
docs:
1919

2020
- Sphinx
21-
- Paver
2221
- docutils
23-
- sphinxcontrib-paverutils
2422

25-
Once all of them are installed into a virtualenv using easy_install,
26-
run ``paver html`` to generate the HTML version of the documentation::
23+
Once all of the tools are installed into a virtualenv using
24+
pip, run ``make html`` to generate the HTML version of the
25+
documentation::
2726

28-
$ paver html
29-
---> pavement.html
30-
---> sphinxcontrib.paverutils.html
31-
mkdir ./docs/html (mode 511)
32-
sphinx-build -b html -d ./docs/doctrees -c sphinx/pkg -Aproject=virtualenvwrapper ./docsource ./docs/html
33-
Running Sphinx v0.6.1
27+
$ make html
28+
rm -rf virtualenvwrapper/docs
29+
(cd docs && make html SPHINXOPTS="-c sphinx/pkg")
30+
sphinx-build -b html -d build/doctrees -c sphinx/pkg source build/html
31+
Running Sphinx v0.6.4
3432
loading pickled environment... done
35-
building [html]: targets for 4 source files that are out of date
36-
updating environment: 1 added, 1 changed, 0 removed
37-
reading sources... [ 50%] developers
38-
reading sources... [100%] index
39-
40-
/Users/dhellmann/Devel/virtualenvwrapper/src/docsource/developers.rst:19: (WARNING/2) Literal block expected; none found.
33+
building [html]: targets for 2 source files that are out of date
34+
updating environment: 0 added, 2 changed, 0 removed
35+
reading sources... [ 50%] command_ref
36+
reading sources... [100%] developers
37+
4138
looking for now-outdated files... none found
4239
pickling environment... done
4340
checking consistency... done
4441
preparing documents... done
45-
writing output... [ 20%] command_ref
46-
writing output... [ 40%] developers
47-
writing output... [ 60%] history
48-
writing output... [ 80%] hooks
42+
writing output... [ 33%] command_ref
43+
writing output... [ 66%] developers
4944
writing output... [100%] index
50-
45+
5146
writing additional files... search
52-
copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/src/sphinx/pkg/static' does not exist
47+
copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist
5348
done
5449
dumping search index... done
5550
dumping object inventory... done
56-
build succeeded, 2 warnings.
57-
rmtree virtualenvwrapper/docs () {}
58-
move docs/html virtualenvwrapper/docs
59-
51+
build succeeded, 1 warning.
52+
53+
Build finished. The HTML pages are in build/html.
54+
cp -r docs/build/html virtualenvwrapper/docs
55+
6056
The output version of the documentation ends up in
6157
``./virtualenvwrapper/docs`` inside your sandbox.
6258

6359
Running Tests
6460
=============
6561

6662
The test suite for virtualenvwrapper uses `shunit2
67-
<http://shunit2.googlecode.com/>`_. To run the tests under both bash
68-
and zsh, use ``paver test``. To add new tests, modify the
69-
``tests/test.sh`` script with new test functions.
70-
71-
::
72-
73-
$ paver test
74-
---> pavement.test
75-
bash ./tests/test.sh
76-
77-
test_mkvirtualenv
78-
New python executable in env1/bin/python
79-
Installing setuptools............done.
80-
81-
test_cdvirtual
82-
83-
test_cdsitepackages
84-
85-
test_mkvirtualenv_activates
86-
New python executable in env2/bin/python
87-
Installing setuptools............done.
88-
89-
test_workon
90-
91-
test_postactivate_hook
92-
93-
test_deactivate
94-
95-
test_deactivate_hooks
96-
97-
test_virtualenvwrapper_show_workon_options
98-
99-
test_rmvirtualenv
100-
New python executable in deleteme/bin/python
101-
Installing setuptools............done.
102-
103-
test_rmvirtualenv_no_such_env
104-
105-
test_missing_workon_home
106-
107-
Ran 12 tests.
108-
109-
OK
110-
SHUNIT_PARENT=./tests/test.sh zsh -o shwordsplit ./tests/test.sh
111-
112-
test_mkvirtualenv
113-
New python executable in env1/bin/python
114-
Installing setuptools............done.
115-
116-
test_cdvirtual
117-
118-
test_cdsitepackages
119-
120-
test_mkvirtualenv_activates
121-
New python executable in env2/bin/python
122-
Installing setuptools............done.
123-
124-
test_workon
125-
126-
test_postactivate_hook
127-
128-
test_deactivate
129-
130-
test_deactivate_hooks
131-
132-
test_virtualenvwrapper_show_workon_options
133-
134-
test_rmvirtualenv
135-
New python executable in deleteme/bin/python
136-
Installing setuptools............done.
137-
138-
test_rmvirtualenv_no_such_env
139-
140-
test_missing_workon_home
141-
142-
Ran 12 tests.
143-
144-
OK
63+
<http://shunit2.googlecode.com/>`_. To run the tests under bash, sh,
64+
and zsh, use ``make test``. To add new tests, modify or create an
65+
appropriate script in the ``tests`` directory.

docs/source/hooks.rst

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,25 @@
22
Hook Scripts
33
============
44

5-
virtualenvwrapper adds several hook points you can use to change your settings, shell environment, or other configuration values when creating, deleting, or moving between environments. They are either *sourced* (allowing them to modify your shell environment) or *run* as an external program at the appropriate trigger time.
5+
virtualenvwrapper adds several hook points you can use to change your
6+
settings, shell environment, or other configuration values when
7+
creating, deleting, or moving between environments. They are either
8+
*sourced* (allowing them to modify your shell environment) or *run* as
9+
an external program at the appropriate trigger time.
610

711
Environment Hooks
812
=================
913

1014
postactivate
1115
------------
1216

13-
The ``$VIRTUAL_ENV/bin/postactivate`` script is sourced after the new environment is enabled. ``$VIRTUAL_ENV`` refers to the new environment at the time the script runs.
17+
The ``$VIRTUAL_ENV/bin/postactivate`` script is sourced after the new
18+
environment is enabled. ``$VIRTUAL_ENV`` refers to the new environment
19+
at the time the script runs.
1420

15-
This example script for the PyMOTW environment changes the current working directory and the PATH variable to refer to the source tree containing the PyMOTW source.
21+
This example script for the PyMOTW environment changes the current
22+
working directory and the PATH variable to refer to the source tree
23+
containing the PyMOTW source.
1624

1725
::
1826

@@ -23,17 +31,24 @@ This example script for the PyMOTW environment changes the current working direc
2331
predeactivate
2432
-------------
2533

26-
The ``$VIRTUAL_ENV/bin/predeactivate`` script is sourced before the current environment is deactivated, and can be used to disable or clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old environment at the time the script runs.
34+
The ``$VIRTUAL_ENV/bin/predeactivate`` script is sourced before the
35+
current environment is deactivated, and can be used to disable or
36+
clear settings in your environment. ``$VIRTUAL_ENV`` refers to the old
37+
environment at the time the script runs.
2738

2839
Global Hooks
2940
============
3041

3142
postactivate
3243
------------
3344

34-
The global ``$WORKON_HOME/postactivate`` script is sourced after the new environment is enabled and the new environment's postactivate is sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new environment at the time the script runs.
45+
The global ``$WORKON_HOME/postactivate`` script is sourced after the
46+
new environment is enabled and the new environment's postactivate is
47+
sourced (if it exists). ``$VIRTUAL_ENV`` refers to the new environment
48+
at the time the script runs.
3549

36-
This example script adds a space between the virtual environment name and your old PS1 by making use of ``_OLD_VIRTUAL_PS1``.
50+
This example script adds a space between the virtual environment name
51+
and your old PS1 by making use of ``_OLD_VIRTUAL_PS1``.
3752

3853
::
3954

@@ -42,19 +57,28 @@ This example script adds a space between the virtual environment name and your o
4257
premkvirtualenv
4358
---------------
4459

45-
The ``$WORKON_HOME/premkvirtualenv`` script is run as an external program after the virtual environment is created but before the current environment is switched to point to the new env. The current working directory for the script is ``$WORKON_HOME`` and the name of the new environment is passed as an argument to the script.
60+
The ``$WORKON_HOME/premkvirtualenv`` script is run as an external
61+
program after the virtual environment is created but before the
62+
current environment is switched to point to the new env. The current
63+
working directory for the script is ``$WORKON_HOME`` and the name of
64+
the new environment is passed as an argument to the script.
4665

4766
postmkvirtualenv
4867
----------------
4968

50-
The ``$WORKON_HOME/postmkvirtualenv`` script is sourced after the new environment is created and activated.
69+
The ``$WORKON_HOME/postmkvirtualenv`` script is sourced after the new
70+
environment is created and activated.
5171

5272
prermvirtualenv
5373
---------------
5474

55-
The ``$WORKON_HOME/prermvirtualenv`` script is run as an external program before the environment is removed. The full path to the environment directory is passed as an argument to the script.
75+
The ``$WORKON_HOME/prermvirtualenv`` script is run as an external
76+
program before the environment is removed. The full path to the
77+
environment directory is passed as an argument to the script.
5678

5779
postrmvirtualenv
5880
----------------
5981

60-
The ``$WORKON_HOME/postrmvirtualenv`` script is run as an external program after the environment is removed. The full path to the environment directory is passed as an argument to the script.
82+
The ``$WORKON_HOME/postrmvirtualenv`` script is run as an external
83+
program after the environment is removed. The full path to the
84+
environment directory is passed as an argument to the script.

0 commit comments

Comments
 (0)