Skip to content

Commit b927d64

Browse files
committed
Updated build/install/release docs.
1 parent 5108100 commit b927d64

File tree

3 files changed

+112
-56
lines changed

3 files changed

+112
-56
lines changed

RELEASE.rst

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,31 @@ Some notes on PyMongo releases
44
Versioning
55
----------
66

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).
119

1210
Minor releases are reserved for bug fixes (in general no new features
1311
or deprecations) - they only happen in cases where there is a critical
1412
bug in a recently released version, or when a release has no new
1513
features or API changes.
1614

1715
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.
2119

2220
Deprecation
2321
-----------
2422

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.
3027

3128
Doing a Release
3229
---------------
3330

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.
3532

3633
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.
3734

@@ -55,12 +52,3 @@ Doing a Release
5552

5653
12. Announce!
5754

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.

doc/installation.rst

Lines changed: 92 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ to install pymongo on platforms other than Windows::
2121

2222
To get a specific version of pymongo::
2323

24-
$ pip install pymongo==1.10.1
24+
$ pip install pymongo==2.1.1
2525

2626
To upgrade using pip::
2727

@@ -39,26 +39,46 @@ To upgrade do::
3939

4040
$ easy_install -U pymongo
4141

42-
Mac OS Snow Leopard Issues
43-
--------------------------
42+
Dependencies for installing C Extensions on Unix
43+
------------------------------------------------
4444

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.
4951

50-
$ easy_install -U setuptools
51-
$ python -m easy_install pymongo
52+
Debian and Ubuntu users should issue the following command::
5253

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'.
5469

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
5676

5777
**Snow Leopard Xcode 4 Users**: The Python versions shipped with OSX 10.6.x
5878
are universal binaries. They support i386, PPC, and (in the case of python2.6)
5979
x86_64. Since Xcode 4 removed support for PPC the distutils version shipped
6080
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
6282
from python.org. There is a workaround::
6383

6484
# For Apple-supplied Python2.6 (installed at /usr/bin/python2.6)
@@ -71,37 +91,53 @@ from python.org. There is a workaround::
7191
See `http://bugs.python.org/issue11623 <http://bugs.python.org/issue11623>`_
7292
for a more detailed explanation.
7393

74-
Install from source
75-
-------------------
94+
Installing from source
95+
----------------------
7696

7797
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::
80100

81101
$ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
82102
$ cd pymongo/
83103
$ python setup.py install
84104

85-
Dependencies for installing C Extensions on Unix
86-
------------------------------------------------
87105

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/>`_).
95114

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:
98117

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
100135

101136
.. _install-no-c:
102137

103138
Installing Without C Extensions
104139
-------------------------------
140+
105141
By default, the driver attempts to build and install optional C
106142
extensions (used for increasing performance) when it is installed. If
107143
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
113149
*setup.py*::
114150

115151
$ 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+

setup.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,25 @@ class custom_build_ext(build_ext):
125125
"""
126126

127127
warning_message = """
128-
**************************************************************
128+
********************************************************************
129129
WARNING: %s could not
130130
be compiled. No C extensions are essential for PyMongo to run,
131131
although they do result in significant speed improvements.
132132
133133
If you are seeing this message on Linux you probably need to
134134
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.
137136
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
140144
141145
%s
142-
**************************************************************
146+
********************************************************************
143147
"""
144148

145149
def run(self):

0 commit comments

Comments
 (0)