-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
executable file
·48 lines (42 loc) · 1.61 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
#!/usr/bin/env python
# -*- coding: utf-8; mode: python -*-
import re
import codecs
from setuptools import setup, find_packages
def read_file(fname):
with codecs.open(fname, 'r', 'utf-8') as f:
return f.read()
def find_meta(meta):
"""
Extract __*meta*__ from META_FILE.
"""
meta_match = re.search(
r"^__{meta}__\s*=\s*['\"]([^'\"]*)['\"]".format(meta=meta),
META_FILE, re.M )
if meta_match:
return meta_match.group(1)
raise RuntimeError("Unable to find __{meta}__ string.".format(meta=meta))
NAME = 'tokenlib'
REQUIRES = []
EXTRAS_REQUIRE = {}
META_FILE = read_file('tokenlib/__init__.py')
LONG_DESCRIPTION = [ read_file(n) for n in ['README.rst', 'CHANGES.txt']]
setup(name = NAME,
version = find_meta('version'),
description = find_meta('description'),
long_description = '\n\n'.join(LONG_DESCRIPTION),
url = find_meta('url'),
author = find_meta('author'),
author_email = find_meta('author_email'),
license = find_meta('license'),
keywords = find_meta('keywords'),
packages = find_packages(),
include_package_data = True,
install_requires = REQUIRES,
extras_require = EXTRAS_REQUIRE,
test_suite = NAME,
zip_safe = False,
classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)" ] )