Skip to content

Commit d27b87f

Browse files
author
Kenneth Reitz
committed
Merge remote-tracking branch 'origin/master'
2 parents 650c831 + 79529f7 commit d27b87f

File tree

3 files changed

+193
-20
lines changed

3 files changed

+193
-20
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
docs/_build
22
.idea
3+
4+
# Ignore irrelevant files from the Sublime Text editor
5+
*.sublime-workspace
6+
*.sublime-project
7+
8+
# Ignore .hgignore for contributors using Mercurial.
9+
.hgignore

docs/dev/virtualenvs.rst

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Virtual Environments
22
====================
33

4-
A Virtual Environment, put simply, is an isolated working copy of Python which
5-
allows you to work on a specific project without worry of affecting other
4+
A Virtual Environment, put simply, is an isolated working copy of Python which
5+
allows you to work on a specific project without worry of affecting other
66
projects.
77

8-
For example, you can work on a project which requires Django 1.3 while also
8+
For example, you can work on a project which requires Django 1.3 while also
99
maintaining a project which requires Django 1.0.
1010

1111
virtualenv
1212
----------
1313

14-
`virtualenv <http://pypi.python.org/pypi/virtualenv>`_ is a tool to create
14+
`virtualenv <http://pypi.python.org/pypi/virtualenv>`_ is a tool to create
1515
isolated Python environments.
1616

1717
Install it via pip:
@@ -29,7 +29,7 @@ Basic Usage
2929
3030
$ virtualenv venv
3131
32-
This creates a copy of Python in whichever directory you ran the command in,
32+
This creates a copy of Python in whichever directory you ran the command in,
3333
placing it in a folder named ``venv``.
3434

3535
2. To begin using the virtual environment, it needs to be activated:
@@ -38,30 +38,30 @@ placing it in a folder named ``venv``.
3838
3939
$ source venv/bin/activate
4040
41-
You can then begin installing any new modules without affecting the system
41+
You can then begin installing any new modules without affecting the system
4242
default Python or other virtual environments.
4343

44-
3. If you are done working in the virtual environment for the moment, you can
44+
3. If you are done working in the virtual environment for the moment, you can
4545
deactivate it:
4646

4747
.. code-block:: console
4848
4949
$ deactivate
5050
51-
This puts you back to the system's default Python interpreter with all its
51+
This puts you back to the system's default Python interpreter with all its
5252
installed libraries.
5353

5454
To delete a virtual environment, just delete its folder.
5555

56-
After a while, though, you might end up with a lot of virtual environments
57-
littered across your system, and its possible you'll forget their names or
58-
where they were placed.
56+
After a while, though, you might end up with a lot of virtual environments
57+
littered across your system, and its possible you'll forget their names or
58+
where they were placed.
5959

6060
virtualenvwrapper
6161
-----------------
6262

63-
`virtualenvwrapper <http://www.doughellmann.com/projects/virtualenvwrapper/>`_
64-
provides a set of commands which makes working with virtual environments much
63+
`virtualenvwrapper <http://www.doughellmann.com/projects/virtualenvwrapper/>`_
64+
provides a set of commands which makes working with virtual environments much
6565
more pleasant. It also places all your virtual environments in one place.
6666

6767
To install (make sure **virtualenv** is already installed):
@@ -74,6 +74,17 @@ To install (make sure **virtualenv** is already installed):
7474
7575
(`Full virtualenvwrapper install instructions <http://www.doughellmann.com/docs/virtualenvwrapper/#introduction>`_.)
7676

77+
For Windows, you can use the `virtualenvwrapper-powershell <https://bitbucket.org/guillermooo/virtualenvwrapper-powershell>`_ clone.
78+
79+
To install (make sure **virtualenv** is already installed):
80+
81+
.. code-block:: console
82+
83+
PS> pip install virtualenvwrapper-powershell
84+
PS> $env:WORKON_HOME="~/Envs"
85+
PS> mkdir $env:WORKON_HOME
86+
PS> import-module virtualenvwrapper
87+
7788
Basic Usage
7889
~~~~~~~~~~~
7990

@@ -83,18 +94,18 @@ Basic Usage
8394
8495
$ mkvirtualenv venv
8596
86-
This creates the ``venv`` folder inside ``~/Envs``.
97+
This creates the ``venv`` folder inside ``~/Envs``.
8798

8899
2. Work on a virtual environment:
89100

90101
.. code-block:: console
91102
92103
$ workon venv
93104
94-
**virtualenvwrapper** provides tab-completion on environment names. It really
95-
helps when you have a lot of environments and have trouble remembering their
96-
names.
97-
``workon`` also deactivates whatever environment you are currently in, so you
105+
**virtualenvwrapper** provides tab-completion on environment names. It really
106+
helps when you have a lot of environments and have trouble remembering their
107+
names.
108+
``workon`` also deactivates whatever environment you are currently in, so you
98109
can quickly switch between environments.
99110

100111
3. Deactivating is still the same:
@@ -116,8 +127,8 @@ Other useful commands
116127
List all of the environments.
117128

118129
``cdvirtualenv``
119-
Navigate into the directory of the currently activated virtual environment,
120-
so you can browse its ``site-packages``, for example.
130+
Navigate into the directory of the currently activated virtual environment,
131+
so you can browse its ``site-packages``, for example.
121132

122133
``cdsitepackages``
123134
Like the above, but directly into ``site-packages`` directory.

make.bat

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
@ECHO OFF
2+
3+
REM Command file for Sphinx documentation
4+
5+
if "%SPHINXBUILD%" == "" (
6+
set SPHINXBUILD=sphinx-build
7+
)
8+
set BUILDDIR=build
9+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% docs
10+
if NOT "%PAPER%" == "" (
11+
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
12+
)
13+
14+
if "%1" == "" goto help
15+
16+
if "%1" == "help" (
17+
:help
18+
echo.Please use `make ^<target^>` where ^<target^> is one of
19+
echo. html to make standalone HTML files
20+
echo. dirhtml to make HTML files named index.html in directories
21+
echo. singlehtml to make a single large HTML file
22+
echo. pickle to make pickle files
23+
echo. json to make JSON files
24+
echo. htmlhelp to make HTML files and a HTML help project
25+
echo. qthelp to make HTML files and a qthelp project
26+
echo. devhelp to make HTML files and a Devhelp project
27+
echo. epub to make an epub
28+
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
29+
echo. text to make text files
30+
echo. man to make manual pages
31+
echo. changes to make an overview over all changed/added/deprecated items
32+
echo. linkcheck to check all external links for integrity
33+
echo. doctest to run all doctests embedded in the documentation if enabled
34+
goto end
35+
)
36+
37+
if "%1" == "clean" (
38+
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
39+
del /q /s %BUILDDIR%\*
40+
goto end
41+
)
42+
43+
if "%1" == "html" (
44+
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
45+
echo.
46+
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
47+
goto end
48+
)
49+
50+
if "%1" == "dirhtml" (
51+
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
52+
echo.
53+
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
54+
goto end
55+
)
56+
57+
if "%1" == "singlehtml" (
58+
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
59+
echo.
60+
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
61+
goto end
62+
)
63+
64+
if "%1" == "pickle" (
65+
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
66+
echo.
67+
echo.Build finished; now you can process the pickle files.
68+
goto end
69+
)
70+
71+
if "%1" == "json" (
72+
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
73+
echo.
74+
echo.Build finished; now you can process the JSON files.
75+
goto end
76+
)
77+
78+
if "%1" == "htmlhelp" (
79+
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
80+
echo.
81+
echo.Build finished; now you can run HTML Help Workshop with the ^
82+
.hhp project file in %BUILDDIR%/htmlhelp.
83+
goto end
84+
)
85+
86+
if "%1" == "qthelp" (
87+
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
88+
echo.
89+
echo.Build finished; now you can run "qcollectiongenerator" with the ^
90+
.qhcp project file in %BUILDDIR%/qthelp, like this:
91+
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SublimeDocs.qhcp
92+
echo.To view the help file:
93+
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SublimeDocs.ghc
94+
goto end
95+
)
96+
97+
if "%1" == "devhelp" (
98+
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
99+
echo.
100+
echo.Build finished.
101+
goto end
102+
)
103+
104+
if "%1" == "epub" (
105+
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
106+
echo.
107+
echo.Build finished. The epub file is in %BUILDDIR%/epub.
108+
goto end
109+
)
110+
111+
if "%1" == "latex" (
112+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
113+
echo.
114+
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
115+
goto end
116+
)
117+
118+
if "%1" == "text" (
119+
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
120+
echo.
121+
echo.Build finished. The text files are in %BUILDDIR%/text.
122+
goto end
123+
)
124+
125+
if "%1" == "man" (
126+
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
127+
echo.
128+
echo.Build finished. The manual pages are in %BUILDDIR%/man.
129+
goto end
130+
)
131+
132+
if "%1" == "changes" (
133+
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
134+
echo.
135+
echo.The overview file is in %BUILDDIR%/changes.
136+
goto end
137+
)
138+
139+
if "%1" == "linkcheck" (
140+
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
141+
echo.
142+
echo.Link check complete; look for any errors in the above output ^
143+
or in %BUILDDIR%/linkcheck/output.txt.
144+
goto end
145+
)
146+
147+
if "%1" == "doctest" (
148+
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
149+
echo.
150+
echo.Testing of doctests in the sources finished, look at the ^
151+
results in %BUILDDIR%/doctest/output.txt.
152+
goto end
153+
)
154+
155+
:end

0 commit comments

Comments
 (0)