Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 82 lines (72 sloc) 2.565 kb
ec01929 starting on a setup.py
Mike Dirolf authored
1 #!/usr/bin/env python
2
7bbb4a5 python 2.3 support
Mike Dirolf authored
3 import sys
4
c9b7f2e add MANIFEST file to include additional files in source distribution …
Mike Dirolf authored
5 try:
6 from setuptools import setup
7 except ImportError:
8 from ez_setup import use_setuptools
9 use_setuptools()
10 from setuptools import setup
4f66ac7 don't fail if the C extension fails to build
Mike Dirolf authored
11 from distutils.command.build_ext import build_ext
12 from distutils.errors import CCompilerError
d953cf0 really simple c extension module for bson - basically just experiment…
Mike Dirolf authored
13 from distutils.core import Extension
ec01929 starting on a setup.py
Mike Dirolf authored
14
9415161 update README to add support for 2.4. only require elementtree if ver…
Mike Dirolf authored
15 requirements = []
16 try:
17 import xml.etree.ElementTree
18 except ImportError:
19 requirements.append("elementtree")
20
48b68aa make sure to close the file
Mike Dirolf authored
21 f = open("README.rst")
b7c4e00 add classifiers and use the README as the long description
Mike Dirolf authored
22 try:
f167101 changes to support python 2.4
Mike Dirolf authored
23 try:
24 readme_content = f.read()
25 except:
26 readme_content = ""
48b68aa make sure to close the file
Mike Dirolf authored
27 finally:
28 f.close()
b7c4e00 add classifiers and use the README as the long description
Mike Dirolf authored
29
4f66ac7 don't fail if the C extension fails to build
Mike Dirolf authored
30 class custom_build_ext(build_ext):
31 """Allow C extension building to fail.
32
33 The C extension speeds up BSON encoding, but is not essential.
34 """
35 def build_extension(self, ext):
7bbb4a5 python 2.3 support
Mike Dirolf authored
36 if sys.version_info[:3] >= (2, 4, 0):
37 try:
38 build_ext.build_extension(self, ext)
39 except CCompilerError:
40 print ""
41 print ("*" * 62)
42 print """WARNING: The %s extension module could not
4f66ac7 don't fail if the C extension fails to build
Mike Dirolf authored
43 be compiled. No C extensions are essential for PyMongo to run,
44 although they do result in significant speed improvements.
45
46 Above is the ouput showing how the compilation failed.""" % ext.name
7bbb4a5 python 2.3 support
Mike Dirolf authored
47 print ("*" * 62 + "\n")
48 else:
49 print ""
50 print ("*" * 62)
51 print """WARNING: The %s extension module is not supported
52 for this version of Python. No C extensions are essential
53 for PyMongo to run, although they do result in significant
54 speed improvements.
55
56 Please use Python >= 2.4 to take advantage of the extension.""" % ext.name
4f66ac7 don't fail if the C extension fails to build
Mike Dirolf authored
57 print ("*" * 62 + "\n")
58
ec01929 starting on a setup.py
Mike Dirolf authored
59 setup(
60 name="pymongo",
691a1a1 note in README about 2.3 support. bump version (adding support for 2.3)
Mike Dirolf authored
61 version="0.8",
ec01929 starting on a setup.py
Mike Dirolf authored
62 description="Driver for the Mongo database <http://www.mongodb.org>",
b7c4e00 add classifiers and use the README as the long description
Mike Dirolf authored
63 long_description=readme_content,
ec01929 starting on a setup.py
Mike Dirolf authored
64 author="10gen",
65 author_email="mike@10gen.com",
66 url="http://github.com/mongodb/mongo-python-driver",
bdf27bb add gridfs package to distribution
Mike Dirolf authored
67 packages=["pymongo", "gridfs"],
d953cf0 really simple c extension module for bson - basically just experiment…
Mike Dirolf authored
68 ext_modules=[Extension('pymongo._cbson', ['pymongo/_cbsonmodule.c'])],
9415161 update README to add support for 2.4. only require elementtree if ver…
Mike Dirolf authored
69 install_requires=requirements,
c2c35cf more metadata
Mike Dirolf authored
70 license="Apache License, Version 2.0",
b7c4e00 add classifiers and use the README as the long description
Mike Dirolf authored
71 test_suite="nose.collector",
72 classifiers=[
68546ff change status classifier
Mike Dirolf authored
73 "Development Status :: 4 - Beta",
b7c4e00 add classifiers and use the README as the long description
Mike Dirolf authored
74 "Intended Audience :: Developers",
75 "License :: OSI Approved :: Apache Software License",
76 "Operating System :: MacOS :: MacOS X",
77 "Operating System :: Microsoft :: Windows",
78 "Operating System :: POSIX",
79 "Programming Language :: Python",
4f66ac7 don't fail if the C extension fails to build
Mike Dirolf authored
80 "Topic :: Database"],
81 cmdclass={"build_ext": custom_build_ext})
Something went wrong with that request. Please try again.