forked from cjboyle/tinymongo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (73 loc) · 2.44 KB
/
setup.py
File metadata and controls
83 lines (73 loc) · 2.44 KB
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
import io
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read(*names, **kwargs):
"""Read a file."""
return io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
).read()
def parse_md_to_rst(file):
"""Read Markdown file and convert to ReStructured Text."""
try:
from m2r import parse_from_file
return parse_from_file(file).replace(
"artwork/", "http://198.27.119.65/"
)
except ImportError:
# m2r may not be installed in user environment
return read(file)
class PyTest(TestCommand):
"""PyTest cmdclass hook for test-at-buildtime functionality
http://doc.pytest.org/en/latest/goodpractices.html#manual-integration
"""
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = [
'tests/',
'-rx'
] #load defaults here
def run_tests(self):
import shlex
#import here, cause outside the eggs aren't loaded
import pytest
pytest_commands = []
try: #read commandline
pytest_commands = shlex.split(self.pytest_args)
except AttributeError: #use defaults
pytest_commands = self.pytest_args
errno = pytest.main(pytest_commands)
exit(errno)
setup(
name='tinymongo',
packages=find_packages(),
version='0.2.1',
description='A flat file drop in replacement for mongodb. Requires Tinydb',
author='Stephen Chapman, Jason Jones',
author_email='schapman1974@gmail.com',
url='https://github.com/schapman1974/tinymongo',
download_url='https://github.com/schapman1974/tinymongo/archive/master.zip',
keywords=['mongodb', 'drop-in', 'database', 'tinydb'],
long_description=parse_md_to_rst("README.md"),
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
install_requires=[
'tinydb>=3.2.1',
'tinydb_serialization>=1.0.4',
'pymongo>=3.4.0'
],
tests_require=[
'pytest>=3.2.0',
'py>=1.4.33'
],
cmdclass={
'test':PyTest
}
)