forked from quitegreensky/akivymd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
55 lines (45 loc) · 1.48 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
from setuptools import setup, find_packages
import os
requirements_path = 'requirements.txt'
with open("README.md", "r") as fh:
long_description = fh.read()
def get_package_info():
init_path = os.path.join(
os.path.dirname(__file__),
'akivymd',
'__init__.py')
info_dic = {
'__version__': '',
'__description__': '',
'__author__': '',
'__email__': ''
}
with open(init_path, 'rt') as info:
for line in info:
for info in info_dic.keys():
if line.startswith(info):
info_dic[info] = line.split('=')[1]
continue
return info_dic
def parse_requirements(filename):
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
install_reqs = parse_requirements(requirements_path)
package_info = get_package_info()
setup(
name='akivymd',
version=package_info['__version__'],
description=package_info['__description__'],
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/quitegreensky/akivymd",
author=package_info['__author__'],
author_email=package_info['__email__'],
license='MIT',
install_requires=parse_requirements(requirements_path),
packages=find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
],
)