Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #95 from guillermooo/add-make-win

Add make.bat for contributors on Windows
  • Loading branch information...
commit 79529f74ef430a9921b6e1308b75b22dcaf28ba0 2 parents 28e30f4 + 14b2ef1
Kenneth Reitz authored
Showing with 193 additions and 20 deletions.
  1. +7 −0 .gitignore
  2. +31 −20 docs/dev/virtualenvs.rst
  3. +155 −0 make.bat
View
7 .gitignore
@@ -1,2 +1,9 @@
docs/_build
.idea
+
+# Ignore irrelevant files from the Sublime Text editor
+*.sublime-workspace
+*.sublime-project
+
+# Ignore .hgignore for contributors using Mercurial.
+.hgignore
View
51 docs/dev/virtualenvs.rst
@@ -1,17 +1,17 @@
Virtual Environments
====================
-A Virtual Environment, put simply, is an isolated working copy of Python which
-allows you to work on a specific project without worry of affecting other
+A Virtual Environment, put simply, is an isolated working copy of Python which
+allows you to work on a specific project without worry of affecting other
projects.
-For example, you can work on a project which requires Django 1.3 while also
+For example, you can work on a project which requires Django 1.3 while also
maintaining a project which requires Django 1.0.
virtualenv
----------
-`virtualenv <http://pypi.python.org/pypi/virtualenv>`_ is a tool to create
+`virtualenv <http://pypi.python.org/pypi/virtualenv>`_ is a tool to create
isolated Python environments.
Install it via pip:
@@ -29,7 +29,7 @@ Basic Usage
$ virtualenv venv
-This creates a copy of Python in whichever directory you ran the command in,
+This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named ``venv``.
2. To begin using the virtual environment, it needs to be activated:
@@ -38,30 +38,30 @@ placing it in a folder named ``venv``.
$ source venv/bin/activate
-You can then begin installing any new modules without affecting the system
+You can then begin installing any new modules without affecting the system
default Python or other virtual environments.
-3. If you are done working in the virtual environment for the moment, you can
+3. If you are done working in the virtual environment for the moment, you can
deactivate it:
.. code-block:: console
$ deactivate
-This puts you back to the system's default Python interpreter with all its
+This puts you back to the system's default Python interpreter with all its
installed libraries.
To delete a virtual environment, just delete its folder.
-After a while, though, you might end up with a lot of virtual environments
-littered across your system, and its possible you'll forget their names or
-where they were placed.
+After a while, though, you might end up with a lot of virtual environments
+littered across your system, and its possible you'll forget their names or
+where they were placed.
virtualenvwrapper
-----------------
-`virtualenvwrapper <http://www.doughellmann.com/projects/virtualenvwrapper/>`_
-provides a set of commands which makes working with virtual environments much
+`virtualenvwrapper <http://www.doughellmann.com/projects/virtualenvwrapper/>`_
+provides a set of commands which makes working with virtual environments much
more pleasant. It also places all your virtual environments in one place.
To install (make sure **virtualenv** is already installed):
@@ -74,6 +74,17 @@ To install (make sure **virtualenv** is already installed):
(`Full virtualenvwrapper install instructions <http://www.doughellmann.com/docs/virtualenvwrapper/#introduction>`_.)
+For Windows, you can use the `virtualenvwrapper-powershell <https://bitbucket.org/guillermooo/virtualenvwrapper-powershell>`_ clone.
+
+To install (make sure **virtualenv** is already installed):
+
+.. code-block:: console
+
+ PS> pip install virtualenvwrapper-powershell
+ PS> $env:WORKON_HOME="~/Envs"
+ PS> mkdir $env:WORKON_HOME
+ PS> import-module virtualenvwrapper
+
Basic Usage
~~~~~~~~~~~
@@ -83,7 +94,7 @@ Basic Usage
$ mkvirtualenv venv
-This creates the ``venv`` folder inside ``~/Envs``.
+This creates the ``venv`` folder inside ``~/Envs``.
2. Work on a virtual environment:
@@ -91,10 +102,10 @@ This creates the ``venv`` folder inside ``~/Envs``.
$ workon venv
-**virtualenvwrapper** provides tab-completion on environment names. It really
-helps when you have a lot of environments and have trouble remembering their
-names.
-``workon`` also deactivates whatever environment you are currently in, so you
+**virtualenvwrapper** provides tab-completion on environment names. It really
+helps when you have a lot of environments and have trouble remembering their
+names.
+``workon`` also deactivates whatever environment you are currently in, so you
can quickly switch between environments.
3. Deactivating is still the same:
@@ -116,8 +127,8 @@ Other useful commands
List all of the environments.
``cdvirtualenv``
- Navigate into the directory of the currently activated virtual environment,
- so you can browse its ``site-packages``, for example.
+ Navigate into the directory of the currently activated virtual environment,
+ so you can browse its ``site-packages``, for example.
``cdsitepackages``
Like the above, but directly into ``site-packages`` directory.
View
155 make.bat
@@ -0,0 +1,155 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% docs
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :help
+ echo.Please use `make ^<target^>` where ^<target^> is one of
+ echo. html to make standalone HTML files
+ echo. dirhtml to make HTML files named index.html in directories
+ echo. singlehtml to make a single large HTML file
+ echo. pickle to make pickle files
+ echo. json to make JSON files
+ echo. htmlhelp to make HTML files and a HTML help project
+ echo. qthelp to make HTML files and a qthelp project
+ echo. devhelp to make HTML files and a Devhelp project
+ echo. epub to make an epub
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+ echo. text to make text files
+ echo. man to make manual pages
+ echo. changes to make an overview over all changed/added/deprecated items
+ echo. linkcheck to check all external links for integrity
+ echo. doctest to run all doctests embedded in the documentation if enabled
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+ del /q /s %BUILDDIR%\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SublimeDocs.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SublimeDocs.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
Please sign in to comment.
Something went wrong with that request. Please try again.