From 36affd7faa01c245fa697bc5cdfc80bd4aa24dd9 Mon Sep 17 00:00:00 2001 From: guillermooo Date: Mon, 6 Feb 2012 23:27:22 +0100 Subject: [PATCH 1/3] add Windows-specific info about virtualenvwrapper; ignore more files --- .gitignore | 4 ++++ docs/dev/virtualenvs.rst | 51 ++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 331e463fc..16b1b0678 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ docs/_build .idea + +# Ignore irrelevant files from the Sublime Text editor +*.sublime-workspace +*.sublime-project diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 9def09bfe..7a35e9b1c 100644 --- a/docs/dev/virtualenvs.rst +++ b/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 `_ is a tool to create +`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 `_ -provides a set of commands which makes working with virtual environments much +`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 `_.) +For Windows, you can use the `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. From d9a559e08c6ce611dc0a91f6e962c6290a6fecda Mon Sep 17 00:00:00 2001 From: guillermooo Date: Sun, 12 Feb 2012 22:48:58 +0100 Subject: [PATCH 2/3] new branch --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 16b1b0678..7981d1837 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ docs/_build # Ignore irrelevant files from the Sublime Text editor *.sublime-workspace *.sublime-project + +# Ignore .hgignore for contributors using Mercurial. +.hgignore From 14b2ef14bf24559c2115d98ff44c38f0a6b2e1dd Mon Sep 17 00:00:00 2001 From: guillermooo Date: Sun, 12 Feb 2012 22:54:18 +0100 Subject: [PATCH 3/3] add make.bat --- make.bat | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 make.bat diff --git a/make.bat b/make.bat new file mode 100644 index 000000000..6741296d3 --- /dev/null +++ b/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 ^` where ^ 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