-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
90 lines (73 loc) · 2.3 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
#!/usr/bin/env python
import os
import sys
import re
from setuptools import setup
from setuptools.command.test import test as TestCommand
def read_file(filename):
"""Open and a file, read it and return its contents."""
path = os.path.join(os.path.dirname(__file__), filename)
with open(path) as f:
return f.read()
def read_requirements(filename):
"""Open a requirements file and return list of its lines."""
contents = read_file(filename).strip('\n')
return contents.split('\n') if contents else []
NAME = 'featmongo'
DESCRIPTION = (
'Wrapper around pymongo using the serialization '
'module to convert BSON to python object ')
LONG_DESC = DESCRIPTION
AUTHOR = 'Pragmatic Coders Developers'
AUTHOR_EMAIL = 'dev@pragmaticcoders.com'
LICENSE = "Proprietary"
PLATFORMS = ['any']
REQUIRES = []
SETUP_REQUIRES = ['setuptools>=0.6c9', 'wheel==0.23.0']
INSTALL_REQUIRES = read_requirements('requirements.txt')
TESTS_REQUIRE = read_requirements('requirements_dev.txt')
KEYWORDS = []
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: No Input/Output (Daemon)',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
]
PACKAGES = [
'featmongo',
]
class PyTest(TestCommand):
"""Command to run unit tests after in-place build."""
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'tests',
'featmongo',
]
self.test_suite = True
def run_tests(self):
# Importing here, `cause outside the eggs aren't loaded.
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(name = NAME,
version = '0.3.3',
description = DESCRIPTION,
long_description = LONG_DESC,
author = AUTHOR,
author_email = AUTHOR_EMAIL,
license = LICENSE,
platforms = PLATFORMS,
setup_requires = SETUP_REQUIRES,
install_requires = INSTALL_REQUIRES,
tests_require=TESTS_REQUIRE,
requires = REQUIRES,
packages = PACKAGES,
include_package_data = True,
keywords = KEYWORDS,
classifiers = CLASSIFIERS,
cmdclass={'test': PyTest},
)