The latest patch version of each Django minor version is used. The build now installs existing pymongo versions. The build now actually tests against the specified Django version. Replaced PIL with Pillow. Added PyPy and Python 3.4 to the build. Rebase Log: Installing Pillow instead of PIL for testing since it's recommended and it supports PyPy. Excluding Django versions that do not work with Python 3. Improved formatting of .travis.yml. Specifying Pillow 2.0.0 and above since it's the first version that is supported in Python 3. PIL should not be installed alongside Pillow. Also, I installed some libraries that both PIL and Pillow depend on. It seems I have to be explicit on all envvars in order to exclude Django 1.4 from the build matrix. The build is now installing pymongo versions that actually exist. openjpeg has a different name on Ubuntu 12.04. Restoring libz hack. Also installing all Pillow requirements just in case. Fixed the build matrix. Acting according to @BanzaiMan's advice in travis-ci/travis-ci/#1492.
79 lines
2.8 KiB
Python
79 lines
2.8 KiB
Python
import os
|
|
import sys
|
|
from setuptools import setup, find_packages
|
|
|
|
# Hack to silence atexit traceback in newer python versions
|
|
try:
|
|
import multiprocessing
|
|
except ImportError:
|
|
pass
|
|
|
|
DESCRIPTION = 'MongoEngine is a Python Object-Document ' + \
|
|
'Mapper for working with MongoDB.'
|
|
LONG_DESCRIPTION = None
|
|
try:
|
|
LONG_DESCRIPTION = open('README.rst').read()
|
|
except:
|
|
pass
|
|
|
|
|
|
def get_version(version_tuple):
|
|
if not isinstance(version_tuple[-1], int):
|
|
return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]
|
|
return '.'.join(map(str, version_tuple))
|
|
|
|
# Dirty hack to get version number from monogengine/__init__.py - we can't
|
|
# import it as it depends on PyMongo and PyMongo isn't installed until this
|
|
# file is read
|
|
init = os.path.join(os.path.dirname(__file__), 'mongoengine', '__init__.py')
|
|
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]
|
|
|
|
VERSION = get_version(eval(version_line.split('=')[-1]))
|
|
print(VERSION)
|
|
|
|
CLASSIFIERS = [
|
|
'Development Status :: 4 - Beta',
|
|
'Intended Audience :: Developers',
|
|
'License :: OSI Approved :: MIT License',
|
|
'Operating System :: OS Independent',
|
|
'Programming Language :: Python',
|
|
"Programming Language :: Python :: 2",
|
|
"Programming Language :: Python :: 2.6",
|
|
"Programming Language :: Python :: 2.7",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.1",
|
|
"Programming Language :: Python :: 3.2",
|
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
'Topic :: Database',
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
]
|
|
|
|
extra_opts = {"packages": find_packages(exclude=["tests", "tests.*"])}
|
|
if sys.version_info[0] == 3:
|
|
extra_opts['use_2to3'] = True
|
|
extra_opts['tests_require'] = ['nose', 'coverage', 'blinker', 'jinja2==2.6', 'Pillow>=2.0.0', 'django>=1.5.1']
|
|
if "test" in sys.argv or "nosetests" in sys.argv:
|
|
extra_opts['packages'] = find_packages()
|
|
extra_opts['package_data'] = {"tests": ["fields/mongoengine.png", "fields/mongodb_leaf.png"]}
|
|
else:
|
|
extra_opts['tests_require'] = ['nose', 'coverage', 'blinker', 'django>=1.4.2', 'Pillow>=2.0.0', 'jinja2>=2.6', 'python-dateutil']
|
|
|
|
setup(name='mongoengine',
|
|
version=VERSION,
|
|
author='Harry Marr',
|
|
author_email='harry.marr@{nospam}gmail.com',
|
|
maintainer="Ross Lawley",
|
|
maintainer_email="ross.lawley@{nospam}gmail.com",
|
|
url='http://mongoengine.org/',
|
|
download_url='https://github.com/MongoEngine/mongoengine/tarball/master',
|
|
license='MIT',
|
|
include_package_data=True,
|
|
description=DESCRIPTION,
|
|
long_description=LONG_DESCRIPTION,
|
|
platforms=['any'],
|
|
classifiers=CLASSIFIERS,
|
|
install_requires=['pymongo>=2.5'],
|
|
test_suite='nose.collector',
|
|
**extra_opts
|
|
)
|