-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (55 loc) · 2.18 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
from setuptools import setup
_readme = 'README.md'
with open(_readme, 'r') as f:
long_description = f.read()
_release = 'RELEASE.md'
with open(_release, 'r') as f:
for line in f:
if line.startswith("##"):
_version = line.split()[1]
break
_extras_path = 'extras'
with open(_extras_path+'/.env', 'r') as f:
for line in f:
if line.startswith('PACKAGE='):
_package = line.splitlines()[0].split('=')[1].lower()
if line.startswith('URL='):
_url = line.splitlines()[0].split('=')[1].lower()
if line.startswith('AUTHORS='):
_authors = line.splitlines()[0].split('=')[1].lower()
if line.startswith('DESCR='):
_descr = line.splitlines()[0].split('=')[1].lower()
if line.startswith('CORR_AUTHOR='):
_corr_author = line.splitlines()[0].split('=')[1].lower()
# from yaml import safe_load as yaml_safe_load
# from yaml import YAMLError
# required = []
# with open(_extras_path+'/environment-run.yml', 'r') as run_stream:
# # with open(_extras_path+'/environment-build.yml', 'r') as build_stream:
# try:
# required = yaml_safe_load(run_stream)['dependencies']
# # required += yaml_safe_load(build_stream)['dependencies']
# except yaml.YAMLError as exc:
# print(exc)
setup(
name = _package,
version = _version,
author = _authors,
author_email = _corr_author,
description = _descr,
long_description = long_description,
long_description_content_type = 'text/markdown',
url = _url,
packages = [_package],
package_dir = {_package: _package},
include_package_data = True,
# install_requires = required,
test_suite = 'pytest',
license = 'MIT',
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
python_requires = '>=3.5',
)