This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
forked from zbyte64/micromodels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
58 lines (46 loc) · 1.71 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
import os
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
# Inspired by the example at https://pytest.org/latest/goodpractises.html
class NoseTestCommand(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests', '-v', '-s', '--nologcapture', 'tests'])
def rel_file(*args):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args)
def read_from(filename):
with open(filename) as f:
return f.read()
def get_long_description():
return read_from(rel_file('README.md'))
def get_version():
data = read_from(rel_file('micromodels', '__init__.py'))
return re.search(r"__version__ = '([^']+)'", data).group(1)
setup(
name='micromodels',
description='Declarative dictionary-based model classes for Python',
long_description=get_long_description(),
version=get_version(),
packages=find_packages(),
url='https://github.com/j4mie/micromodels/',
author='Jamie Matthews',
author_email='[email protected]',
license='Public Domain',
install_requires=["aniso8601", "six"],
tests_require=["nose"],
cmdclass={'test': NoseTestCommand},
classifiers=[
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: Public Domain',
'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)