-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (56 loc) · 1.95 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A Flask extension that prevents browser access to API. """
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.install import install
VERSION = '1.0.9'
def readme():
""" Transform the given markdown README to RST. """
try:
from m2r import parse_from_file
return parse_from_file('README.md')
except ImportError:
with open('README.md') as stream:
return stream.read()
class VerifyVersionCommand(install):
""" Custom command to verify that the git tag matches our version """
description = 'verify that the git tag matches our version'
def run(self):
tag = os.getenv('CIRCLE_TAG')
if tag != VERSION:
sys.exit(
'Git tag %s does not match the current flask fool version %s'
% (tag, VERSION))
_URL = 'https://github.com/Faylixe/flask-fool'
_TAG_URL = _URL + '/archive/%s.tar.gz'
setup(
name='flask-fool',
version=VERSION,
description=__doc__,
long_description=readme(),
keywords='flask fool',
license='Apache Licence 2.0',
author='Felix Voituret',
author_email='[email protected]',
url=_URL,
download_url=_TAG_URL % VERSION,
packages=['flask_fool'],
include_package_data=True,
install_requires=['Flask'],
cmdclass={'verify': VerifyVersionCommand},
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Development Status :: 5 - Production/Stable',
]
)