-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
87 lines (71 loc) · 2.38 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
# -*- coding: utf-8 -*-
"""
Flask-Bitmapist Setup
~~~~~~~~~~~~~~~~~~~~~
setup.py for Flask-Bitmapist
:copyright: (c) 2016 by Cuttlesoft, LLC.
:license: MIT, see LICENSE for more details.
"""
import ast
import re
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def get_requirements(suffix=''):
with open('requirements%s.txt' % suffix) as f:
rv = f.read().splitlines()
return rv
def get_version():
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('flask_bitmapist/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
return version
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'-xrs',
'--cov', 'flask_bitmapist',
'--cov-report', 'term-missing',
'--pep8',
'--flakes',
'--cache-clear'
]
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
_version = get_version()
setup(
name='Flask-Bitmapist',
version=_version,
url='http://github.com/cuttlesoft/flask-bitmapist',
download_url='https://github.com/cuttlesoft/flask-bitmapist/tarball/' + _version,
license='MIT',
author='Cuttlesoft, LLC',
author_email='engineering@cuttlesoft.com',
description='Flask extension that creates a simple interface to Bitmapist analytics library',
long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
packages=find_packages(),
keywords=['Flask', 'Bitmapist'],
py_modules=['flask_bitmapist'],
zip_safe=False,
platforms='any',
install_requires=[
'Flask>=0.9',
'bitmapist>=3.97'
],
tests_require=get_requirements('-test'),
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules']
)