-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
120 lines (101 loc) · 3.33 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
##############################################################################
#
# Copyright (c) 2010 Koansys, LLC..
# All Rights Reserved.
#
# This software is subject to the provisions of the BSD-like license at
# http://www.koansys.org/LICENSE.txt. A copy of the license should accompany
# this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND
# FITNESS FOR A PARTICULAR PURPOSE
#
##############################################################################
import os
try:
import subprocess
has_subprocess = True
except:
has_subprocess = False
from distutils.cmd import Command
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
__version__ = '0.5.0'
requires = [
'colander',
'pymongo>=2.4',
'pyramid',
]
tests_require = [
'coverage',
'mock',
'mongomock',
'nose',
]
class doc(Command):
description = "generate or test documentation"
user_options = [("test", "t",
"run doctests instead of generating documentation")]
boolean_options = ["test"]
def initialize_options(self):
self.test = False
def finalize_options(self):
pass
def run(self):
if self.test:
path = "doc/_build/doctest"
mode = "doctest"
else:
path = "doc/_build/%s" % __version__
mode = "html"
# shutil.rmtree("doc/_build", ignore_errors=True)
try:
os.makedirs(path)
except:
pass
if has_subprocess:
status = subprocess.call(["sphinx-build", "-b", mode, "doc", path])
if status:
raise RuntimeError("documentation step '%s' failed" % mode)
print ("")
print (("Documentation step '%s' performed, results here:" % mode))
print ((" %s/" % path))
else:
print ("""
`setup.py doc` is not supported for this version of Python.
Please ask in the user forums for help.
""")
setup(name='lumin',
version=__version__,
description='A library to aid in using MongoDB with repoze.bfg',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Topic :: Database",
"Development Status :: 4 - Beta",
"Framework :: BFG",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
],
keywords='',
author="Koansys, LLC",
author_email="[email protected]",
url="http://koansys.org",
license="BSD-derived (http://koansys.com/LICENSE.txt)",
packages=find_packages(),
include_package_data=True,
zip_safe=False,
tests_require=requires+tests_require,
install_requires=requires+tests_require,
test_suite="nose.collector",
cmdclass={'doc': doc},
# entry_points="""\
# [nose.plugins.0.10]
# #mongodb = lumin.tests.mongodb:MongoDBPlugin
# """
)