-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
63 lines (52 loc) · 1.57 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
import re
from os.path import dirname, abspath, join
from setuptools import setup
HERE = dirname(abspath(__file__))
NAME = 'cbox'
META_FILE_PATH = join(HERE, NAME, '__init__.py')
REQUIREMENTS = []
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Information Technology',
'Operating System :: OS Independent',
]
def readme():
with open('README.md') as f:
return f.read()
with open(META_FILE_PATH) as fp:
META_FILE = fp.read()
def find_meta(meta):
"""
Extract __*meta*__ from META_FILE.
"""
meta_match = re.search(
r'^__{meta}__ = [\'"]([^\'"]*)[\'"]'.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))
setup(
name=NAME,
version=find_meta('version'),
description=find_meta('description'),
long_description=readme(),
classifiers=CLASSIFIERS,
keywords=find_meta('keywords'),
url=find_meta('url'),
author=find_meta('author'),
license=find_meta('license'),
packages=[NAME],
install_requires=REQUIREMENTS,
entry_points={
'console_scripts': ['cbox=cbox.__main__:main']
},
include_package_data=True,
zip_safe=False,
)