Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated build/install/release docs.

  • Loading branch information...
commit b927d645b64cc0fd2393ce3ed8f00c7c47fe4c1d 1 parent 5108100
Bernie Hackett behackett authored

Showing 3 changed files with 112 additions and 56 deletions. Show diff stats Hide diff stats

  1. +10 22 RELEASE.rst
  2. +92 28 doc/installation.rst
  3. +10 6 setup.py
32 RELEASE.rst
Source Rendered
@@ -4,10 +4,8 @@ Some notes on PyMongo releases
4 4 Versioning
5 5 ----------
6 6
7   -We shoot for a release every month or so - that will generally just
8   -increment the middle version number (e.g. 1.6.1 -> 1.7). We're
9   -getting to the point where a 2.0 release would be reasonable, though -
10   -a lot has changed since 1.0.
  7 +We shoot for a release every few months - that will generally just
  8 +increment the middle version number (e.g. 2.1.1 -> 2.2).
11 9
12 10 Minor releases are reserved for bug fixes (in general no new features
13 11 or deprecations) - they only happen in cases where there is a critical
@@ -15,23 +13,22 @@ bug in a recently released version, or when a release has no new
15 13 features or API changes.
16 14
17 15 In between releases we use a "+" version number to denote the version
18   -under development. So if we just released 1.6, then the current dev
19   -version would be 1.6+. When we make the next release (1.6.1 or 1.7) we
20   -replace all instances of 1.6+ in the docs with the new version number.
  16 +under development. So if we just released 2.1, then the current dev
  17 +version would be 2.1+. When we make the next release (2.1.1 or 2.2) we
  18 +replace all instances of 2.1+ in the docs with the new version number.
21 19
22 20 Deprecation
23 21 -----------
24 22
25   -Changes should be backwards compatible unless absolutely
26   -necessary. When making API changes the approach is generally to add a
27   -deprecation warning but keeping the existing API
28   -functional. Eventually (after at least ~4 releases) we can remove the
29   -old API.
  23 +Changes should be backwards compatible unless absolutely necessary. When making
  24 +API changes the approach is generally to add a deprecation warning but keeping
  25 +the existing API functional. Eventually (after at least ~4 releases) we can
  26 +remove the old API.
30 27
31 28 Doing a Release
32 29 ---------------
33 30
34   -1. Test release on Python 2.4-2.7 on Windows, Linux and OSX, with and without the C extension. Generally enough to just run the tests on 2.4 and 2.7 with and without the extension on a single platform, and then just test any version on the other platforms as a sanity check. `python setup.py test` will build the extension and test. `python tools/clean.py` will remove the extension, and then `nosetests` will run the tests without it. Can also run the doctests: `python setup.py doc -t`. For building extensions on Windows check section below.
  31 +1. Test release on Python 2.4-2.7 and 3.1-3.2 on Windows, Linux and OSX, with and without the C extension. Generally enough to just run the tests on 2.4, 2.7 and 3.2 with and without the extension on a single platform, and then just test any version on the other platforms as a sanity check. `python setup.py test` will build the extension and test. `python tools/clean.py` will remove the extension, and then `nosetests` will run the tests without it. Can also run the doctests: `python setup.py doc -t`. For building extensions on Windows check section below.
35 32
36 33 2. Add release notes to doc/changelog.rst. Generally just summarize/clarify the git log, but might add some more long form notes for big changes.
37 34
@@ -55,12 +52,3 @@ Doing a Release
55 52
56 53 12. Announce!
57 54
58   -Building extensions on Windows
59   -------------------------------
60   -Currently the default `python setup.py test` builds extensions on Windows 32 bit only. The default option requires Visual Studio (C++ Express) 2008 and works with Python 2.6 and 2.7. The tests can be run in Python 2.4 and 2.5 by installing MingW32 and running the appropriate command in step 3 below.
61   -
62   -1. On your Windows 32 bit machine install Microsoft Visual C++ 2008 Express Edition (or equivalent 2008 edition) in the default location. For Python 2.4 or 2.5 install MingW32 in it's default location.
63   -
64   -2. Ensure you have nose installed.
65   -
66   -3. Run `\path\to\Python2(6|7) setup.py test` or `\path\to\Python2(4|5) setup.py build -c mingw32 test` to build the C extensions and run pymongo tests.
120 doc/installation.rst
Source Rendered
@@ -21,7 +21,7 @@ to install pymongo on platforms other than Windows::
21 21
22 22 To get a specific version of pymongo::
23 23
24   - $ pip install pymongo==1.10.1
  24 + $ pip install pymongo==2.1.1
25 25
26 26 To upgrade using pip::
27 27
@@ -39,26 +39,46 @@ To upgrade do::
39 39
40 40 $ easy_install -U pymongo
41 41
42   -Mac OS Snow Leopard Issues
43   ---------------------------
  42 +Dependencies for installing C Extensions on Unix
  43 +------------------------------------------------
44 44
45   -By default OSX uses `/usr/bin/easy_install` for third party package installs.
46   -In OSX 10.6.x this script is hardcoded to use a version of setuptools that is
47   -older than the version required by PyMongo for python2.7 support. You can work
48   -around it like this::
  45 +10gen does not provide statically linked binary packages for Unix flavors
  46 +other than OSX. To build the optional C extensions you must have the GNU C
  47 +compiler (gcc) installed. Depending on your flavor of Unix (or Linux
  48 +distribution) you may also need a python development package that provides
  49 +the necessary header files for your version of Python. The package name may
  50 +vary from distro to distro.
49 51
50   - $ easy_install -U setuptools
51   - $ python -m easy_install pymongo
  52 +Debian and Ubuntu users should issue the following command::
52 53
53   -To upgrade do::
  54 + $ sudo apt-get install build-essential python-dev
  55 +
  56 +RedHat, CentOS, and Fedora users should issue the following command::
  57 +
  58 + $ sudo yum install gcc python-devel
  59 +
  60 +OSX
  61 +---
  62 +
  63 +10gen provides pre-built egg packages for Apple provided Python versions on
  64 +Snow Leopard (2.5, 2.6) and Lion (2.5, 2.6, 2.7). If you want to install
  65 +PyMongo for other Python versions you may have to install the following to
  66 +build the C extensions:
  67 +
  68 +**Snow Leopard** - Xcode 3 with 'UNIX Development Support'.
54 69
55   - $ python -m easy_install -U pymongo
  70 +**Lion** - As of the release of PyMongo 2.2 **Xcode 4.1** is required with
  71 +'UNIX Development Support'. See the following for more information:
  72 +
  73 +http://bugs.python.org/issue13590
  74 +
  75 +http://mail.python.org/pipermail/python-dev/2012-February/116210.html
56 76
57 77 **Snow Leopard Xcode 4 Users**: The Python versions shipped with OSX 10.6.x
58 78 are universal binaries. They support i386, PPC, and (in the case of python2.6)
59 79 x86_64. Since Xcode 4 removed support for PPC the distutils version shipped
60 80 with Apple's builds of Python will fail to build the C extensions if you have
61   -Xcode 4 installed. This issue may also affect some builds of Python downloaded
  81 +Xcode 4 installed. This issue may also affect builds of Python downloaded
62 82 from python.org. There is a workaround::
63 83
64 84 # For Apple-supplied Python2.6 (installed at /usr/bin/python2.6)
@@ -71,37 +91,53 @@ from python.org. There is a workaround::
71 91 See `http://bugs.python.org/issue11623 <http://bugs.python.org/issue11623>`_
72 92 for a more detailed explanation.
73 93
74   -Install from source
75   --------------------
  94 +Installing from source
  95 +----------------------
76 96
77 97 If you'd rather install directly from the source (i.e. to stay on the
78   -bleeding edge), check out the latest source from github and install
79   -the driver from the resulting tree::
  98 +bleeding edge), install the C extension dependencies then check out the
  99 +latest source from github and install the driver from the resulting tree::
80 100
81 101 $ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
82 102 $ cd pymongo/
83 103 $ python setup.py install
84 104
85   -Dependencies for installing C Extensions on Unix
86   -------------------------------------------------
87 105
88   -10gen does not currently provide statically linked binary packages for
89   -Unix flavors other than OSX. To build the optional C extensions you must
90   -have the GNU C compiler (gcc) installed. Depending on your flavor of Unix
91   -(or Linux distribution) you may also need a python development package that
92   -provides the necessary header files for your version of Python. The package
93   -name may vary from distro to distro. Here are some examples for popular
94   -Linux distributions:
  106 +Installing from source on Windows
  107 +.................................
  108 +
  109 +.. note::
  110 +
  111 + 10gen provides pre-built exe installers for 32-bit and 64-bit Windows. We
  112 + recommend that users install those packages (`available from pypi
  113 + <http://pypi.python.org/pypi/pymongo/>`_).
95 114
96   -- RHEL (Red Hat Enterprise Linux)/CentOS: python-devel
97   -- Debian/Ubuntu: python-dev
  115 +If you want to install PyMongo with C extensions from source the following
  116 +directions apply to both CPython and ActiveState's ActivePython:
98 117
99   -Pre-built eggs are available for OSX Snow Leopard on PyPI.
  118 +64-bit Windows
  119 +~~~~~~~~~~~~~~
  120 +
  121 +Install Visual Studio 2008. You must use the full version as Visual C++ 2008
  122 +Express does not provide 64-bit compilers. Make sure that you check the
  123 +"x64 Compilers and Tools" option under Visual C++.
  124 +
  125 +32-bit Windows
  126 +~~~~~~~~~~~~~~
  127 +
  128 +For Python 2.6 and newer install Visual C++ 2008 Express SP1.
  129 +
  130 +For Python 2.4 or 2.5 you must install
  131 +`MingW32 <http://www.mingw.org/wiki/InstallationHOWTOforMinGW>`_ then run the
  132 +following command to install::
  133 +
  134 + python setup.py build -c mingw32 install
100 135
101 136 .. _install-no-c:
102 137
103 138 Installing Without C Extensions
104 139 -------------------------------
  140 +
105 141 By default, the driver attempts to build and install optional C
106 142 extensions (used for increasing performance) when it is installed. If
107 143 any extension fails to build the driver will be installed anyway but a
@@ -113,3 +149,31 @@ build properly. This can be done using a command line option to
113 149 *setup.py*::
114 150
115 151 $ python setup.py --no_ext install
  152 +
  153 +Building PyMongo egg Packages
  154 +-----------------------------
  155 +
  156 +Some organizations do not allow compilers and other build tools on production
  157 +systems. To install PyMongo on these systems with C extensions you may need to
  158 +build custom egg packages. Make sure that you have installed the dependencies
  159 +listed above for your operating system then run the following command in the
  160 +PyMongo source directory::
  161 +
  162 + $ python setup.py bdist_egg
  163 +
  164 +The egg package can be found in the dist/ subdirectory. The file name will
  165 +resemble “pymongo-2.2-py2.7-linux-x86_64.egg” but may have a different name
  166 +depending on your platform and the version of python you use to compile.
  167 +
  168 +.. warning::
  169 +
  170 + These “binary distributions,” will only work on systems that resemble the
  171 + environment on which you built the package. In other words, ensure that
  172 + operating systems and versions of Python and architecture (i.e. “32” or “64”
  173 + bit) match.
  174 +
  175 +Copy this file to the target system and issue the following command to install the
  176 +package::
  177 +
  178 + $ sudo easy_install pymongo-2.2-py2.7-linux-x86_64.egg
  179 +
16 setup.py
@@ -125,21 +125,25 @@ class custom_build_ext(build_ext):
125 125 """
126 126
127 127 warning_message = """
128   -**************************************************************
  128 +********************************************************************
129 129 WARNING: %s could not
130 130 be compiled. No C extensions are essential for PyMongo to run,
131 131 although they do result in significant speed improvements.
132 132
133 133 If you are seeing this message on Linux you probably need to
134 134 install GCC and/or the Python development package for your
135   -version of Python. Python development package names for popular
136   -Linux distributions include:
  135 +version of Python.
137 136
138   -RHEL/CentOS: python-devel
139   -Debian/Ubuntu: python-dev
  137 +Debian and Ubuntu users should issue the following command:
  138 +
  139 + $ sudo apt-get install build-essential python-dev
  140 +
  141 +RedHat, CentOS, and Fedora users should issue the following command:
  142 +
  143 + $ sudo yum install gcc python-devel
140 144
141 145 %s
142   -**************************************************************
  146 +********************************************************************
143 147 """
144 148
145 149 def run(self):

0 comments on commit b927d64

Please sign in to comment.
Something went wrong with that request. Please try again.