-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
75 lines (65 loc) · 2.11 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
71
72
73
74
75
import io
import os
import os.path as op
from setuptools import setup
NAME = 'blockbuilder'
AUTHOR = 'Guillaume Favelier'
AUTHOR_EMAIL = 'guillaume.favelier@gmail.com'
DESCRIPTION = 'Block building application'
LICENSE = 'BSD (3-clause)'
DOWNLOAD_URL = 'http://github.com/GuillaumeFavelier/blockbuilder'
CLASSIFIERS = [
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'Topic :: Artistic Software',
'Topic :: Software Development',
]
REQUIREMENTS = None
with open('requirements.txt') as f:
REQUIREMENTS = [line.rstrip('\n') for line in f]
# Adapted from MNE
VERSION = None
with open(op.join(NAME, '__init__.py'), 'r') as fid:
for line in (line.strip() for line in fid):
if line.startswith('__version__'):
VERSION = line.split('=')[1].strip().strip('\'')
break
# Adapted from VisPy
def package_tree(pkgroot):
"""Get the submodule list."""
path = op.dirname(__file__)
subdirs = [op.relpath(i[0], path).replace(op.sep, '.')
for i in os.walk(op.join(path, pkgroot))
if '__init__.py' in i[2]]
return sorted(subdirs)
# Adapted from Spyder
with io.open('README.md', encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
SCRIPTS = ['blockbuilder']
if os.name == 'nt':
SCRIPTS += ['blockbuilder.bat']
setup_args = dict(
name=NAME,
version=VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
license=LICENSE,
download_url=DOWNLOAD_URL,
url=DOWNLOAD_URL,
platforms=["Windows", "Linux", "MacOS"],
python_requires='>=3.7',
install_requires=REQUIREMENTS,
packages=package_tree(NAME),
scripts=[op.join('scripts', fname) for fname in SCRIPTS],
classifiers=CLASSIFIERS,
)
setup(**setup_args)