From d17acbf5151c923a3588c8dd8697041fc21cf9dd Mon Sep 17 00:00:00 2001
From: Can Ibanoglu
Date: Fri, 8 Nov 2013 21:21:56 +0200
Subject: [PATCH 001/942] Added virtual environment enforcing for pip for the
osx installation tutorial
---
docs/starting/install/osx.rst | 43 +++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index dc6676733..b84eeb02f 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -119,6 +119,49 @@ An useful set of extensions to virtualenv is available in virtualenvwrapper,
`RTFD `_ to find out more.
+A note about Pip and Virtualenv
+-------------------------------
+
+By now it should be clear that using virtual environments is a great way to keep
+your development environment clean and keeping different projects' requirements
+separate.
+
+When you start working on many different projects, it can be hard to remember to
+activate the related virtual environment when you come back to a specific project.
+As a result of this, it is very easy to install packages globally while thinking
+that you are actually installing the package for the virtual environment of the
+project. Over time this can result in a messy global package list.
+
+In order to make sure that you install packages to your active virtual environment
+when you use ``pip install``, consider adding the following two lines to your
+``~/.bashrc`` file:
+
+.. code-block:: console
+ export PIP_REQUIRE_VIRTUALENV=true
+
+After saving this change and sourcing the ``~/.bashrc`` file with ``source ~/.bashrc``,
+pip will no longer let you install packages if you are not in a virtual environment.
+If you try to use ``pip install`` outside of a virtual environment pip will
+gently remind you that an activated virtual environment is needed to install
+packages.
+
+.. code-block:: console
+ $ pip install requests
+ Could not find an activated virtualenv (required).
+
+You will of course need to install some packages globally and this can be accomplished
+by adding the following to your ``~/.bashrc`` file:
+
+.. code-block:: console
+ gpip() {
+ PIP_REQUIRE_VIRTUALENV="" pip "$@"
+ }
+
+After saving the changes and sourcing your ``~/.bashrc`` file you can now install
+packages globally by running ``gpip install``. You can change the name of the
+function to anything you like, just keep in mind that you will have to use that
+name when trying install packages globally with pip.
+
--------------------------------
This page is a remixed version of `another guide `_,
From 5156f9011ab775bd9e34ae45fb108f7cbe16329d Mon Sep 17 00:00:00 2001
From: Jonathan Steinmann
Date: Thu, 16 Jan 2014 23:04:10 -0500
Subject: [PATCH 002/942] update db.rst
expand on Django ORM basics
---
docs/scenarios/db.rst | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst
index 6d6d6ce7a..787f0efe3 100644
--- a/docs/scenarios/db.rst
+++ b/docs/scenarios/db.rst
@@ -33,3 +33,11 @@ to provide database access.
It's based on the idea of `models `_, an abstraction that makes it easier to
manipulate data in Python.
+The basics:
+
+- Each model is a Python class that subclasses django.db.models.Model.
+- Each attribute of the model represents a database field.
+- Django gives you an automatically-generated database-access API; see `Making queries `__.
+to provide database access.
+
+
From 21d8f91ac6e5228780736c527b6821be3814d7a4 Mon Sep 17 00:00:00 2001
From: imranghory
Date: Sat, 25 Jan 2014 14:37:18 +0000
Subject: [PATCH 003/942] Make explicit whats being referred to
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 0529b21ec..6ebd5d8f4 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -94,7 +94,7 @@ be sure to avoid using special symbols like the dot (.) or question mark (?).
So a file name like `my.spam.py` is one you should avoid! Naming this way
will interfere with the way python looks for modules.
-In this example python expects to find a "spam.py" file in a folder named "my"
+In the case of `my.spam.py` python expects to find a "spam.py" file in a folder named "my"
which is not the case. There is an
`example `_ of how the
dot notation should be used in the python docs.
From 020339f000433455d7812fd4f734e839ce94237e Mon Sep 17 00:00:00 2001
From: zachcp
Date: Tue, 28 Jan 2014 12:28:31 -0500
Subject: [PATCH 004/942] Update Scientific Python Link
---
docs/intro/learning.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index b7633f9cf..2e463edc6 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -140,7 +140,7 @@ A Primer on Scientific Programming with Python, written by Hans Petter Langtange
mainly covers Python's usage in scientific field. In the book, examples are
chosen from mathematics and the natural sciences.
- `A Primer on Scientific Programming with Python `_
+ `A Primer on Scientific Programming with Python `_
Numerical Methods in Engineering with Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From 852c5b1498c9c9dfad6c7ecc373b260fad27f9e6 Mon Sep 17 00:00:00 2001
From: Dhia Abbassi
Date: Wed, 5 Feb 2014 15:30:12 +0100
Subject: [PATCH 005/942] Plac module
Added Plac module description
---
docs/scenarios/cli.rst | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index 933b0f082..5af149e75 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -17,3 +17,14 @@ docopt
`docopt `_ is a lightweight, highly Pythonic package that
allows creating command line interfaces easily and intuitively, by parsing
POSIX-style usage instructions.
+
+Plac
+------
+
+`Plac `_ is a python module that allows developing command line applications. In fact
+plac is a simple wrapper over the python standard library `argparse `_, it hides most of its
+complexity by using a declarative interface: the argument parser is inferred
+rather than written down by imperatively. It is targetting especially unsophisticated
+users, programmers, sys-admins, scientists and in general people writing throw-away
+scripts for themselves, choosing the command-line interface because it is quick
+and simple.
From ccf93af642d77e7fd1501c189b528146f4736360 Mon Sep 17 00:00:00 2001
From: Jason Harmon
Date: Thu, 6 Feb 2014 10:04:23 -0800
Subject: [PATCH 006/942] Updating links for brew
---
docs/starting/install/osx.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 8017bfb3b..0f95e73bf 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -33,14 +33,14 @@ package.
While Lion comes with a large number of UNIX utilities, those familiar with
Linux systems will notice one key component missing: a decent package manager.
-`Homebrew `_ fills this void.
+`Homebrew `_ fills this void.
-To `install Homebrew `_,
+To `install Homebrew `_,
simply run
.. code-block:: console
- $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
+ $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
The script will explain what changes it will make and prompt you before the
installation begins.
From 1a5235309787f349728185b23b3eb013852d2e17 Mon Sep 17 00:00:00 2001
From: Michael Schurter
Date: Thu, 6 Feb 2014 15:44:48 -0800
Subject: [PATCH 007/942] Switch from Chishop to pypiserver
---
docs/shipping/packaging.rst | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst
index 54d72b04a..6d4aa5b8f 100644
--- a/docs/shipping/packaging.rst
+++ b/docs/shipping/packaging.rst
@@ -62,12 +62,14 @@ you can still install MyPackage using:
$ pip install http://127.0.0.1:9000/MyPackage.tar.gz
-Chishop
-+++++++
+pypiserver
+++++++++++
+
+`Pypiserver `_ is a minimal PyPI compatible server.
+It can be used to serve a set of packages to easy_install or pip. It includes helpful
+features like an administrative command (``-U``) which will update all its packages to their
+latest versions found on PyPI.
-`Chishop `_ is a simple PyPI server
-written in django which allows you to register/upload with distutils and
-install with easy_install/pip.
S3-Hosted PyPi
++++++++++++++
From 2017f0226504c6b5493b05b6e6626252eda3a413 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Thu, 6 Feb 2014 21:10:56 -0500
Subject: [PATCH 008/942] update "env.rst"
---
docs/dev/env.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index e2e628cb7..8739a3630 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -17,7 +17,7 @@ or icons. There exist a couple of plugins and settings for the VIM editor to
aid Python development. If you only develop in Python, a good start is to set
the default settings for indentation and line-wrapping to values compliant with
:pep:`8`. In your home directory, open a file called `.vimrc` and add the
-following lines:::
+following lines::
set textwidth=79 " lines longer than 79 columns will be broken
set shiftwidth=4 " operation >> indents 4 columns; << unindents 4 columns
@@ -118,7 +118,7 @@ Sublime Text
extraordinary features and amazing performance.
Sublime Text has excellent support for editing Python code and uses Python for
-its plugin API. It also has plugins a diverse variety of plugins, `some of which `_
+its plugin API. It also has a diverse variety of plugins, `some of which `_
allow for in-editor PEP8 checking and code "linting".
From bdf516bb240f850b780e89cb10de62b0c5df6b66 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Thu, 6 Feb 2014 21:30:51 -0500
Subject: [PATCH 009/942] add comma
---
docs/dev/virtualenvs.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index c08f1118e..cf2b285b9 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -140,7 +140,7 @@ Other useful commands
autoenv
-------
-When you ``cd`` into a directory containing a ``.env`` `autoenv `_
+When you ``cd`` into a directory containing a ``.env``, `autoenv `_
automagically activates the environment.
Install it on Mac OS X using ``brew``:
From 41b2c8bf49f2fac7669275cb273fdd169300a32d Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Tue, 11 Feb 2014 22:23:25 +0300
Subject: [PATCH 010/942] Give credits to people in the sidebar to the left
---
docs/_templates/sidebarintro.html | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 58c71b058..4f2c8fc1c 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -18,11 +18,12 @@ Donate
width="48pt" height="20pt">
-Feedback
+Contributors
- Feedback is greatly appreciated. If you have any questions, comments,
- random praise, or anonymous threats,
- shoot me an email.
+ This work is a result of collaboration of
+ 135+ people
+ around the world, and your contribution
+ is welcome too.
From 832f69841002a71edad95db78777fa8324eb5243 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Mon, 10 Feb 2014 22:52:16 -0800
Subject: [PATCH 011/942] update intro section: add Pro Python link
---
docs/intro/community.rst | 2 +-
docs/intro/learning.rst | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/intro/community.rst b/docs/intro/community.rst
index 05cd14820..f54caffea 100644
--- a/docs/intro/community.rst
+++ b/docs/intro/community.rst
@@ -75,7 +75,7 @@ The major events for the Python community are developer conferences. The two
most notable conferences are PyCon, which is held in the US, and its European
sibling, EuroPython.
-A comprehensive list of conferences is maintained `at pycon.org `_.
+A comprehensive list of conferences is maintained at `pycon.org `_.
Python User Groups
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 2e463edc6..bd2ca6d7d 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -104,6 +104,8 @@ Pro Python
This book is for intermediate to advanced Python programmers who are looking to understand how
and why Python works the way it does and how they can take their code to the next level.
+ `Pro Python `_
+
Expert Python Programming
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -145,7 +147,7 @@ chosen from mathematics and the natural sciences.
Numerical Methods in Engineering with Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Numerical Methods in Engineering with Python,written by Jaan Kiusalaas, attempts to
+Numerical Methods in Engineering with Python, written by Jaan Kiusalaas, attempts to
emphasis on numerical methods and how to implement them in Python.
`Numerical Methods in Engineering with Python `_
From dcaa25d0a6193ef16df32c68eba3776b5ff5d449 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Tue, 11 Feb 2014 21:49:35 -0800
Subject: [PATCH 012/942] remote duplicate Chef in admin.rst
---
docs/scenarios/admin.rst | 1 -
1 file changed, 1 deletion(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 84c98da13..fd4645485 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -177,7 +177,6 @@ A full terminal application like a widely extended top which is based on psutil
monitoring is `glance `_.
Ansible
-Chef
----
.. todo:: Write about Ansible
From 2b78a936f3ed924961731d607260383b65882f73 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Tue, 11 Feb 2014 22:11:12 -0800
Subject: [PATCH 013/942] add link to Numba
---
docs/scenarios/scientific.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/scenarios/scientific.rst b/docs/scenarios/scientific.rst
index 0d45807fa..e95506517 100644
--- a/docs/scenarios/scientific.rst
+++ b/docs/scenarios/scientific.rst
@@ -53,10 +53,11 @@ NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+.
Numba
-----
-Numba is an Numpy aware Python compiler (just-in-time (JIT) specializing
-compiler) which compiles annotated Python (and Numpy) code to LLVM (Low Level
-Virtual Machine) (through special decorators).
-Briefly, Numba using system that compiles Python code with LLVM to code which
+
+`Numba `_ is an Numpy aware Python compiler
+(just-in-time (JIT) specializing compiler) which compiles annotated Python (and
+Numpy) code to LLVM (Low Level Virtual Machine) (through special decorators).
+Briefly, Numba using system that compiles Python code with LLVM to code which
can be natively executed at runtime.
SciPy
From a8e7b57758fa296df206675283c5059d04f9a173 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Tue, 11 Feb 2014 22:19:21 -0800
Subject: [PATCH 014/942] update untangle link
---
docs/scenarios/xml.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst
index ee97e2d02..3e01b2fe6 100644
--- a/docs/scenarios/xml.rst
+++ b/docs/scenarios/xml.rst
@@ -4,8 +4,8 @@ XML parsing
untangle
--------
-`untangle `_ is a simple library which takes
-an XML document and returns a Python object which mirrors the nodes and
+`untangle `_ is a simple library which
+takes an XML document and returns a Python object which mirrors the nodes and
attributes in its structure.
For example, an XML file like this:
From 04718556af6597a2d6163e5f11eac1c3a4fe2d03 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Tue, 11 Feb 2014 22:28:38 -0800
Subject: [PATCH 015/942] update Ubuntu Python packaging docs link
---
docs/shipping/packaging.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst
index 6d4aa5b8f..d2757f049 100644
--- a/docs/shipping/packaging.rst
+++ b/docs/shipping/packaging.rst
@@ -99,12 +99,12 @@ One simple option for a personal PyPi server is to use Amazon S3. A prerequisite
6. **All done**
-* You can now your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage`
+* You can now install your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage`
For Linux Distributions
::::::::::::::::::::::::
-* `Ubuntu `_
+* `Ubuntu `_
* `Fedora `_
* `Debian `_
* `Arch `_
From 2f5ae1786e68013b4cb84b2b2d685d3c5321310d Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Wed, 12 Feb 2014 12:12:36 +0300
Subject: [PATCH 016/942] Update make files with versions from Sphinx 1.2
---
docs/Makefile | 53 +++++++++++++++++++++++++++++--
docs/make.bat | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 137 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile b/docs/Makefile
index d8dd1f433..5c60d189d 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -7,12 +7,19 @@ SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make ' where is one of"
@@ -27,14 +34,20 @@ help:
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
- -rm -rf $(BUILDDIR)/*
+ rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@@ -100,7 +113,13 @@ latex:
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
- make -C $(BUILDDIR)/latex all-pdf
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
@@ -113,6 +132,24 @@ man:
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@@ -128,3 +165,13 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
+
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/docs/make.bat b/docs/make.bat
index 39f2a6893..d77abb0c0 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -7,8 +7,10 @@ if "%SPHINXBUILD%" == "" (
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+ set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
@@ -28,7 +30,11 @@ if "%1" == "help" (
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. texinfo to make Texinfo files
+ echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
+ echo. xml to make Docutils-native XML files
+ echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
@@ -40,8 +46,23 @@ if "%1" == "clean" (
goto end
)
+
+%SPHINXBUILD% 2> nul
+if errorlevel 9009 (
+ echo.
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+ echo.installed, then set the SPHINXBUILD environment variable to point
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
+ echo.may add the Sphinx directory to PATH.
+ echo.
+ echo.If you don't have Sphinx installed, grab it from
+ echo.http://sphinx-doc.org/
+ exit /b 1
+)
+
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
@@ -49,6 +70,7 @@ if "%1" == "html" (
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
@@ -56,6 +78,7 @@ if "%1" == "dirhtml" (
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
@@ -63,6 +86,7 @@ if "%1" == "singlehtml" (
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
@@ -70,6 +94,7 @@ if "%1" == "pickle" (
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
@@ -77,6 +102,7 @@ if "%1" == "json" (
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
@@ -85,6 +111,7 @@ if "%1" == "htmlhelp" (
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
@@ -96,6 +123,7 @@ if "%1" == "qthelp" (
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
@@ -103,6 +131,7 @@ if "%1" == "devhelp" (
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
@@ -110,13 +139,35 @@ if "%1" == "epub" (
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
+if "%1" == "latexpdf" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ cd %BUILDDIR%/latex
+ make all-pdf
+ cd %BUILDDIR%/..
+ echo.
+ echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "latexpdfja" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ cd %BUILDDIR%/latex
+ make all-pdf-ja
+ cd %BUILDDIR%/..
+ echo.
+ echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+ goto end
+)
+
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
@@ -124,13 +175,31 @@ if "%1" == "text" (
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
+if "%1" == "texinfo" (
+ %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+ goto end
+)
+
+if "%1" == "gettext" (
+ %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+ goto end
+)
+
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
@@ -138,6 +207,7 @@ if "%1" == "changes" (
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
@@ -146,10 +216,27 @@ or in %BUILDDIR%/linkcheck/output.txt.
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
+if "%1" == "xml" (
+ %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The XML files are in %BUILDDIR%/xml.
+ goto end
+)
+
+if "%1" == "pseudoxml" (
+ %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
+ goto end
+)
+
:end
From ee36d451036b43501a3a76671e1dad6709ba2427 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Wed, 12 Feb 2014 12:18:28 +0300
Subject: [PATCH 017/942] Fix project name in generated files (osxpython ->
pythonguide)
---
docs/Makefile | 8 ++++----
docs/index.rst | 2 +-
docs/make.bat | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/Makefile b/docs/Makefile
index 5c60d189d..40b479e94 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -85,17 +85,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/osxpython.qhcp"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pythonguide.qhcp"
@echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/osxpython.qhc"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pythonguide.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/osxpython"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/osxpython"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/pythonguide"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pythonguide"
@echo "# devhelp"
epub:
diff --git a/docs/index.rst b/docs/index.rst
index 19e167222..1779f2f35 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,4 +1,4 @@
-.. osxpython documentation master file, created by
+.. pythonguide documentation master file, created by
sphinx-quickstart on Wed Aug 4 22:51:11 2010.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
diff --git a/docs/make.bat b/docs/make.bat
index d77abb0c0..c2cdfb647 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -115,9 +115,9 @@ if "%1" == "qthelp" (
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
- echo.^> qcollectiongenerator %BUILDDIR%\qthelp\osxpython.qhcp
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pythonguide.qhcp
echo.To view the help file:
- echo.^> assistant -collectionFile %BUILDDIR%\qthelp\osxpython.ghc
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pythonguide.ghc
goto end
)
From c0fc5c18f3819b33a9d05b1059fb062891adf41e Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Wed, 12 Feb 2014 13:17:29 +0300
Subject: [PATCH 018/942] make.bat: Try Sphinx installed in Python when
sphinx-build is not in PATH
---
docs/make.bat | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/docs/make.bat b/docs/make.bat
index c2cdfb647..b1533bc50 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -47,6 +47,14 @@ if "%1" == "clean" (
)
+REM Check if sphinx-build is available and fallback to Python version if any
+%SPHINXBUILD% 2> nul
+if errorlevel 9009 goto sphinx_python
+goto spinx_ok
+
+:sphinx_python
+
+set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
@@ -60,6 +68,9 @@ if errorlevel 9009 (
exit /b 1
)
+:sphinx_ok
+
+
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
From f9dc281c9d17c2139f599fd624d0d2edf7770f15 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Wed, 12 Feb 2014 13:41:55 +0300
Subject: [PATCH 019/942] Fix typo
---
docs/make.bat | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/make.bat b/docs/make.bat
index b1533bc50..115651a00 100644
--- a/docs/make.bat
+++ b/docs/make.bat
@@ -50,7 +50,7 @@ if "%1" == "clean" (
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 2> nul
if errorlevel 9009 goto sphinx_python
-goto spinx_ok
+goto sphinx_ok
:sphinx_python
From 78f2b9e6ad6d44e461efad22cc9053a87f23e198 Mon Sep 17 00:00:00 2001
From: Chen Liu
Date: Wed, 12 Feb 2014 09:03:21 -0800
Subject: [PATCH 020/942] expand "-" belongs to "Ansible"
---
docs/scenarios/admin.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index fd4645485..5fca65f94 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -177,7 +177,7 @@ A full terminal application like a widely extended top which is based on psutil
monitoring is `glance `_.
Ansible
-----
+-------
.. todo:: Write about Ansible
From 6d2d731a9d6c106c5788c01e6658e5062bc37c31 Mon Sep 17 00:00:00 2001
From: Andy Visser
Date: Wed, 12 Feb 2014 15:45:03 -0500
Subject: [PATCH 021/942] "where ever" => "wherever"
---
docs/starting/install/osx.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 0f95e73bf..cada3bb33 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -96,7 +96,7 @@ habit of using it to create completely clean Python environments for each
project. This is particularly important for Web development, where each
framework and application will have many dependencies.
-To set up a new Python environment, change the working directory to where ever
+To set up a new Python environment, change the working directory to wherever
you want to store the environment, and run the virtualenv utility in your
project's directory
From 29a3643ab485171cf4d3ede567628a4dbc91e9fd Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sat, 15 Feb 2014 13:08:42 +0100
Subject: [PATCH 022/942] Cython example added for strong typing
---
docs/scenarios/speed.rst | 118 +++++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 6aaa96bbd..af8f355bc 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -68,6 +68,124 @@ C Extensions
Cython
------
+With `Cython `_ you are able to write C and C++ modules for Python. It implements a superset of the Python language.
+With Cython you are also able to call C-functions and realize strong typing of variables and functions like float
+(floating point numbers) or int (integer) definition of variables. Here is an example of strong typing with Cython:
+
+.. code-block:: python
+
+ def primes(int kmax):
+ cdef int n, k, i
+ cdef int p[1000]
+ result = []
+ if kmax > 1000:
+ kmax = 1000
+ k = 0
+ n = 2
+ while k < kmax:
+ i = 0
+ while i < k and n % p[i] != 0:
+ i = i + 1
+ if i == k:
+ p[k] = n
+ k = k + 1
+ result.append(n)
+ n = n + 1
+ return result
+
+This implementation of an algorithm to find prime numbers has some additional commands instead of the next one, which is implemented in pure Python:
+
+.. code-block:: python
+
+ def primes( kmax):
+ p= range(1000)
+ result = []
+ if kmax > 1000:
+ kmax = 1000
+ k = 0
+ n = 2
+ while k < kmax:
+ i = 0
+ while i < k and n % p[i] != 0:
+ i = i + 1
+ if i == k:
+ p[k] = n
+ k = k + 1
+ result.append(n)
+ n = n + 1
+ return result
+
+
+The only difference between the both algorithm is this part:
+
+Strong typing with Cython:
+
+.. code-block:: python
+
+ #primes function with additional Cython code:
+ def primes(int kmax):
+ cdef int n, k, i
+ cdef int p[1000]
+ result = []
+
+
+Normal variable definition in Python:
+
+.. code-block:: python
+
+ #primes in standard Python syntax:
+ def primes( kmax):
+ p= range(1000)
+ result = []
+
+
+What is the difference? In the upper Cython version you can see the definitions of the variable types like in standard C.
+For example `cdef int n,k,i` in line 3. This additional type definition (e.g. integer) allows the Cython compiler to generate
+more efficient C code from this Cython code. While standard Python code is saved in `*.py` files, the Cython code is saved in `*.pyx` files.
+
+And what is with the speed? So lets try it!
+
+.. code-block:: python
+
+ import time
+ #activate pyx compiler
+ import pyximport; pyximport.install()
+ #primes implemented with Cython
+ import primesCy
+ #primes implemented with Python
+ import primes
+
+ print "Cython:"
+ t1= time.time()
+ print primesCy.primes(500)
+ t2= time.time()
+ print "Cython time: %s" %(t2-t1)
+ print ""
+ print "Python"
+ t1= time.time()
+ print primes.primes(500)
+ t2= time.time()
+ print "Python time: %s" %(t2-t1)
+
+
+Where is the magic? Here it is:
+
+.. code-block:: python
+
+ import pyximport; pyximport.install()
+
+
+With the module `pyximport` you are able to import Cython `*.pyx` files, in this case `primesCy.pyx`, with the Cython
+version of the primes function.
+The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
+which is automatically compiled to a `*.so` C-library. ... and Cython is able to import this library for you in your Python-code.
+Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 (!) prime numbers.
+
+Here is the output of an embedded `ARM beaglebone `_ machine:
+
+Cython time: 0.0196 seconds
+
+Python time: 0.3302 seconds
Pyrex
-----
From a30b491b5624a7be6f49352659ae18bc48c1c106 Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sat, 15 Feb 2014 17:58:40 +0100
Subject: [PATCH 023/942] indentation fixed
---
docs/scenarios/speed.rst | 84 ++++++++++++++++++++--------------------
1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index af8f355bc..505608630 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -74,46 +74,48 @@ With Cython you are also able to call C-functions and realize strong typing of v
.. code-block:: python
- def primes(int kmax):
- cdef int n, k, i
- cdef int p[1000]
- result = []
- if kmax > 1000:
- kmax = 1000
- k = 0
- n = 2
- while k < kmax:
- i = 0
- while i < k and n % p[i] != 0:
- i = i + 1
- if i == k:
- p[k] = n
- k = k + 1
- result.append(n)
- n = n + 1
- return result
+ def primes(int kmax):
+ cdef int n, k, i
+ cdef int p[1000]
+ result = []
+ if kmax > 1000:
+ kmax = 1000
+ k = 0
+ n = 2
+ while k < kmax:
+ i = 0
+ while i < k and n % p[i] != 0:
+ i = i + 1
+ if i == k:
+ p[k] = n
+ k = k + 1
+ result.append(n)
+ n = n + 1
+ return result
+
This implementation of an algorithm to find prime numbers has some additional commands instead of the next one, which is implemented in pure Python:
.. code-block:: python
- def primes( kmax):
- p= range(1000)
- result = []
- if kmax > 1000:
- kmax = 1000
- k = 0
- n = 2
- while k < kmax:
- i = 0
- while i < k and n % p[i] != 0:
- i = i + 1
- if i == k:
- p[k] = n
- k = k + 1
- result.append(n)
- n = n + 1
- return result
+ def primes( kmax):
+ p= range(1000)
+ result = []
+ if kmax > 1000:
+ kmax = 1000
+ k = 0
+ n = 2
+ while k < kmax:
+ i = 0
+ while i < k and n % p[i] != 0:
+ i = i + 1
+ if i == k:
+ p[k] = n
+ k = k + 1
+ result.append(n)
+ n = n + 1
+ return result
+
The only difference between the both algorithm is this part:
@@ -124,10 +126,9 @@ Strong typing with Cython:
#primes function with additional Cython code:
def primes(int kmax):
- cdef int n, k, i
- cdef int p[1000]
- result = []
-
+ cdef int n, k, i
+ cdef int p[1000]
+ result = []
Normal variable definition in Python:
@@ -135,9 +136,8 @@ Normal variable definition in Python:
#primes in standard Python syntax:
def primes( kmax):
- p= range(1000)
- result = []
-
+ p= range(1000)
+ result = []
What is the difference? In the upper Cython version you can see the definitions of the variable types like in standard C.
For example `cdef int n,k,i` in line 3. This additional type definition (e.g. integer) allows the Cython compiler to generate
From 7ef55e755f8c8e714ade2f1ebbf21ebab585e7dd Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sat, 15 Feb 2014 18:38:43 +0100
Subject: [PATCH 024/942] minor changes (indentation fixed)
---
docs/scenarios/speed.rst | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 505608630..f8a37c907 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -124,8 +124,8 @@ Strong typing with Cython:
.. code-block:: python
- #primes function with additional Cython code:
- def primes(int kmax):
+ #primes function with additional Cython code:
+ def primes(int kmax):
cdef int n, k, i
cdef int p[1000]
result = []
@@ -135,7 +135,7 @@ Normal variable definition in Python:
.. code-block:: python
#primes in standard Python syntax:
- def primes( kmax):
+ def primes( kmax):
p= range(1000)
result = []
@@ -149,7 +149,8 @@ And what is with the speed? So lets try it!
import time
#activate pyx compiler
- import pyximport; pyximport.install()
+ import pyximport
+ pyximport.install()
#primes implemented with Cython
import primesCy
#primes implemented with Python
@@ -172,14 +173,15 @@ Where is the magic? Here it is:
.. code-block:: python
- import pyximport; pyximport.install()
+ import pyximport
+ pyximport.install()
With the module `pyximport` you are able to import Cython `*.pyx` files, in this case `primesCy.pyx`, with the Cython
version of the primes function.
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
which is automatically compiled to a `*.so` C-library. ... and Cython is able to import this library for you in your Python-code.
-Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 (!) prime numbers.
+Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
Here is the output of an embedded `ARM beaglebone `_ machine:
From d30830009a5df0c10019ced46f036478dcdc5807 Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sat, 15 Feb 2014 19:33:00 +0100
Subject: [PATCH 025/942] Cython: additional benchmark for standard CPU
---
docs/scenarios/speed.rst | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index f8a37c907..7a2ef88c4 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -183,7 +183,13 @@ The `pyximport.install()` command allows the Python interpreter to start the Cyt
which is automatically compiled to a `*.so` C-library. ... and Cython is able to import this library for you in your Python-code.
Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
-Here is the output of an embedded `ARM beaglebone `_ machine:
+On a standard notebook (dualcore AMD E-450 1,6 GHz) the measured values are:
+
+Cython time: 0.0054 seconds
+
+Python time: 0.0566 seconds
+
+And here the output of an embedded `ARM beaglebone `_ machine:
Cython time: 0.0196 seconds
From 33b428b8a5c352f9c6d902c352f3d477bb1f7bf2 Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sun, 16 Feb 2014 17:50:07 +0100
Subject: [PATCH 026/942] misspelling in description
---
docs/scenarios/speed.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 7a2ef88c4..308d27c04 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -181,7 +181,7 @@ With the module `pyximport` you are able to import Cython `*.pyx` files, in this
version of the primes function.
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
which is automatically compiled to a `*.so` C-library. ... and Cython is able to import this library for you in your Python-code.
-Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
+Very easy and very efficient. With the `time.time()` function you are able to compare the time between these 2 different calls to find 500 prime numbers.
On a standard notebook (dualcore AMD E-450 1,6 GHz) the measured values are:
From 87ec12d320426076a23fe8886e5cba2205357623 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Gr=C3=B6ger?=
Date: Mon, 17 Feb 2014 20:52:21 +0100
Subject: [PATCH 027/942] Included tldrlegal.com
tl;drLegal is a great place to look up what a particular license is all about. The website can be found here: https://tldrlegal.com/
---
docs/writing/license.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/license.rst b/docs/writing/license.rst
index 6f0df77d2..1fbd09a8b 100644
--- a/docs/writing/license.rst
+++ b/docs/writing/license.rst
@@ -48,5 +48,5 @@ To help you choose one for your project, there's a `license chooser `_.
From c8bda6892f7802763bb36b2e2512505a06c4d158 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Gr=C3=B6ger?=
Date: Mon, 17 Feb 2014 21:03:36 +0100
Subject: [PATCH 028/942] Added oxford comma.
---
docs/writing/license.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/license.rst b/docs/writing/license.rst
index 1fbd09a8b..9dd7c86d2 100644
--- a/docs/writing/license.rst
+++ b/docs/writing/license.rst
@@ -48,5 +48,5 @@ To help you choose one for your project, there's a `license chooser `_.
+A good overview of licenses with explanations of what one can, cannot, and must do using a particular software can be found at `tl;drLegal `_.
From 1be68ba74976dba31230432f672108b26af2d2d5 Mon Sep 17 00:00:00 2001
From: Dhia Abbassi
Date: Wed, 19 Feb 2014 21:15:16 +0100
Subject: [PATCH 029/942] Update cli.rst
Added Cliff module description.
---
docs/scenarios/cli.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index 5af149e75..217d06fea 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -28,3 +28,10 @@ rather than written down by imperatively. It is targetting especially unsophisti
users, programmers, sys-admins, scientists and in general people writing throw-away
scripts for themselves, choosing the command-line interface because it is quick
and simple.
+
+Cliff
+------
+`Cliff `_ is a framework for building command line programs.
+It uses setuptools entry points to provide subcommands, output formatters, and other extensions. The framework
+is meant to be used to create multi-level commands such as subversion and git, where the main program handles
+some basic argument parsing and then invokes a sub-command to do the work.
From c46965911652c00b7368423c59ecc4ea3a71d53d Mon Sep 17 00:00:00 2001
From: Dhia Abbassi
Date: Thu, 20 Feb 2014 09:25:27 +0100
Subject: [PATCH 030/942] Update cli.rst
Blank line added after the title Cliff.
---
docs/scenarios/cli.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index 217d06fea..cee4872d0 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -31,6 +31,7 @@ and simple.
Cliff
------
+
`Cliff `_ is a framework for building command line programs.
It uses setuptools entry points to provide subcommands, output formatters, and other extensions. The framework
is meant to be used to create multi-level commands such as subversion and git, where the main program handles
From ca240c247921a47062d764f625c024d86b1c5b6f Mon Sep 17 00:00:00 2001
From: Jeff Hammerbacher
Date: Sat, 22 Feb 2014 18:59:01 -0500
Subject: [PATCH 031/942] "faster on tracks" => "back on track faster"
---
docs/writing/tests.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 4e8749161..05faace7b 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -40,7 +40,7 @@ Some general rules of testing:
- If you are in the middle of a development session and have to interrupt your work, it
is a good idea to write a broken unit test about what you want to develop next.
When coming back to work, you will have a pointer to where you were and get
- faster on tracks.
+ back on track faster.
- The first step when you are debugging your code is to write a new test
pinpointing the bug. While it is not always possible to do, those bug
From b8f99234165cd520cdda5f2e440b6066492fa772 Mon Sep 17 00:00:00 2001
From: tommy3001
Date: Sun, 23 Feb 2014 23:32:13 +0100
Subject: [PATCH 032/942] Improvements of description. Thanks to sigmavirus24
---
docs/scenarios/speed.rst | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 308d27c04..05130c841 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -69,12 +69,14 @@ Cython
------
With `Cython `_ you are able to write C and C++ modules for Python. It implements a superset of the Python language.
-With Cython you are also able to call C-functions and realize strong typing of variables and functions like float
-(floating point numbers) or int (integer) definition of variables. Here is an example of strong typing with Cython:
+You are also able to call C-functions and realize declaration of variables and functions like in C. Here is an example:
.. code-block:: python
def primes(int kmax):
+ """Calculation of prime numbers with additional
+ Cython keywords"""
+
cdef int n, k, i
cdef int p[1000]
result = []
@@ -94,11 +96,14 @@ With Cython you are also able to call C-functions and realize strong typing of v
return result
-This implementation of an algorithm to find prime numbers has some additional commands instead of the next one, which is implemented in pure Python:
+This implementation of an algorithm to find prime numbers has some additional keywords instead of the next one, which is implemented in pure Python:
.. code-block:: python
- def primes( kmax):
+
+ def primes(kmax):
+ """Calculation of prime numbers in standard Python syntax"""
+
p= range(1000)
result = []
if kmax > 1000:
@@ -120,28 +125,30 @@ This implementation of an algorithm to find prime numbers has some additional co
The only difference between the both algorithm is this part:
-Strong typing with Cython:
.. code-block:: python
- #primes function with additional Cython code:
def primes(int kmax):
+ """Calculation of prime numbers with additional
+ Cython keywords"""
+
cdef int n, k, i
cdef int p[1000]
result = []
-Normal variable definition in Python:
.. code-block:: python
- #primes in standard Python syntax:
- def primes( kmax):
+ def primes(kmax):
+ """Calculation of prime numbers in standard Python syntax"""
+
p= range(1000)
result = []
-What is the difference? In the upper Cython version you can see the definitions of the variable types like in standard C.
-For example `cdef int n,k,i` in line 3. This additional type definition (e.g. integer) allows the Cython compiler to generate
-more efficient C code from this Cython code. While standard Python code is saved in `*.py` files, the Cython code is saved in `*.pyx` files.
+What is the difference? In the upper Cython version you can see the declaration of the variable types and the integer array
+in a similar way like in standard C. For example `cdef int n,k,i` in line 3. This additional type declaration (e.g. integer)
+allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in `*.py` files,
+Cython code is saved in `*.pyx` files.
And what is with the speed? So lets try it!
@@ -169,7 +176,7 @@ And what is with the speed? So lets try it!
print "Python time: %s" %(t2-t1)
-Where is the magic? Here it is:
+These both lines need a remark:
.. code-block:: python
@@ -177,11 +184,10 @@ Where is the magic? Here it is:
pyximport.install()
-With the module `pyximport` you are able to import Cython `*.pyx` files, in this case `primesCy.pyx`, with the Cython
-version of the primes function.
+The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) with the Cython-compiled version of the `primes` function.
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
-which is automatically compiled to a `*.so` C-library. ... and Cython is able to import this library for you in your Python-code.
-Very easy and very efficient. With the `time.time()` function you are able to compare the time between these 2 different calls to find 500 prime numbers.
+which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
+Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
On a standard notebook (dualcore AMD E-450 1,6 GHz) the measured values are:
From 8330e78359976140bea06ea3fde9425505d5c7c8 Mon Sep 17 00:00:00 2001
From: eet6646
Date: Sun, 23 Feb 2014 22:24:12 -0400
Subject: [PATCH 033/942] Issue #361 - Link to PDF
---
docs/_templates/sidebarintro.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 58c71b058..096524c6a 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -31,4 +31,5 @@ Useful Links
The Guide Website
The Guide @ GitHub
Issue Tracker
+ PDF Download
From d28d2f546c78cb6dc0b5d37579579cb30c5f3293 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Mon, 24 Feb 2014 10:02:18 +0200
Subject: [PATCH 034/942] Anguish languish per comments
---
docs/_templates/sidebarintro.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 4f2c8fc1c..13eba1830 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -20,10 +20,10 @@ Donate
Contributors
- This work is a result of collaboration of
+ This guide is the result of the collaboration of
135+ people
- around the world, and your contribution
- is welcome too.
+ around the world, and your contributions
+ !
From 153fd15095ce504ac228b21431ea9f90e205dee9 Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Mon, 24 Feb 2014 14:49:30 +0200
Subject: [PATCH 035/942] missing >
---
docs/_templates/sidebarintro.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 13eba1830..92ef7b18a 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -23,7 +23,7 @@ Contributors
This guide is the result of the collaboration of
135+ people
around the world, and your contributions
- !
+ are welcome!
From a2da09a6c594ce0ee4de9643ad0fdfa199a1588c Mon Sep 17 00:00:00 2001
From: eet6646
Date: Mon, 24 Feb 2014 15:07:24 -0400
Subject: [PATCH 036/942] Wording fix
---
docs/_templates/sidebarintro.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 096524c6a..a8c525a0e 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -31,5 +31,5 @@ Useful Links
The Guide Website
The Guide @ GitHub
Issue Tracker
- PDF Download
+ The Guide as a PDF
From 6edbe902661be39b961a44ef4d6f60dc499f4c8d Mon Sep 17 00:00:00 2001
From: "Leonardo.Z"
Date: Mon, 3 Mar 2014 14:17:51 +0800
Subject: [PATCH 037/942] Add a new documentation tool: MkDocs
MkDocs is a new and popular documentation tool written in Python. It's supported by ReadTheDoc.org.
---
docs/writing/documentation.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index 7793af4bb..fc9cea518 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -162,3 +162,8 @@ Epydoc_
Epydoc is discontinued. Use :ref:`sphinx-ref` instead.
.. _Epydoc: http://epydoc.sourceforge.net
+
+MkDocs_
+ MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation with Markdown.
+
+.. _MkDocs: http://www.mkdocs.org/
From f52704926c6728892d5ea66133d1e77060b55b6a Mon Sep 17 00:00:00 2001
From: Ian Cordasco
Date: Mon, 3 Mar 2014 06:49:26 -0600
Subject: [PATCH 038/942] Keep it neutral
---
docs/writing/documentation.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index fc9cea518..3f4d0b937 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -164,6 +164,7 @@ Epydoc_
.. _Epydoc: http://epydoc.sourceforge.net
MkDocs_
- MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation with Markdown.
+ MkDocs is a fast and simple static site generator that's geared towards
+ building project documentation with Markdown.
.. _MkDocs: http://www.mkdocs.org/
From 2d6521e3e46a63e6a602b287a07814d31ee63850 Mon Sep 17 00:00:00 2001
From: Ian Cordasco
Date: Wed, 5 Mar 2014 19:52:13 -0600
Subject: [PATCH 039/942] Make this one sentence simpler
---
docs/starting/install/osx.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index cada3bb33..69b74446f 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -96,9 +96,9 @@ habit of using it to create completely clean Python environments for each
project. This is particularly important for Web development, where each
framework and application will have many dependencies.
-To set up a new Python environment, change the working directory to wherever
-you want to store the environment, and run the virtualenv utility in your
-project's directory
+To set up a new Python environment, move into the directory where you would
+like to store the environment, and use the ``virtualenv`` utility to create
+the new environment.
.. code-block:: console
From 456660cd3c96fce1c5104fb7effe861d6562aeef Mon Sep 17 00:00:00 2001
From: Ian Cordasco
Date: Wed, 5 Mar 2014 19:57:12 -0600
Subject: [PATCH 040/942] Last bit of unhandled PR review from #370
---
docs/scenarios/speed.rst | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 05130c841..0219cf3a8 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -68,8 +68,11 @@ C Extensions
Cython
------
-With `Cython `_ you are able to write C and C++ modules for Python. It implements a superset of the Python language.
-You are also able to call C-functions and realize declaration of variables and functions like in C. Here is an example:
+`Cython `_ implements a superset of the Python language
+with which you are able to write C and C++ modules for Python. Cython also
+allows you to call functions from compiled C libraries. Using Cython allows
+you to take advantage of Python's strong typing of variables and operations.
+Here is an example of strong typing with Cython:
.. code-block:: python
@@ -121,9 +124,8 @@ This implementation of an algorithm to find prime numbers has some additional ke
n = n + 1
return result
-
-
-The only difference between the both algorithm is this part:
+Notice that in the Cython version you declare integers and integer arrays for
+to be compiled into C types while also creating a Python list:
.. code-block:: python
From 100a4cb4228af1b7268f45906bdea0fe398e45b5 Mon Sep 17 00:00:00 2001
From: Can Ibanoglu
Date: Thu, 6 Mar 2014 16:56:22 +0200
Subject: [PATCH 041/942] Created a new section for virtualenv and pip
---
docs/starting/install/osx.rst | 44 ------------------------------
docs/starting/pip-virtualenv.rst | 46 ++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 44 deletions(-)
create mode 100644 docs/starting/pip-virtualenv.rst
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index b84eeb02f..0489636f9 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -118,50 +118,6 @@ copy your code out of it, and then delete the main directory for the environment
An useful set of extensions to virtualenv is available in virtualenvwrapper,
`RTFD `_ to find out more.
-
-A note about Pip and Virtualenv
--------------------------------
-
-By now it should be clear that using virtual environments is a great way to keep
-your development environment clean and keeping different projects' requirements
-separate.
-
-When you start working on many different projects, it can be hard to remember to
-activate the related virtual environment when you come back to a specific project.
-As a result of this, it is very easy to install packages globally while thinking
-that you are actually installing the package for the virtual environment of the
-project. Over time this can result in a messy global package list.
-
-In order to make sure that you install packages to your active virtual environment
-when you use ``pip install``, consider adding the following two lines to your
-``~/.bashrc`` file:
-
-.. code-block:: console
- export PIP_REQUIRE_VIRTUALENV=true
-
-After saving this change and sourcing the ``~/.bashrc`` file with ``source ~/.bashrc``,
-pip will no longer let you install packages if you are not in a virtual environment.
-If you try to use ``pip install`` outside of a virtual environment pip will
-gently remind you that an activated virtual environment is needed to install
-packages.
-
-.. code-block:: console
- $ pip install requests
- Could not find an activated virtualenv (required).
-
-You will of course need to install some packages globally and this can be accomplished
-by adding the following to your ``~/.bashrc`` file:
-
-.. code-block:: console
- gpip() {
- PIP_REQUIRE_VIRTUALENV="" pip "$@"
- }
-
-After saving the changes and sourcing your ``~/.bashrc`` file you can now install
-packages globally by running ``gpip install``. You can change the name of the
-function to anything you like, just keep in mind that you will have to use that
-name when trying install packages globally with pip.
-
--------------------------------
This page is a remixed version of `another guide `_,
diff --git a/docs/starting/pip-virtualenv.rst b/docs/starting/pip-virtualenv.rst
new file mode 100644
index 000000000..56e33cceb
--- /dev/null
+++ b/docs/starting/pip-virtualenv.rst
@@ -0,0 +1,46 @@
+.. _pip-virtualenv:
+
+Further Configuration of Pip and Virtualenv
+-------------------------------------------
+
+By now it should be clear that using virtual envirtonments is a great way to keep
+your development environment clean and keeping different projects' requirements
+separate.
+
+When you start working on many different projects, it can be hard to remember to
+activate the related virtual environment when you come back to a specific project.
+As a result of this, it is very easy to install packages globally while thinking
+that you are actually installing the package for the virtual environment of the
+project. Over time this can result in a messy global package list.
+
+In order to make sure that you install packages to your active virtual environment
+when you use ``pip install``, consider adding the following two lines to your
+``~/.bashrc`` file:
+
+.. code-block:: console
+ export PIP_REQUIRE_VIRTUALENV=true
+
+After saving this change and sourcing the ``~/.bashrc`` file with ``source ~/.bashrc``,
+pip will no longer let you install packages if you are not in a virtual environment.
+If you try to use ``pip install`` outside of a virtual environment pip will gently
+remind you that an activated virtual environment is needed to install packages.
+
+.. code-block:: console
+ $ pip install requests
+ Could not find an activated virtualenv (required).
+
+You will of course need to install some packages globally (usually ones that you
+use across different projects consistenly) and this can be accomplished by adding
+the following to your ``~/.bashrc`` file:
+
+.. code-block:: console
+ gpip() {
+ PIP_REQUIRE_VIRTUALENV="" pip "$@"
+ }
+
+After saving the changes and sourcing your ``~/.bashrc`` file you can now install
+packages globally by running ``gpip install``. You can change the name of the
+function to anything you like, just keep in mind that you will have to use that
+name when trying to install packages globally with pip.
+
+-----------------------------------------------------------
From f26e5e6c666d8f60c42230c3dfc31618b54a1e90 Mon Sep 17 00:00:00 2001
From: David Beitey
Date: Tue, 11 Mar 2014 10:18:54 +1000
Subject: [PATCH 042/942] Add details about uWSGI as WSGI server
---
docs/scenarios/web.rst | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index d2178f10e..d43ff0ee6 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -156,6 +156,25 @@ setup for Nginx + Gunicorn can be found in the
.. _uwsgi-ref:
+uWSGI
+-----
+
+`uWSGI `_ is a full stack for building
+hosting services. In addition to process management, process monitoring,
+and other functionality, uWSGI acts as an application server for various
+programming languages and protocols - including Python and WSGI. uWSGI can
+either be run as a stand-alone web router, or be run behind a full web
+server (such as Nginx or Apache). In the latter case, a web server can
+configure uWSGI and an application's operation over the
+`uwsgi `_
+protocol. uWSGI's web server support allows for dynamically configuring
+Python, passing environment variables and further tuning. For full details,
+see `uWSGI magic
+variables `_.
+
+
+.. _server-best-practices-ref:
+
Server Best Practices
:::::::::::::::::::::
From 0506020a7ff1a8fb320977ab803effc6d30e94fa Mon Sep 17 00:00:00 2001
From: Nelson Chen
Date: Thu, 13 Mar 2014 15:50:29 -0700
Subject: [PATCH 043/942] Update tests.rst
s/has names/have names/
---
docs/writing/tests.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 05faace7b..62e4ac7d0 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -50,7 +50,7 @@ Some general rules of testing:
slightly different than that of running code, where short names are often
preferred. The reason is testing functions are never called explicitly.
``square()`` or even ``sqr()`` is ok in running code, but in testing code you
- would has names such as ``test_square_of_number_2()``,
+ would have names such as ``test_square_of_number_2()``,
``test_square_negative_number()``. These function names are displayed when a
test fail, and should be as descriptive as possible.
From 2f9fc823da8868b4c4aa152147eb80fc6abeb628 Mon Sep 17 00:00:00 2001
From: Can Ibanoglu
Date: Sat, 15 Mar 2014 11:48:55 +0200
Subject: [PATCH 044/942] Deleted the horizontal line, took back the messed up
commits
---
docs/starting/pip-virtualenv.rst | 44 +++++++++++++++++++++++++++++---
1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/docs/starting/pip-virtualenv.rst b/docs/starting/pip-virtualenv.rst
index 56e33cceb..c76623510 100644
--- a/docs/starting/pip-virtualenv.rst
+++ b/docs/starting/pip-virtualenv.rst
@@ -1,7 +1,10 @@
.. _pip-virtualenv:
Further Configuration of Pip and Virtualenv
--------------------------------------------
+===========================================
+
+Requiring an active virtual environment for ``pip``
+---------------------------------------------------
By now it should be clear that using virtual envirtonments is a great way to keep
your development environment clean and keeping different projects' requirements
@@ -18,6 +21,7 @@ when you use ``pip install``, consider adding the following two lines to your
``~/.bashrc`` file:
.. code-block:: console
+
export PIP_REQUIRE_VIRTUALENV=true
After saving this change and sourcing the ``~/.bashrc`` file with ``source ~/.bashrc``,
@@ -26,14 +30,50 @@ If you try to use ``pip install`` outside of a virtual environment pip will gent
remind you that an activated virtual environment is needed to install packages.
.. code-block:: console
+
$ pip install requests
Could not find an activated virtualenv (required).
+You can also do this configuration by editing your ``pip.conf`` or ``pip.ini``
+file. ``pip.conf`` is used by Unix and Mac OS X operating systems and it can be
+found at:
+
+.. code-block:: console
+
+ $HOME/.pip/pip.conf
+
+Similarly, the ``pip.ini`` file is used by Windows operating systems and it can
+be found at:
+
+.. code-block:: console
+
+ %HOME%\pip\pip.ini
+
+If you don't have a ``pip.conf`` or ``pip.ini`` file at these locations, you can
+create a new file with the correct name for your operating system.
+
+If you already have a configuration file, just add the following line under the
+``[global]`` settings to require an active virtual environment:
+
+.. code-block:: console
+
+ require-virtualenv = true
+
+If you did not have a configuration file, you will need to create a new one and
+add the following lines to this new file:
+
+.. code-block:: console
+
+ [global]
+ require-virtualenv = true
+
+
You will of course need to install some packages globally (usually ones that you
use across different projects consistenly) and this can be accomplished by adding
the following to your ``~/.bashrc`` file:
.. code-block:: console
+
gpip() {
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}
@@ -42,5 +82,3 @@ After saving the changes and sourcing your ``~/.bashrc`` file you can now instal
packages globally by running ``gpip install``. You can change the name of the
function to anything you like, just keep in mind that you will have to use that
name when trying to install packages globally with pip.
-
------------------------------------------------------------
From f579b1d92262b8be5f50dfb01dea0260bd6d91aa Mon Sep 17 00:00:00 2001
From: Ian Cordasco
Date: Sat, 15 Mar 2014 16:22:18 -0500
Subject: [PATCH 045/942] Add note about mock in Python 3.3
Closes #170
---
docs/writing/tests.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 62e4ac7d0..6e742d1c4 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -251,7 +251,8 @@ the need to change any other code.
mock
----
-mock is a library for testing in Python.
+mock is a library for testing in Python. Starting with Python 3.3, it is
+available in the standard library. For older versions of python, simply:
.. code-block:: console
From eec36320ebb961079a21e9e63d1984a7215f9427 Mon Sep 17 00:00:00 2001
From: Ian Cordasco
Date: Sat, 15 Mar 2014 18:12:50 -0500
Subject: [PATCH 046/942] Add link to stdlib mock
---
docs/writing/tests.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 6e742d1c4..cb863c0c2 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -252,7 +252,8 @@ mock
----
mock is a library for testing in Python. Starting with Python 3.3, it is
-available in the standard library. For older versions of python, simply:
+available in the `standard library
Date: Wed, 19 Mar 2014 23:02:37 +0100
Subject: [PATCH 047/942] Reset list 'a'
The result of the previous block containing the map example left 'a' to be [6, 7, 8], so resetting 'a' back to [3, 4, 5] seems to keep the example in line with the other ones.
---
docs/writing/style.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/writing/style.rst b/docs/writing/style.rst
index 262d73471..cba3586be 100644
--- a/docs/writing/style.rst
+++ b/docs/writing/style.rst
@@ -543,6 +543,7 @@ Use :py:func:`enumerate` keep a count of your place in the list.
.. code-block:: python
+ a = [3, 4, 5]
for i, item in enumerate(a):
print i, item
# prints
From 338180f12565338396b78eb6a7ead4058f23a69b Mon Sep 17 00:00:00 2001
From: eno93
Date: Thu, 20 Mar 2014 11:16:11 +1100
Subject: [PATCH 048/942] Move TK to top and sort the rest alphabetically
Makes more sense to be alpha sorted; except for Tkinter which is included with python.
I gather the original order was random and not meant to be preferential?
---
docs/scenarios/gui.rst | 103 ++++++++++++++++++++---------------------
1 file changed, 51 insertions(+), 52 deletions(-)
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index d85a83663..a9fc0d32b 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -2,44 +2,37 @@ GUI Applications
================
-Qt
+Tk
--
-`Qt `_ is a cross-platform application framework that is widely used for developing
-software with a GUI but can also be used for non-GUI applications.
+Tkinter is a thin object-oriented layer on top of Tcl/Tk. **It has the advantage
+of being included with the Python standard library, making it the most
+convenient and compatible toolkit to program with.**
-PySide
-~~~~~~
-PySide is a Python binding of the cross-platform GUI toolkit Qt.
+Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
+and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
+feel on all platforms.
-http://developer.qt.nokia.com/wiki/PySideDownloads/
+There's a good multi-language Tk tutorial with Python examples at
+`TkDocs `_. There's more information
+available on the `Python Wiki `_.
-PyQt
-~~~~
-.. note:: If your software does not fully comply with the GPL you will need a commercial license!
+Camelot
+-------
+`Camelot `_ provides components for building
+business applications on top of Python, SQLAlchemy and Qt. It is inspired by
+the Django admin interface.
-http://www.riverbankcomputing.co.uk/software/pyqt/download
+You can use Camelot to develop both simple and complex business applications
+at warp speed.
+
+The main resource for information is the website:
+http://www.python-camelot.com
+and the mailinglist https://groups.google.com/forum/#!forum/project-camelot
Cocoa
-----
.. note:: The Cocoa framework is only available on Mac OSX. Don't pick this if you're writing a cross-platform application!
-PyObjC
-~~~~~~
-.. note:: Only available on Mac OSX. Don't pick this if you're writing a cross-platform application.
-
-wxPython
---------
-wxPython is a GUI toolkit for the Python programming language. It allows
-Python programmers to create programs with a robust, highly functional
-graphical user interface, simply and easily. It is implemented as a Python
-extension module (native code) that wraps the popular wxWidgets cross platform
-GUI library, which is written in C++.
-
-Install (Stable)
-~~~~~~~~~~~~~~~~
-*Go to http://www.wxpython.org/download.php#stable and download the appropriate
-package for your OS.*
-
GTk
---
PyGTK provides Python bindings for the GTK+ toolkit. Like the GTK+ library
@@ -48,20 +41,6 @@ PyGTK only currently supports the Gtk-2.X API (NOT Gtk-3.0). It is currently
recommended that PyGTK not be used for new projects and existing applications
be ported from PyGTK to PyGObject.
-Tk
---
-Tkinter is a thin object-oriented layer on top of Tcl/Tk. It has the advantage
-of being included with the Python standard library, making it the most
-convenient and compatible toolkit to program with.
-
-Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
-and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
-feel on all platforms.
-
-There's a good multi-language Tk tutorial with Python examples at
-`TkDocs `_. There's more information
-available on the `Python Wiki `_.
-
Kivy
----
`Kivy `_ is a Python library for development of multi-touch
@@ -77,6 +56,22 @@ on all major platforms (Linux, OSX, Windows, Android).
The main resource for information is the website: http://kivy.org
+PyObjC
+~~~~~~
+.. note:: Only available on Mac OSX. Don't pick this if you're writing a cross-platform application.
+
+PySide
+~~~~~~
+PySide is a Python binding of the cross-platform GUI toolkit Qt.
+
+http://developer.qt.nokia.com/wiki/PySideDownloads/
+
+PyQt
+~~~~
+.. note:: If your software does not fully comply with the GPL you will need a commercial license!
+
+http://www.riverbankcomputing.co.uk/software/pyqt/download
+
PyjamasDesktop (pyjs Desktop)
-----------------------------
PyjamasDesktop is a port of PyJamas. PyjamasDesktop is application widget set
@@ -88,15 +83,19 @@ source code to be executed as a standalone desktop application.
The main website; `pyjs Desktop `_.
-Camelot
--------
-`Camelot `_ provides components for building
-business applications on top of Python, SQLAlchemy and Qt. It is inspired by
-the Django admin interface.
+Qt
+--
+`Qt `_ is a cross-platform application framework that is widely used for developing
+software with a GUI but can also be used for non-GUI applications.
-You can use Camelot to develop both simple and complex business applications
-at warp speed.
+wxPython
+--------
+wxPython is a GUI toolkit for the Python programming language. It allows
+Python programmers to create programs with a robust, highly functional
+graphical user interface, simply and easily. It is implemented as a Python
+extension module (native code) that wraps the popular wxWidgets cross platform
+GUI library, which is written in C++.
-The main resource for information is the website:
-http://www.python-camelot.com
-and the mailinglist https://groups.google.com/forum/#!forum/project-camelot
+**Install (Stable) wxPython**
+*go to http://www.wxpython.org/download.php#stable and download the appropriate
+package for your OS.*
From c59f329e362ebd40c8953d35b85e01179c1ff70d Mon Sep 17 00:00:00 2001
From: eno93
Date: Thu, 20 Mar 2014 11:29:23 +1100
Subject: [PATCH 049/942] Update year to 2014
Update year
---
docs/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py
index f5effd924..92534d93d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -46,7 +46,7 @@
# General information about the project.
project = u'pythonguide'
-copyright = u'2013. A Kenneth Reitz Project. Creative Commons Share-Alike 3.0'
+copyright = u'2014. A Kenneth Reitz Project. Creative Commons Share-Alike 3.0'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
From 77d1199451ee19c028e2e8c73d4571bd2b009f72 Mon Sep 17 00:00:00 2001
From: eno93
Date: Fri, 21 Mar 2014 08:05:03 +1100
Subject: [PATCH 050/942] as suggested
so long as it is consistant.
---
docs/scenarios/gui.rst | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index a9fc0d32b..2bde51920 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -1,20 +1,7 @@
GUI Applications
================
-
-Tk
---
-Tkinter is a thin object-oriented layer on top of Tcl/Tk. **It has the advantage
-of being included with the Python standard library, making it the most
-convenient and compatible toolkit to program with.**
-
-Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
-and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
-feel on all platforms.
-
-There's a good multi-language Tk tutorial with Python examples at
-`TkDocs `_. There's more information
-available on the `Python Wiki `_.
+Alphabetical list of GUI Applications.
Camelot
-------
@@ -88,6 +75,20 @@ Qt
`Qt `_ is a cross-platform application framework that is widely used for developing
software with a GUI but can also be used for non-GUI applications.
+Tk
+--
+Tkinter is a thin object-oriented layer on top of Tcl/Tk. **It has the advantage
+of being included with the Python standard library, making it the most
+convenient and compatible toolkit to program with.**
+
+Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
+and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
+feel on all platforms.
+
+There's a good multi-language Tk tutorial with Python examples at
+`TkDocs `_. There's more information
+available on the `Python Wiki `_.
+
wxPython
--------
wxPython is a GUI toolkit for the Python programming language. It allows
From 97701f1a9c3cd2f812ea98aac390baa85ba9d0cf Mon Sep 17 00:00:00 2001
From: Can Ibanoglu
Date: Fri, 21 Mar 2014 00:59:27 +0200
Subject: [PATCH 051/942] Added instructions to set up pip for caching packages
---
docs/starting/pip-virtualenv.rst | 44 ++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/docs/starting/pip-virtualenv.rst b/docs/starting/pip-virtualenv.rst
index c76623510..5c9515fa2 100644
--- a/docs/starting/pip-virtualenv.rst
+++ b/docs/starting/pip-virtualenv.rst
@@ -82,3 +82,47 @@ After saving the changes and sourcing your ``~/.bashrc`` file you can now instal
packages globally by running ``gpip install``. You can change the name of the
function to anything you like, just keep in mind that you will have to use that
name when trying to install packages globally with pip.
+
+Caching packages for future use
+-------------------------------
+
+Every developer has preferred libraries and when you are working on a lot of
+different projects, you are bound to have some overlap between the libraries that
+you use. For example, you may be using the ``requests`` library in a lot of different
+projects.
+
+It is surely unnecessary to re-download the same packages/libraries each time you
+start working on a new project (and in a new virtual environmen as a result).
+Fortunately, you can configure pip in such a way that it tries to reuse already
+installed packages.
+
+On UNIX systems, you can add the following line to your ``.bashrc`` or ``.bash_profile``
+file.
+
+.. code-block:: console
+
+ export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
+
+Naturally, you can set the path to anywhere you like (as long as you have write
+access). After adding this line, ``source`` your ``.bashrc`` (or ``.bash_profile``)
+file and you will be all set.
+
+Another way of doing the same configuration is via the ``pip.conf`` or ``pip.ini``
+files, depending on your system. If you are on Windows, you can add the following
+line to your ``pip.ini`` file under ``[global]`` settings:
+
+.. code-block:: console
+
+ download-cache = %HOME%\pip\cache
+
+Similarly, on UNIX systems you should simply add the following line to your
+``pip.conf`` file under ``[global]`` settings:
+
+.. code-block:: console
+
+ download-cache = $HOME/.pip/cache
+
+Even though you can use any path you like to store your cache, it is recommended
+that you create a new folder *in* the folder where your ``pip.conf`` or ``pip.ini``
+file lives. If you don't trust yourself with all of this path voodoo, just use
+the values provided here and you will be fine.
From 78d5318b01f2933d447dcf503d3ae2708155af09 Mon Sep 17 00:00:00 2001
From: Can Ibanoglu
Date: Fri, 21 Mar 2014 16:06:25 +0200
Subject: [PATCH 052/942] Removed the word 'naturally'
---
docs/starting/pip-virtualenv.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/pip-virtualenv.rst b/docs/starting/pip-virtualenv.rst
index 5c9515fa2..a910ae75f 100644
--- a/docs/starting/pip-virtualenv.rst
+++ b/docs/starting/pip-virtualenv.rst
@@ -103,7 +103,7 @@ file.
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
-Naturally, you can set the path to anywhere you like (as long as you have write
+You can set the path to anywhere you like (as long as you have write
access). After adding this line, ``source`` your ``.bashrc`` (or ``.bash_profile``)
file and you will be all set.
From 7cb0d7b7db26b05cd5c3e0218903c95e9b54d57b Mon Sep 17 00:00:00 2001
From: Carol Willing
Date: Sun, 23 Mar 2014 13:13:44 -0700
Subject: [PATCH 053/942] Clarified Python version suitable for development.
Removed reference to Lion to be more generic OS X.
---
docs/starting/install/osx.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 0f95e73bf..2ed026165 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -11,9 +11,10 @@ described in the next section before you start building Python applications
for real-world use. In particular, you should always install Distribute, as it
makes it much easier for you to use other third-party Python libraries.
-The version of Python that ships with OS X is great for learning, but it's not
-good for development. It's slightly out of date, and Apple has made significant
-changes that can cause hidden bugs.
+The version of Python that ships with OS X is great for learning. Yet, it's not
+good for development. The version shipped with OS X may be out of date from the
+`official current Python release `_,
+which is considered the stable production version.
Doing it Right
--------------
@@ -31,7 +32,7 @@ package.
In combination, the software can cause issues that are difficult to
diagnose.
-While Lion comes with a large number of UNIX utilities, those familiar with
+While OS X comes with a large number of UNIX utilities, those familiar with
Linux systems will notice one key component missing: a decent package manager.
`Homebrew `_ fills this void.
From 36ff47d9f9ff8d2abd8059c6eac7c666e8065f44 Mon Sep 17 00:00:00 2001
From: Carol Willing
Date: Sun, 23 Mar 2014 13:58:03 -0700
Subject: [PATCH 054/942] Created top level how to contribute doc as suggested
in Issue: 263
---
CONTRIBUTING.md | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..98580a3b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,15 @@
+How to contribute
+-----------------
+
+This guide is under heavy development. If you would like to contribute, please
+see:
+
+http://docs.python-guide.org/en/latest/notes/contribute/
+
+
+Style Guide
+-----------
+
+For all contributions, please follow the `Guide Stye Guide`:
+
+http://docs.python-guide.org/en/latest/notes/styleguide/
\ No newline at end of file
From 2d69455a2a03942b204f063f641abe7f762b17ac Mon Sep 17 00:00:00 2001
From: Artem Pyanykh
Date: Tue, 25 Mar 2014 12:54:21 +0400
Subject: [PATCH 055/942] Replace all references to Distribute with Setuptools.
Distribute was merged back into setuptools and discontinued.
---
docs/shipping/freezing.rst | 4 ++--
docs/starting/install/linux.rst | 16 ++++++++--------
docs/starting/install/osx.rst | 17 +++++++++--------
docs/starting/install/win.rst | 2 +-
docs/starting/installation.rst | 4 ++--
5 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst
index 2722c1250..f7b31042d 100644
--- a/docs/shipping/freezing.rst
+++ b/docs/shipping/freezing.rst
@@ -46,7 +46,7 @@ Windows
bbFreeze
~~~~~~~~
-Prerequisite is to install :ref:`Python, Distribute and pywin32 dependency on Windows `.
+Prerequisite is to install :ref:`Python, Setuptools and pywin32 dependency on Windows `.
.. todo:: Write steps for most basic .exe
@@ -79,7 +79,7 @@ Prerequisite is to install :ref:`Python on Windows `.
PyInstaller
~~~~~~~~~~~
-Prerequisite is to have installed :ref:`Python, Distribute and pywin32 dependency on Windows `.
+Prerequisite is to have installed :ref:`Python, Setuptools and pywin32 dependency on Windows `.
- `Most basic tutorial `_
- `Manual `_
diff --git a/docs/starting/install/linux.rst b/docs/starting/install/linux.rst
index 1fd04cba4..b2216aeea 100644
--- a/docs/starting/install/linux.rst
+++ b/docs/starting/install/linux.rst
@@ -18,21 +18,21 @@ side-by-side with the system's Python 2.4 installation.
You do not need to install or configure anything else to use Python. Having
said that, I would strongly recommend that you install the tools and libraries
described in the next section before you start building Python applications
-for real-world use. In particular, you should always install Distribute, as
+for real-world use. In particular, you should always install Setuptools, as
it makes it much easier for you to use other third-party Python libraries.
-Distribute & Pip
+Setuptools & Pip
----------------
-The most crucial third-party Python software of all is Distribute, which
+The most crucial third-party Python software of all is Setuptools, which
extends the packaging and installation facilities provided by the distutils
-in the standard library. Once you add Distribute to your Python system you can
+in the standard library. Once you add Setuptools to your Python system you can
download and install any compliant Python software product with a single
command. It also enables you to add this network installation capability to
your own Python software with very little work.
-To obtain the latest version of Distribute for Linux, run the python script
-available here: `python-distribute `_
+To obtain the latest version of Setuptools for Linux, refer to the documentation
+available here: `unix-setuptools `_
The new``easy_install`` command you have available is considered by many to be
deprecated, so we will install its replacement: **pip**. Pip allows for
@@ -48,7 +48,7 @@ To install pip, simply open a command prompt and run
Virtualenv
----------
-After Distribute & Pip, the next development tool that you should install is
+After Setuptools & Pip, the next development tool that you should install is
`virtualenv `_. Use pip
.. code-block:: console
@@ -68,7 +68,7 @@ project's directory
.. code-block:: console
- $ virtualenv --distribute venv
+ $ virtualenv venv
To use an environment, run ``source venv/bin/activate``. Your command prompt
will change to show the active environment. Once you have finished working in
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index e33cfd07e..082f7fbf3 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -8,7 +8,7 @@ The latest version of Mac OS X, Mavericks, **comes with Python 2.7 out of the bo
You do not need to install or configure anything else to use Python. Having
said that, I would strongly recommend that you install the tools and libraries
described in the next section before you start building Python applications
-for real-world use. In particular, you should always install Distribute, as it
+for real-world use. In particular, you should always install Setuptools, as it
makes it much easier for you to use other third-party Python libraries.
The version of Python that ships with OS X is great for learning, but it's not
@@ -64,25 +64,26 @@ new Python scripts directory to your ``PATH``
export PATH=/usr/local/share/python:$PATH
-Distribute & Pip
+Setuptools & Pip
----------------
-The most crucial third-party Python software of all is Distribute, which
+The most crucial third-party Python software of all is Setuptools, which
extends the packaging and installation facilities provided by the distutils
-in the standard library. Once you add Distribute to your Python system you can
+in the standard library. Once you add Setuptools to your Python system you can
download and install any compliant Python software product with a single
command. It also enables you to add this network installation capability to
your own Python software with very little work. Homebrew already installed
-Distribute for you.
+Setuptools for you.
Happily, when you ran `brew install python`, Homebrew also installed **pip**.
-Pip allows for uninstallation of packages, and is actively maintained.
+Pip allows for installation and uninstallation of packages, and is actively
+maintained.
Virtualenv
----------
-After Distribute & Pip, the next development tool that you should install is
+After Setuptools & Pip, the next development tool that you should install is
`virtualenv `_. Use pip
.. code-block:: console
@@ -102,7 +103,7 @@ the new environment.
.. code-block:: console
- $ virtualenv --distribute venv
+ $ virtualenv venv
To use an environment, run ``source venv/bin/activate``. Your command prompt
will change to show the active environment. Once you have finished working in
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index b71b882ea..871e77b42 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -65,7 +65,7 @@ To install pip, run the python script available here:
Virtualenv
----------
-After Distribute & Pip, the next development tool that you should install is
+After Setuptools & Pip, the next development tool that you should install is
`virtualenv `_. Use pip
.. code-block:: console
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 669817270..91de5a963 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -7,14 +7,14 @@ If so, you do not need to install or configure anything else to use Python.
Having said that, I would strongly recommend that you install the tools and
libraries described in the guides below before you start building Python
applications for real-world use. In particular, you should always install
-Distribute, Pip, and Virtualenv — they make it much easier for you to use
+Setuptools, Pip, and Virtualenv — they make it much easier for you to use
other third-party Python libraries.
Installation Guides
-------------------
These guides go over the proper installation of :ref:`Python 2.7 `
- for development purposes, as well as distribute, pip, and virtualenv setup.
+ for development purposes, as well as setuptools, pip, and virtualenv setup.
- :ref:`Mac OS X `.
- :ref:`Microsoft Windows`.
From 2abd312b1435c4b2adb563f903084b9353f36e8f Mon Sep 17 00:00:00 2001
From: Al Sweigart
Date: Tue, 25 Mar 2014 15:05:41 -0700
Subject: [PATCH 056/942] Add two free beginner's books to the list
---
docs/intro/learning.rst | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index bd2ca6d7d..a8ae73e23 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -21,6 +21,26 @@ excellent resource for learning all aspects of the language.
`Python for You and Me `_
+Invent Your Own Computer Games with Python
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This beginner's book is for those with no programming experience at all. Each
+chapter has the source code to a small game, using these example programs
+to demonstrate programming concepts to give the reader an idea of what
+programs "look like".
+
+ `Invent Your Own Computer Games with Python `_
+
+
+Hacking Secret Ciphers with Python
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This book teaches Python programming and basic cryptography for absolute
+beginners. The chapters provide the source code for various ciphres, as well
+as programs that can break them.
+
+ `Hacking Secret Ciphers with Python `_
+
Learn Python the Hard Way
~~~~~~~~~~~~~~~~~~~~~~~~~
From c06fca111e6b23fdb4a24a8344e671c0630cf9a3 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Thu, 27 Mar 2014 14:25:43 -0400
Subject: [PATCH 057/942] Readme.rst: Minor edits
---
Readme.rst | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/Readme.rst b/Readme.rst
index a789e7fee..db1c02f79 100644
--- a/Readme.rst
+++ b/Readme.rst
@@ -16,17 +16,17 @@ basis.
Topics include:
-- Platform/version specific installations
+- Platform- and version-specific installations
- Py2app, Py2exe, bbfreeze, pyInstaller
-- Pip / virtualenv
-- Documentation. Writing it.
-- server configurations / tools for various web frameworks
+- pip & virtualenv
- fabric
-- exhaustive module recommendations, grouped by topic/purpose
-- Testing. Jenkins + tox guides.
-- How to interface w/ hg from git easily
-- what libraries to use for what
-
-If you are not fond of reading reStructuredText, there is an
+- Exhaustive module recommendations, grouped by topic/purpose
+- Which libraries to use for what
+- Server configurations & tools for various web frameworks
+- Documentation: writing it
+- Testing: Jenkins & tox guides
+- How to easily interface ``hg`` from ``git`` easily
+
+If you aren't fond of reading reStructuredText, there is an
almost up-to-date `HTML version at docs.python-guide.org
`_.
From 1b4fc887ea6c0c6836e6770559f0d433bff50bf6 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Thu, 27 Mar 2014 14:45:29 -0400
Subject: [PATCH 058/942] dev/env.rst: Markup
---
docs/dev/env.rst | 54 ++++++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 8739a3630..1e7d3fe5e 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -16,7 +16,7 @@ Vim is a text editor which uses keyboard shortcuts for editing instead of menus
or icons. There exist a couple of plugins and settings for the VIM editor to
aid Python development. If you only develop in Python, a good start is to set
the default settings for indentation and line-wrapping to values compliant with
-:pep:`8`. In your home directory, open a file called `.vimrc` and add the
+:pep:`8`. In your home directory, open a file called ``.vimrc`` and add the
following lines::
set textwidth=79 " lines longer than 79 columns will be broken
@@ -42,11 +42,11 @@ If your VIM is compiled with `+python` you can also utilize some very handy
plugins to do these checks from within the editor.
For PEP8 checking, install the vim-pep8_ plugin, and for pyflakes you can
-install vim-pyflakes_. Now you can map the functions `Pep8()` or `Pyflakes()`
+install vim-pyflakes_. Now you can map the functions ``Pep8()`` or ``Pyflakes()``
to any hotkey or action you want in Vim. Both plugins will display errors at
the bottom of the screen, and provide an easy way to jump to the corresponding
line. It's very handy to call these functions whenever you save a file. In
-order to do this, add the following lines to your `vimrc`::
+order to do this, add the following lines to your ``.vimrc``::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
@@ -67,12 +67,12 @@ Python-mode
Python-mode_ is a complex solution in VIM for working with Python code.
It has:
-- Asynchronous Python code checking (pylint, pyflakes, pep8, mccabe) in any combination
+- Asynchronous Python code checking (``pylint``, ``pyflakes``, ``pep8``, ``mccabe``) in any combination
- Code refactoring and autocompletion with Rope
- Fast Python folding
- Virtualenv support
- Search by Python documentation and run Python code
-- Auto PEP8 error fixes
+- Auto PEP8_ error fixes
And more.
@@ -105,10 +105,10 @@ already an Emacs user is `Python Programming in Emacs`_ at EmacsWiki.
TextMate
--------
-"`TextMate `_ brings Apple's approach to operating
-systems into the world of text editors. By bridging UNIX underpinnings and GUI,
-TextMate cherry-picks the best of both worlds to the benefit of expert
-scripters and novice users alike."
+ `TextMate `_ brings Apple's approach to operating
+ systems into the world of text editors. By bridging UNIX underpinnings and GUI,
+ TextMate cherry-picks the best of both worlds to the benefit of expert
+ scripters and novice users alike.
Sublime Text
------------
@@ -189,18 +189,22 @@ virtualenv
Virtualenv is a tool to keep the dependencies required by different projects
in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
-dilemma and keeps your global site-packages directory clean and manageable.
+dilemma, and keeps your global ``site-packages`` directory clean and manageable.
`virtualenv `_ creates
a folder which contains all the necessary executables to contain the
packages that a Python project would need. An example workflow is given.
-Install virtualenv::
+Install virtualenv:
+
+.. code-block:: console
$ pip install virtualenv
-Create a virtual environment for a project::
+Create a virtual environment for a project:
+
+.. code-block:: console
$ cd my_project
$ virtualenv venv
@@ -211,7 +215,9 @@ library which you can use to install other packages. The name of the
virtual environment (in this case, it was ``venv``) can be anything;
omitting the name will place the files in the current directory instead.
-To start using the virtual environment, run::
+To start using the virtual environment, run:
+
+.. code-block:: console
$ source venv/bin/activate
@@ -219,8 +225,12 @@ To start using the virtual environment, run::
The name of the current virtual environment will now appear on the left
of the prompt (e.g. ``(venv)Your-Computer:your_project UserName$``) to
let you know that it's active. From now on, any package that you install
-using ``pip`` will be placed in the venv folder, isolated from the global
-Python installation. Install packages as usual::
+using ``pip`` will be placed in the ``venv`` folder, isolated from the global
+Python installation.
+
+Install packages as usual:
+
+.. code-block:: console
$ pip install requests
@@ -239,7 +249,7 @@ for keeping the package list clean in case it needs to be accessed later.
In order to keep your environment consistent, it's a good idea to "freeze"
the current state of the environment packages. To do this, run
-::
+.. code-block:: console
$ pip freeze > requirements.txt
@@ -249,7 +259,7 @@ versions. Later, when a different developer (or you, if you need to re-
create the environment) can install the same packages, with the same
versions by running
-::
+.. code-block:: console
$ pip install -r requirements.txt
@@ -265,14 +275,14 @@ virtualenvwrapper
`Virtualenvwrapper `_ makes
virtualenv a pleasure to use by wrapping the command line API with a nicer CLI.
-::
+.. code-block:: console
$ pip install virtualenvwrapper
-Put this into your `~/.bash_profile` (Linux/Mac) file:
+Put this into your ``~/.bash_profile`` (Linux/Mac) file:
-::
+.. code-block:: console
$ export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
@@ -312,7 +322,7 @@ most out of using Python interactively. Its main components are:
* Flexible, embeddable interpreters to load into your own projects.
* Tools for high level and interactive parallel computing.
-::
+.. code-block:: console
$ pip install ipython
@@ -333,7 +343,7 @@ Python interpreter for Unix-like operating systems. It has the following feature
* Auto-indentation.
* Python 3 support.
-::
+.. code-block:: console
$ pip install bpython
From 3050584ff394925670668b84641bb3145b9dd41d Mon Sep 17 00:00:00 2001
From: Zearin
Date: Thu, 27 Mar 2014 14:46:08 -0400
Subject: [PATCH 059/942] dev/env.rst: Minor edits
---
docs/dev/env.rst | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 1e7d3fe5e..4ca87b982 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -51,7 +51,7 @@ order to do this, add the following lines to your ``.vimrc``::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
-If you are already using syntastic_ you can enable it to run Pyflakes on write
+If you are already using syntastic_ you can enable it to run Pyflakes on write,
and show errors and warnings in the quickfix window. An example configuration
to do that which also shows status and warning messages in the statusbar would be::
@@ -143,7 +143,7 @@ The most popular Eclipse plugin for Python development is Aptana's
Komodo IDE
----------
`Komodo IDE `_ is developed by
-ActiveState and is a commercial IDE for Windows, Mac and Linux.
+ActiveState and is a commercial IDE for Windows, Mac, and Linux.
Spyder
@@ -234,9 +234,9 @@ Install packages as usual:
$ pip install requests
-To stop using an environment simply type ``deactivate``. To remove the
+To stop using an environment, simply type ``deactivate``. To remove the
environment, just remove the directory it was installed into. (In this
-case, it would be ``rm -rf venv``).
+case, it would be ``rm -rf venv``.)
Other Notes
^^^^^^^^^^^
From faa874d1840ff89020bf266ebb4450f89dea6983 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Thu, 27 Mar 2014 14:50:03 -0400
Subject: [PATCH 060/942] index.rst: Minor source tweak
Reads easier when viewing the source
---
docs/index.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/index.rst b/docs/index.rst
index 1779f2f35..3e34d33f0 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -8,7 +8,8 @@ The Hitchhiker's Guide to Python!
Welcome to The Hitchhiker's Guide to Python.
-**This guide is currently under heavy active development.** If you'd like to help, `fork us on GitHub `_!
+**This guide is currently under heavy active development.** If you'd like to help,
+`fork us on GitHub `_!
This *opinionated* guide exists to provide both novice and expert Python
developers a best-practice handbook to the installation, configuration, and
From 9d059acc5b557c93021120537f860d36b692280c Mon Sep 17 00:00:00 2001
From: Zearin
Date: Thu, 27 Mar 2014 14:53:38 -0400
Subject: [PATCH 061/942] intro/duction.rst: Minor edits (formatting)
---
docs/intro/duction.rst | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/docs/intro/duction.rst b/docs/intro/duction.rst
index 04cbceb94..23d9240f1 100644
--- a/docs/intro/duction.rst
+++ b/docs/intro/duction.rst
@@ -7,14 +7,14 @@ Python is a general-purpose, high-level programming language similar
to Tcl, Perl, Ruby, Scheme, or Java. Some of its main key features
include:
-* very clear, readable syntax
+* **very clear, readable syntax**
Python's philosophy focuses on readability, from code blocks
delineated with significant whitespace to intuitive keywords in
place of inscrutable punctuation
-* extensive standard libraries and third party modules for virtually
- any task
+* **extensive standard libraries and third party modules for virtually
+ any task**
Python is sometimes described with the words "batteries included"
for its extensive
@@ -30,7 +30,7 @@ include:
the `Django `_ web framework and the
`NumPy `_ set of math routines.
-* integration with other systems
+* **integration with other systems**
Python can integrate with `Java libraries `_,
enabling it to be used with the rich Java environment that corporate
@@ -38,13 +38,13 @@ include:
`extended by C or C++ modules `_
when speed is of the essence.
-* ubiquity on computers
+* **ubiquity on computers**
Python is available on Windows, \*nix, and Mac. It runs wherever the
Java virtual machine runs, and the reference implementation CPython
can help bring Python to wherever there is a working C compiler.
-* friendly community
+* **friendly community**
Python has a vibrant and large :ref:`community `
which maintains wikis, conferences, countless repositories,
@@ -77,10 +77,12 @@ For the Community
All contributions to the Guide are welcome, from Pythonistas of all levels.
If you think there's a gap in what the Guide covers, fork the Guide on
-GitHub and submit a pull request. Contributions are welcome from everyone,
-whether they're an old hand or a first-time Pythonista, and the authors to
-the Guide will gladly help if you have any questions about the
-appropriateness, completeness, or accuracy of a contribution.
+GitHub and submit a pull request.
+
+Contributions are welcome from everyone, whether they're an old hand or a
+first-time Pythonista, and the authors to the Guide will gladly help if you
+have any questions about the appropriateness, completeness, or accuracy of
+a contribution.
To get started working on The Hitchhiker's Guide, see the :doc:`/notes/contribute` page.
From 471f86b3a8e3e8d90447461c67f3aa9f06c52527 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Fri, 28 Mar 2014 13:06:49 -0400
Subject: [PATCH 062/942] =?UTF-8?q?styleguide.rst:=20Github=20=E2=96=B6?=
=?UTF-8?q?=EF=B8=8E=20GitHub?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/notes/styleguide.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst
index 46fbfdf7f..887a7bbf8 100644
--- a/docs/notes/styleguide.rst
+++ b/docs/notes/styleguide.rst
@@ -30,8 +30,8 @@ Strive to keep any contributions relevant to the :ref:`purpose of The Guide
* `Cite `_
references where needed.
* If a subject isn't directly relevant to Python, but useful in conjunction
- with Python (ex: Git, Github, Databases), reference by linking to useful
- resources and describe why it's useful to Python.
+ with Python (e.g. Git, GitHub, Databases), reference by linking to useful
+ resources, and describe why it's useful to Python.
* When in doubt, ask.
Headings
From 1e4b4a5460b0409f16e892e94f8d62414cfd9e9a Mon Sep 17 00:00:00 2001
From: Zearin
Date: Fri, 28 Mar 2014 13:26:24 -0400
Subject: [PATCH 063/942] =?UTF-8?q?docs/**:=20Specify=20language=20for=20c?=
=?UTF-8?q?ode-blocks=20(syntax=20highlighting!=20=20mmm=E2=80=A6)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/scenarios/admin.rst | 2 +-
docs/scenarios/db.rst | 4 ++--
docs/scenarios/imaging.rst | 2 +-
docs/scenarios/scrape.rst | 2 +-
docs/scenarios/speed.rst | 29 +++++++++++++++++------------
docs/shipping/freezing.rst | 6 +++++-
docs/starting/install/osx.rst | 4 +++-
docs/starting/install/win.rst | 6 +++++-
docs/writing/documentation.rst | 8 ++++++--
docs/writing/style.rst | 15 ++++++++++-----
docs/writing/tests.rst | 13 +++++++------
11 files changed, 58 insertions(+), 33 deletions(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 5fca65f94..26dc5e6a4 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -21,7 +21,7 @@ latter will ssh into each server, cd to our project directory, activate the
virtual environment, pull the newest codebase, and restart the application
server.
-::
+.. code-block:: python
from fabric.api import cd, env, prefix, run, task
diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst
index 787f0efe3..252d9d7b1 100644
--- a/docs/scenarios/db.rst
+++ b/docs/scenarios/db.rst
@@ -20,9 +20,9 @@ SQLAlchemy
Unlike many database libraries it not only provides an ORM layer but also a
generalized API for writing database-agnostic code without SQL.
-::
+.. code-block:: console
- pip install sqlalchemy
+ $ pip install sqlalchemy
Django ORM
----------
diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst
index fa718824f..4103c36e3 100644
--- a/docs/scenarios/imaging.rst
+++ b/docs/scenarios/imaging.rst
@@ -23,6 +23,6 @@ the instructions for your platform `here Carson Busses
$29.95
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 0219cf3a8..bee6769df 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -8,9 +8,9 @@ Using a slightly modified version of `David Beazleys`_ CPU bound test code
(added loop for multiple tests), you can see the difference between CPython
and PyPy's processing.
-::
+.. code-block:: console
- PyPy
+ # PyPy
$ ./pypy -V
Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:10)
[PyPy 1.7.0 with GCC 4.4.3]
@@ -21,9 +21,9 @@ and PyPy's processing.
0.0440690517426
0.0695300102234
-::
+.. code-block:: console
- CPython
+ # CPython
$ ./python -V
Python 2.7.1
$ ./python measure2.py
@@ -72,9 +72,10 @@ Cython
with which you are able to write C and C++ modules for Python. Cython also
allows you to call functions from compiled C libraries. Using Cython allows
you to take advantage of Python's strong typing of variables and operations.
-Here is an example of strong typing with Cython:
-.. code-block:: python
+Here's an example of strong typing with Cython:
+
+.. code-block:: cython
def primes(int kmax):
"""Calculation of prime numbers with additional
@@ -128,7 +129,7 @@ Notice that in the Cython version you declare integers and integer arrays for
to be compiled into C types while also creating a Python list:
-.. code-block:: python
+.. code-block:: cython
def primes(int kmax):
"""Calculation of prime numbers with additional
@@ -190,18 +191,22 @@ The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) w
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
+On a standard notebook (dual core AMD E-450 1.6 GHz), the measured values are:
+
+.. code-block:: console
+
+ Cython time: 0.0054 seconds
-On a standard notebook (dualcore AMD E-450 1,6 GHz) the measured values are:
+ Python time: 0.0566 seconds
-Cython time: 0.0054 seconds
-Python time: 0.0566 seconds
And here the output of an embedded `ARM beaglebone `_ machine:
+.. code-block:: console
-Cython time: 0.0196 seconds
+ Cython time: 0.0196 seconds
-Python time: 0.3302 seconds
+ Python time: 0.3302 seconds
Pyrex
-----
diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst
index 2722c1250..888127e99 100644
--- a/docs/shipping/freezing.rst
+++ b/docs/shipping/freezing.rst
@@ -59,6 +59,8 @@ Prerequisite is to install :ref:`Python on Windows `.
2. Write setup.py (`List of configuration options `_)::
+.. code-block:: python
+
from distutils.core import setup
import py2exe
@@ -70,7 +72,9 @@ Prerequisite is to install :ref:`Python on Windows `.
4. (Optionally) `one-file mode `_
-5. Generate `.exe` into `dist` directory::
+5. Generate ``.exe`` into ``dist`` directory:
+
+.. code-block:: console
$ python setup.py py2exe
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index ac05a0de9..163333795 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -53,7 +53,9 @@ line at the bottom of your ``~/.bashrc`` file
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
-Now, we can install Python 2.7: ::
+Now, we can install Python 2.7:
+
+.. code-block:: console
$ brew install python
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index b71b882ea..f21e2d573 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -25,9 +25,13 @@ tedious, so add the directories for your default Python version to the PATH.
Assuming that your Python installation is in ``C:\Python27\``, add this to your
PATH::
+.. code-block:: console
+
C:\Python27\;C:\Python27\Scripts\
-You can do this easily by running the following in ``powershell``::
+You can do this easily by running the following in ``powershell``:
+
+.. code-block:: console
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index 3f4d0b937..29de3e40c 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -100,7 +100,9 @@ code easier to understand. In Python, comments begin with a hash
.. _docstring-ref:
-In Python, *docstrings* describe modules, classes, and functions: ::
+In Python, *docstrings* describe modules, classes, and functions:
+
+.. code-block:: python
def square_and_rooter(x):
"""Returns the square root of self times self."""
@@ -130,7 +132,9 @@ Docstrings versus Block comments
These aren't interchangeable. For a function or class, the leading
comment block is a programmer's note. The docstring describes the
-operation of the function or class: ::
+*operation* of the function or class:
+
+.. code-block:: python
# This function slows down program execution for some reason.
def square_and_rooter(x):
diff --git a/docs/writing/style.rst b/docs/writing/style.rst
index cba3586be..165117f2c 100644
--- a/docs/writing/style.rst
+++ b/docs/writing/style.rst
@@ -336,7 +336,9 @@ Instead, use a list comprehension:
four_lists = [[] for __ in xrange(4)]
-A common idiom for creating strings is to use :py:meth:`str.join` on an empty string.::
+A common idiom for creating strings is to use :py:meth:`str.join` on an empty string.
+
+.. code-block:: python
letters = ['s', 'p', 'a', 'm']
word = ''.join(letters)
@@ -345,7 +347,9 @@ This will set the value of the variable *word* to 'spam'. This idiom can be appl
Sometimes we need to search through a collection of things. Let's look at two options: lists and dictionaries.
-Take the following code for example::
+Take the following code for example:
+
+.. code-block:: python
d = {'s': [], 'p': [], 'a': [], 'm': []}
l = ['s', 'p', 'a', 'm']
@@ -365,7 +369,7 @@ Zen of Python
Also known as :pep:`20`, the guiding principles for Python's design.
-::
+.. code-block:: pycon
>>> import this
The Zen of Python, by Tim Peters
@@ -406,14 +410,15 @@ exists a command-line program, `pep8 `_,
that can check your code for conformance. Install it by running the following
command in your Terminal:
-::
+
+.. code-block:: console
$ pip install pep8
Then run it on a file or series of files to get a report of any violations.
-::
+.. code-block:: console
$ pep8 optparse.py
optparse.py:69:11: E401 multiple imports on one line
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index cb863c0c2..b854bf02a 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -81,7 +81,7 @@ series of tools.
Creating testcases is accomplished by subclassing a TestCase base class
-::
+.. code-block:: python
import unittest
@@ -148,7 +148,7 @@ py.test is a no-boilerplate alternative to Python's standard unittest module.
Despite being a fully-featured and extensible test tool, it boasts a simple
syntax. Creating a test suite is as easy as writing a module with a couple of
-functions
+functions:
.. code-block:: python
@@ -251,9 +251,10 @@ the need to change any other code.
mock
----
-mock is a library for testing in Python. Starting with Python 3.3, it is
-available in the `standard library
Date: Sat, 29 Mar 2014 09:08:00 +0300
Subject: [PATCH 064/942] gui/camelot: Replace ads with warnings
---
docs/scenarios/gui.rst | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index 2bde51920..966ee7a15 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -5,16 +5,11 @@ Alphabetical list of GUI Applications.
Camelot
-------
-`Camelot `_ provides components for building
-business applications on top of Python, SQLAlchemy and Qt. It is inspired by
-the Django admin interface.
-
-You can use Camelot to develop both simple and complex business applications
-at warp speed.
+.. note:: If your software does not fully comply with the GPL you will need a commercial license!
-The main resource for information is the website:
-http://www.python-camelot.com
-and the mailinglist https://groups.google.com/forum/#!forum/project-camelot
+`Camelot `_ provides components for building
+applications on top of Python, SQLAlchemy and Qt. It is inspired by the
+Django admin interface.
Cocoa
-----
From ad0bba374ae6589484aaa65372c6351699034e08 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Mon, 31 Mar 2014 10:31:48 -0400
Subject: [PATCH 065/942] Readme.rst: put `pip` and `virtualenv` on separate
bullets
---
Readme.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Readme.rst b/Readme.rst
index db1c02f79..148216b08 100644
--- a/Readme.rst
+++ b/Readme.rst
@@ -18,7 +18,8 @@ Topics include:
- Platform- and version-specific installations
- Py2app, Py2exe, bbfreeze, pyInstaller
-- pip & virtualenv
+- pip
+- virtualenv
- fabric
- Exhaustive module recommendations, grouped by topic/purpose
- Which libraries to use for what
From caa7ac3f260e319aa426c7af4c1cf377f26eb63b Mon Sep 17 00:00:00 2001
From: Zearin
Date: Mon, 31 Mar 2014 10:33:46 -0400
Subject: [PATCH 066/942] dev/env.rst: Remove (body text) comma
---
docs/dev/env.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 4ca87b982..06570c632 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -51,7 +51,7 @@ order to do this, add the following lines to your ``.vimrc``::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
-If you are already using syntastic_ you can enable it to run Pyflakes on write,
+If you are already using syntastic_ you can enable it to run Pyflakes on write
and show errors and warnings in the quickfix window. An example configuration
to do that which also shows status and warning messages in the statusbar would be::
From 91ba68d9727c5010a5763639c9085ca051e46242 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Mon, 31 Mar 2014 10:35:36 -0400
Subject: [PATCH 067/942] =?UTF-8?q?dev/env.rst:=20Un-markup=20=E2=80=9Csit?=
=?UTF-8?q?e-packages=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/dev/env.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 06570c632..3610307aa 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -189,7 +189,7 @@ virtualenv
Virtualenv is a tool to keep the dependencies required by different projects
in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
-dilemma, and keeps your global ``site-packages`` directory clean and manageable.
+dilemma, and keeps your global site-packages directory clean and manageable.
`virtualenv `_ creates
a folder which contains all the necessary executables to contain the
From e9dbbb05db6e69dc3481464b223e7d7786e5cd1d Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Mon, 31 Mar 2014 17:36:29 +0300
Subject: [PATCH 068/942] Remove ads only
---
docs/scenarios/gui.rst | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index 966ee7a15..f69dcb69b 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -5,12 +5,14 @@ Alphabetical list of GUI Applications.
Camelot
-------
-.. note:: If your software does not fully comply with the GPL you will need a commercial license!
-
-`Camelot `_ provides components for building
-applications on top of Python, SQLAlchemy and Qt. It is inspired by the
-Django admin interface.
-
+`Camelot `_ provides components for building
+applications on top of Python, SQLAlchemy and Qt. It is inspired by
+the Django admin interface.
+
+The main resource for information is the website:
+http://www.python-camelot.com
+and the mailinglist https://groups.google.com/forum/#!forum/project-camelot
+
Cocoa
-----
.. note:: The Cocoa framework is only available on Mac OSX. Don't pick this if you're writing a cross-platform application!
From 03a6d1e9e77f8be21f65d461cd95ac130d1d607d Mon Sep 17 00:00:00 2001
From: anatoly techtonik
Date: Mon, 31 Mar 2014 17:38:05 +0300
Subject: [PATCH 069/942] Missing whitespace
---
docs/scenarios/gui.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index f69dcb69b..db578b93e 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -12,7 +12,7 @@ the Django admin interface.
The main resource for information is the website:
http://www.python-camelot.com
and the mailinglist https://groups.google.com/forum/#!forum/project-camelot
-
+
Cocoa
-----
.. note:: The Cocoa framework is only available on Mac OSX. Don't pick this if you're writing a cross-platform application!
From 7bfaf32312c1dbb81cb4095fb92c1d2118a0ea5c Mon Sep 17 00:00:00 2001
From: Zearin
Date: Mon, 31 Mar 2014 10:46:28 -0400
Subject: [PATCH 070/942] =?UTF-8?q?notes/styleguide.rst:=20Add=20comma=20a?=
=?UTF-8?q?fter=20=E2=80=9Ce.g.=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To any style-obsessed writers or editors reading this commit:
The comma (or lack of one) after “e.g.” or “i.e.” has always bugged me. I finally looked it up! Here’s what I found:
http://english.stackexchange.com/questions/16172/should-i-always-use-a-comma-after-e-g-or-i-e
---
docs/notes/styleguide.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst
index 887a7bbf8..366c1ae6c 100644
--- a/docs/notes/styleguide.rst
+++ b/docs/notes/styleguide.rst
@@ -30,7 +30,7 @@ Strive to keep any contributions relevant to the :ref:`purpose of The Guide
* `Cite `_
references where needed.
* If a subject isn't directly relevant to Python, but useful in conjunction
- with Python (e.g. Git, GitHub, Databases), reference by linking to useful
+ with Python (e.g., Git, GitHub, Databases), reference by linking to useful
resources, and describe why it's useful to Python.
* When in doubt, ask.
From fe8e11c8e9f1daca2ebc6929c7901900fa6bdd30 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Mon, 31 Mar 2014 10:48:12 -0400
Subject: [PATCH 071/942] =?UTF-8?q?writing/tests.rst:=20Unbold=20=E2=80=9C?=
=?UTF-8?q?``mock``=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/writing/tests.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index b854bf02a..e77160cff 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -251,7 +251,7 @@ the need to change any other code.
mock
----
-**``mock``** is a library for testing in Python. As of Python 3.3, it is
+``mock`` is a library for testing in Python. As of Python 3.3, it is
available in the `standard library
Date: Mon, 31 Mar 2014 10:51:30 -0400
Subject: [PATCH 072/942] =?UTF-8?q?Readme.rst:=20Capitalize=20=E2=80=9CPip?=
=?UTF-8?q?=E2=80=9D=20and=20=E2=80=9CVirtualenv=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Readme.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Readme.rst b/Readme.rst
index 148216b08..07106e2f0 100644
--- a/Readme.rst
+++ b/Readme.rst
@@ -18,8 +18,8 @@ Topics include:
- Platform- and version-specific installations
- Py2app, Py2exe, bbfreeze, pyInstaller
-- pip
-- virtualenv
+- Pip
+- Virtualenv
- fabric
- Exhaustive module recommendations, grouped by topic/purpose
- Which libraries to use for what
From f1ab69243a8e6145318a8d96b67c36bd51c34a81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Kolding-S=C3=B8rensen?=
Date: Wed, 2 Apr 2014 18:20:42 +0200
Subject: [PATCH 073/942] Fix code-block formatting
---
docs/starting/install/win.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index 4facc9832..d84084f77 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -23,7 +23,7 @@ which copy of Python is run.
Typing the full path name for a Python interpreter each time quickly gets
tedious, so add the directories for your default Python version to the PATH.
Assuming that your Python installation is in ``C:\Python27\``, add this to your
-PATH::
+PATH:
.. code-block:: console
From a3d07893f167f1a0c5613b7eec07ca14fdb1c10d Mon Sep 17 00:00:00 2001
From: vishal sodani
Date: Thu, 3 Apr 2014 09:23:01 +0530
Subject: [PATCH 074/942] Fix spelling and grammatical mistake
---
docs/intro/learning.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index a8ae73e23..6d671f1f2 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -36,7 +36,7 @@ Hacking Secret Ciphers with Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This book teaches Python programming and basic cryptography for absolute
-beginners. The chapters provide the source code for various ciphres, as well
+beginners. The chapters provide the source code for various ciphers, as well
as programs that can break them.
`Hacking Secret Ciphers with Python `_
@@ -64,7 +64,7 @@ Dive Into Python 3
Dive Into Python 3 is a good book for those ready to jump in to Python 3. It's
a good read if you are moving from Python 2 to 3 or if you already have some
-experience programming in another language.
+experience in programming in another language.
`Dive Into Python 3 `_
From 572a36867cbe2bcb742d1742a0cd1f1a7f2fd906 Mon Sep 17 00:00:00 2001
From: vishal sodani
Date: Thu, 3 Apr 2014 09:37:58 +0530
Subject: [PATCH 075/942] Fix typo - replace his with its
---
docs/scenarios/web.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index d43ff0ee6..2d2ab5171 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -93,7 +93,7 @@ Support can be found on its `mailing list `_ is a scalable, non-blocking web server and web application framework with
-a relative simple usage. Tornado is known for his high performance.
+a relative simple usage. Tornado is known for its high performance.
It was initially developed for `friendfeed `_ , a real time chat and blog system.
In the Jinja2 template engine example it is used to serve the rendered pages.
From fb90056e9c30cfb32f0473f7aac06e7b5ba1e73f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Kolding-S=C3=B8rensen?=
Date: Thu, 3 Apr 2014 12:10:21 +0200
Subject: [PATCH 076/942] Add book on algorithms and data structures
---
docs/intro/learning.rst | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index a8ae73e23..d480ac340 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -143,6 +143,15 @@ development, version control, and optimization/profiling.
`Expert Python Programming `_
+Problem Solving with Algorithms and Data Structures
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Problem Solving with Algorithms and Data Structures covers a range of data structures and
+algorithms. All concepts are illustrated with Python code along with interactive samples
+that can be run directly in the browser.
+
+ `Problem Solving with Algorithms and Data Structures
+ `_
+
The Python Tutorial
~~~~~~~~~~~~~~~~~~~~
From 0d4ea147c22ce103b69c698d6863f47e06f61ef8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Kolding-S=C3=B8rensen?=
Date: Thu, 3 Apr 2014 12:14:07 +0200
Subject: [PATCH 077/942] Move official tutorial to beginner section
---
docs/intro/learning.rst | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index d480ac340..ea9ab7a25 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -4,6 +4,16 @@ Learning Python
Beginner
--------
+The Python Tutorial
+~~~~~~~~~~~~~~~~~~~~
+
+This is the official tutorial, it covers all the basics, and offers a tour of the
+language and the standard library, recommended for those who need a quickstart
+guide to the language.
+
+ `The Python Tutorial `_
+
+
Learn Python Interactive Tutorial
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -152,14 +162,6 @@ that can be run directly in the browser.
`Problem Solving with Algorithms and Data Structures
`_
-The Python Tutorial
-~~~~~~~~~~~~~~~~~~~~
-
-This is the official tutorial, it covers all the basics, and offers a tour of the
-language and the standard library, recommended for those who need a quickstart
-guide to the language.
-
- `The Python Tutorial `_
For Engineers and Scientists
----------------------------
From 272d300cebd31bb7d4f0015f882cfa3556018c71 Mon Sep 17 00:00:00 2001
From: vishal sodani
Date: Thu, 3 Apr 2014 22:18:54 +0530
Subject: [PATCH 078/942] Reverse change to a line
---
docs/intro/learning.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 6d671f1f2..1cfc9f419 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -64,7 +64,7 @@ Dive Into Python 3
Dive Into Python 3 is a good book for those ready to jump in to Python 3. It's
a good read if you are moving from Python 2 to 3 or if you already have some
-experience in programming in another language.
+experience programming in another language.
`Dive Into Python 3 `_
From c19f279b93d2a3aeb1f818483f23e32944030736 Mon Sep 17 00:00:00 2001
From: vishal sodani
Date: Fri, 4 Apr 2014 11:43:39 +0530
Subject: [PATCH 079/942] Use plural
---
docs/intro/news.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/intro/news.rst b/docs/intro/news.rst
index 433f9078d..5ccf6dc57 100644
--- a/docs/intro/news.rst
+++ b/docs/intro/news.rst
@@ -20,7 +20,7 @@ Pycoder's Weekly
~~~~~~~~~~~~~~~~
Pycoder's Weekly is a free weekly Python newsletter for Python developers
-by Python developers (Project, Articles, News, and Jobs).
+by Python developers (Projects, Articles, News, and Jobs).
`Pycoder's Weekly `_
From 17ef7f9661878e950618845f48b3316fac24b312 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Kolding-S=C3=B8rensen?=
Date: Fri, 4 Apr 2014 08:31:05 +0200
Subject: [PATCH 080/942] Remove book on algorithms and data structures
---
docs/intro/learning.rst | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index ea9ab7a25..03ab77de0 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -153,15 +153,6 @@ development, version control, and optimization/profiling.
`Expert Python Programming `_
-Problem Solving with Algorithms and Data Structures
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Problem Solving with Algorithms and Data Structures covers a range of data structures and
-algorithms. All concepts are illustrated with Python code along with interactive samples
-that can be run directly in the browser.
-
- `Problem Solving with Algorithms and Data Structures
- `_
-
For Engineers and Scientists
----------------------------
From 1e7cb38e64aa5695b02982323e1d587deb8bc2fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Kolding-S=C3=B8rensen?=
Date: Sat, 5 Apr 2014 21:40:29 +0200
Subject: [PATCH 081/942] Add misc section and two books
---
docs/intro/learning.rst | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 4b2dd8b5b..9a1a3b411 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -174,6 +174,26 @@ emphasis on numerical methods and how to implement them in Python.
`Numerical Methods in Engineering with Python `_
+Miscellaneous topics
+--------------------
+
+Problem Solving with Algorithms and Data Structures
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Problem Solving with Algorithms and Data Structures covers a range of data structures and
+algorithms. All concepts are illustrated with Python code along with interactive samples
+that can be run directly in the browser.
+
+ `Problem Solving with Algorithms and Data Structures
+ `_
+
+Programming Collective Intelligence
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Programming Collective Intelligence introduces a wide array of basic machine learning and
+data mining methods. The exposition is not very mathematically formal, but rather focuses
+on explaining the underlying intuition and shows how to implement the algorithms in Python.
+
+ `Programming Collective Intelligence `_
+
References
----------
From cc7b19356ed7e2c3cd9ec60705d43fc7c43a88d3 Mon Sep 17 00:00:00 2001
From: Zearin
Date: Fri, 11 Apr 2014 11:26:37 -0400
Subject: [PATCH 082/942] Mark up files & directories
---
docs/dev/env.rst | 6 +++---
docs/dev/virtualenvs.rst | 13 ++++++------
docs/scenarios/admin.rst | 2 +-
docs/scenarios/ci.rst | 2 +-
docs/scenarios/speed.rst | 8 ++++----
docs/scenarios/web.rst | 8 ++++----
docs/shipping/freezing.rst | 4 ++--
docs/shipping/packaging.rst | 6 +++---
docs/starting/install/osx.rst | 2 +-
docs/starting/install/win.rst | 12 +++++------
docs/starting/pip-virtualenv.rst | 28 +++++++++++++-------------
docs/writing/documentation.rst | 12 +++++------
docs/writing/structure.rst | 34 ++++++++++++++++----------------
13 files changed, 69 insertions(+), 68 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 3610307aa..aa63fee4e 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -16,7 +16,7 @@ Vim is a text editor which uses keyboard shortcuts for editing instead of menus
or icons. There exist a couple of plugins and settings for the VIM editor to
aid Python development. If you only develop in Python, a good start is to set
the default settings for indentation and line-wrapping to values compliant with
-:pep:`8`. In your home directory, open a file called ``.vimrc`` and add the
+:pep:`8`. In your home directory, open a file called :file:`.vimrc` and add the
following lines::
set textwidth=79 " lines longer than 79 columns will be broken
@@ -46,7 +46,7 @@ install vim-pyflakes_. Now you can map the functions ``Pep8()`` or ``Pyflakes()`
to any hotkey or action you want in Vim. Both plugins will display errors at
the bottom of the screen, and provide an easy way to jump to the corresponding
line. It's very handy to call these functions whenever you save a file. In
-order to do this, add the following lines to your ``.vimrc``::
+order to do this, add the following lines to your :file:`.vimrc`::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
@@ -253,7 +253,7 @@ the current state of the environment packages. To do this, run
$ pip freeze > requirements.txt
-This will create a ``requirements.txt`` file, which contains a simple
+This will create a :file:`requirements.txt` file, which contains a simple
list of all the packages in the current environment, and their respective
versions. Later, when a different developer (or you, if you need to re-
create the environment) can install the same packages, with the same
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index cf2b285b9..3f07cfec8 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -30,7 +30,7 @@ Basic Usage
$ virtualenv venv
This creates a copy of Python in whichever directory you ran the command in,
-placing it in a folder named ``venv``.
+placing it in a folder named :file:`venv`.
2. To begin using the virtual environment, it needs to be activated:
@@ -94,7 +94,7 @@ Basic Usage
$ mkvirtualenv venv
-This creates the ``venv`` folder inside ``~/Envs``.
+This creates the :file:`venv` folder inside :file:`~/Envs`.
2. Work on a virtual environment:
@@ -105,6 +105,7 @@ This creates the ``venv`` folder inside ``~/Envs``.
**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.
@@ -128,19 +129,19 @@ Other useful commands
``cdvirtualenv``
Navigate into the directory of the currently activated virtual environment,
- so you can browse its ``site-packages``, for example.
+ so you can browse its :file:`site-packages`, for example.
``cdsitepackages``
- Like the above, but directly into ``site-packages`` directory.
+ Like the above, but directly into :file:`site-packages` directory.
``lssitepackages``
- Shows contents of ``site-packages`` directory.
+ Shows contents of :file:`site-packages` directory.
`Full list of virtualenvwrapper commands `_.
autoenv
-------
-When you ``cd`` into a directory containing a ``.env``, `autoenv `_
+When you ``cd`` into a directory containing a :file:`.env`, `autoenv `_
automagically activates the environment.
Install it on Mac OS X using ``brew``:
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 26dc5e6a4..85fd5b8f5 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -38,7 +38,7 @@ server.
run('git pull')
run('touch app.wsgi')
-With the previous code saved in a file named fabfile.py, we can check memory
+With the previous code saved in a file named :file:`fabfile.py`, we can check memory
usage with:
.. code-block:: console
diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst
index 962c6c866..7138893ec 100644
--- a/docs/scenarios/ci.rst
+++ b/docs/scenarios/ci.rst
@@ -60,7 +60,7 @@ Requests whether this particular changeset breaks the build or not. So if you ar
hosting your code on Github, travis-ci is a great and easy way to get started with
Continuous Integration.
-In order to get started, add a ``.travis.yml`` file to your repository with this
+In order to get started, add a :file:`.travis.yml` file to your repository with this
example content::
language: python
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index bee6769df..96065c200 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -150,8 +150,8 @@ to be compiled into C types while also creating a Python list:
What is the difference? In the upper Cython version you can see the declaration of the variable types and the integer array
in a similar way like in standard C. For example `cdef int n,k,i` in line 3. This additional type declaration (e.g. integer)
-allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in `*.py` files,
-Cython code is saved in `*.pyx` files.
+allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in :file:`*.py` files,
+Cython code is saved in :file:`*.pyx` files.
And what is with the speed? So lets try it!
@@ -187,9 +187,9 @@ These both lines need a remark:
pyximport.install()
-The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) with the Cython-compiled version of the `primes` function.
+The `pyximport` module allows you to import :file:`*.pyx` files (e.g., :file:`primesCy.pyx`) with the Cython-compiled version of the `primes` function.
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
-which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
+which is automatically compiled to a :file:`*.so` C-library. Cython is able to import this library for you in your Python-code.
Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
On a standard notebook (dual core AMD E-450 1.6 GHz), the measured values are:
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 2d2ab5171..8a15ae9f1 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -252,7 +252,7 @@ Gondor
`Gondor `_ is a PaaS specialized for deploying Django
and Pinax applications. Gondor supports Django versions 1.2 and 1.3 on
Python version 2.7, and can automatically configure your Django site if you
-use ``local_settings.py`` for site-specific configuration information.
+use :file:`local_settings.py` for site-specific configuration information.
Gondor has a guide on deploying `Django projects `_.
@@ -365,7 +365,7 @@ to use.
application.listen(PORT)
tornado.ioloop.IOLoop.instance().start()
-The `base.html` file can be used as base for all site pages which are for example implemented in the content block.
+The :file:`base.html` file can be used as base for all site pages which are for example implemented in the content block.
.. code-block:: html
@@ -389,8 +389,8 @@ The `base.html` file can be used as base for all site pages which are for exampl