-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
70 lines (59 loc) · 1.83 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
# necessary to push to PyPI
# cf. http://peterdowns.com/posts/first-time-with-pypi.html
# cf. https://tom-christie.github.io/articles/pypi/
# cf. https://pythonhosted.org/setuptools/setuptools.html
# commands:
# one liner
# python setup.py sdist upload -r pypi
# 2 steps
# python setup.py sdist bdist_wheel
# twine upload dist/* -r ezhc
from distutils.util import convert_path
from setuptools import find_packages, setup
packages = find_packages()
module = packages[0]
meta_ns = {}
ver_path = convert_path(module + '/__meta__.py')
with open(ver_path) as ver_file:
exec(ver_file.read(), meta_ns)
name = meta_ns['__name__']
packages = packages
version = meta_ns['__version__']
description = meta_ns['__description__']
author = meta_ns['__author__']
author_email = meta_ns['__author_email__']
url = meta_ns['__url__']
download_url = meta_ns['__download_url__']
keywords = meta_ns['__keywords__']
license = meta_ns['__license__']
classifiers = meta_ns['__classifiers__']
include_package_data = meta_ns['__include_package_data__']
package_data = meta_ns['__package_data__']
zip_safe = meta_ns['__zip_safe__']
entry_points = meta_ns['__entry_points__']
# read requirements.txt
with open('requirements.txt', 'r') as f:
content = f.read()
li_req = content.split('\n')
install_requires = [e.strip() for e in li_req if len(e)]
# with open('README.rst') as f:
# long_description = f.read()
setup(
name=name,
version=version,
description=description,
# long_description=long_description,
author=author,
author_email=author_email,
url=url,
download_url=download_url,
keywords=keywords,
license=license,
classifiers=classifiers,
packages=packages,
install_requires=install_requires,
include_package_data=include_package_data,
package_data=package_data,
zip_safe=zip_safe,
entry_points=entry_points
)