From 0a045fdf78cf3da9f0791a62cacc8d971c979c2c Mon Sep 17 00:00:00 2001 From: Thomas Ballinger Date: Thu, 5 Jul 2012 14:25:25 -0400 Subject: [PATCH 1/5] Fix spelling in style guide --- docs/writing/style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 462ffba..697e18c 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -9,7 +9,7 @@ recognised fact that code is read much more often than it is written. One reason for Python code to be easily read and understood is its relatively complete set of Code Style guidelines and "Pythonic" idioms. -Moreover, when a veteran Python developer (a Pythonistas) point to some +Moreover, when a veteran Python developer (a Pythonista) point to some parts of a code and say it is not "Pythonic", it usually means that these lines of code do not follow the common guidelines and fail to express the intent in what is considered the best (hear: most readable) way. @@ -178,7 +178,7 @@ possibilities, because it grows the confidence that no hard-wall will be on the way. However, knowing how to use them and particularly when **not** to use them is the most important. -Like a Kungfu master, a pythonistas knows how to kill with a single finger, and +Like a Kungfu master, a Pythonista knows how to kill with a single finger, and never do it. We are all consenting adults From a8e36af3eac37f9a1c7ad8e933165641bac47dae Mon Sep 17 00:00:00 2001 From: Thomas Ballinger Date: Thu, 5 Jul 2012 14:47:47 -0400 Subject: [PATCH 2/5] fix grammar issues with style guide --- docs/writing/style.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 697e18c..5181b9a 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -128,7 +128,7 @@ called with each recipient as an argument: ``send('Hello', 'God', 'Mom', 'Cthulhu')``, and in the function body ``args`` will be equal to ``('God', 'Mom', 'Cthulhu')``. -However, this construct has some drawback and should be used with caution. If a +However, this construct has some drawbacks and should be used with caution. If a function receives a list of arguments of the same nature, it is often more clear to define it as a function of one argument, that argument being a list or any sequence. Here, if ``send`` has multiple recipients, it is better to define @@ -156,7 +156,7 @@ Python functions that are: * easy to read (the name and arguments need no explanations) -* easy to change (adding a new keyword argument do not break other parts of the +* easy to change (adding a new keyword argument does not break other parts of the code) Avoid the magical wand @@ -179,7 +179,7 @@ way. However, knowing how to use them and particularly when **not** to use them is the most important. Like a Kungfu master, a Pythonista knows how to kill with a single finger, and -never do it. +never to do it. We are all consenting adults ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 482e56c51ee69b27cc9d900eea7ec34ba4ec0221 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Mon, 16 Jul 2012 10:43:27 -0700 Subject: [PATCH 3/5] Add Mac OS X PIL installation instructions --- docs/scenarios/imaging.rst | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst index d1a4c0c..6a5c017 100644 --- a/docs/scenarios/imaging.rst +++ b/docs/scenarios/imaging.rst @@ -35,8 +35,22 @@ Ubuntu 11.04 Installing on Mac OS X ~~~~~~~~~~~~~~~~~~~~~~ -.. todo:: - Notes on installing on Mac OS X +PIP doesn't know about the Mac OS X Freetype paths. To rectify that: + +.. code-block:: bash + + $ ln -s /usr/X11/include/freetype2 /usr/local/include/ + $ ln -s /usr/X11/include/ft2build.h /usr/local/include/ + $ ln -s /usr/X11/lib/libfreetype.6.dylib /usr/local/lib/ + $ ln -s /usr/X11/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.dylib + +then: + +.. code-block:: bash + + $ brew install libjpeg + $ pip install PIL + Installing on Windows ~~~~~~~~~~~~~~~~~~~~~ From 33ab7535c27ae79bbb07372e214203f673fd2e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 25 Jul 2012 22:47:26 +0200 Subject: [PATCH 4/5] Add comparison table and py2exe notes on freezing topic --- docs/shipping/freezing.rst | 90 +++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 16 deletions(-) diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst index b6803af..fc46cdd 100644 --- a/docs/shipping/freezing.rst +++ b/docs/shipping/freezing.rst @@ -8,42 +8,100 @@ Many applications you use every day do this: - Dropbox - BitTorrent -- - +- ... .. todo:: Fill in "Freezing Your Code" stub -Windows -::::::: +Comparison +---------- + +Solutions and platforms/features supported: + +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== +Solution Windows Linux OS X Python 3 Licence One-file mode Zipfile import Eggs pkg_resources support +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== +bbFreeze yes yes yes no MIT no yes yes yes +py2exe yes no no no MIT yes yes no no +pyInstaller yes yes yes no GPL yes no yes no +cx_Freeze yes yes yes yes PSF no yes yes no +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== + +.. todo:: Add other solutions: py2app + +.. note:: + Freezing Python code on Linux into a Windows executable was only once + supported in PyInstaller, `but later dropped + `_. + +.. note:: + All solutions need MS Visual C++ dll to be installed on target machine. + Only Pyinstaller makes self-executable exe that bundles the dll when + passing ``--onefile`` to `Configure.py`. + +Windows +------- + +bbFreeze +~~~~~~~~ + +Prerequisite is to install :ref:`Python, Distribute and pywin32 dependency on Windows `. + +.. todo:: Write steps for most basic .exe + py2exe ------- +~~~~~~ +Prerequisite is to install :ref:`Python on Windows `. + +1. Download and install http://sourceforge.net/projects/py2exe/files/py2exe/ + +2. Write setup.py (`List of configuration options `_):: + + from distutils.core import setup + import py2exe + + setup( + windows=[{'script': 'foobar.py'}], + ) + +3. (Optionally) `include icon `_ + +4. (Optionally) `one-file mode `_ + +5. Generate `.exe` into `dist` directory:: + + $ python setup.py py2exe + +6. Provide the Microsoft Visual C runtime DLL. Two options: `globally install dll on target machine `_ or `distribute dll aloneside with .exe `_. + +PyInstaller +~~~~~~~~~~~ + +Prerequisite is to have installed :ref:`Python, Distribute and pywin32 dependency on Windows `. + +- `Most basic tutorial `_ +- `Manual `_ OSX -::: +--- py2app ------- - - - +~~~~~~ PyInstaller ------------ - - +~~~~~~~~~~~ Linux -::::: +----- bbFreeze --------- +~~~~~~~~ PyInstaller ------------ +~~~~~~~~~~~ From 291c0ff37ace2045a2b3b9d8eda9e05a8e157b0a Mon Sep 17 00:00:00 2001 From: Dan Crosta Date: Sat, 28 Jul 2012 13:28:37 -0400 Subject: [PATCH 5/5] make targets in docs/Makefile available at top level --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4c2b0cf..e702e78 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ -build: - cd docs && make html \ No newline at end of file +.PHONY: build +build: html + +# this pattern rule lets you run "make build" (or any other target +# in docs/Makefile) in this directory as though you were in docs/ +%: + cd docs && make $@