-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
99 lines (81 loc) · 2.52 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""Package BCI Learning Studio"""
import os
import subprocess
import setuptools
def _get_git_hash():
dir_ = os.path.dirname(__file__)
hash_ = subprocess.check_output([
'git', '-C', dir_, 'rev-parse', '--short', 'HEAD'])
return hash_.strip().decode('utf-8')
def _update_version_string_with_git_hash(path):
try:
hash_ = _get_git_hash()
except Exception: # pylint: disable=broad-except
return
with open(path, 'r') as file_:
base_version = file_.read().strip().split('-')[0]
version = '%s-%s' % (base_version, hash_)
with open(path, 'w') as file_:
file_.write(version)
def _get_version():
path = os.path.join(
os.path.dirname(__file__), 'bci_learning_studio', 'VERSION')
try:
_update_version_string_with_git_hash(path)
except Exception: # pylint: disable=broad-except
pass
with open(path, 'r') as file_:
return file_.read().strip()
def _get_package_data():
return ['VERSION']
def _get_long_description():
with open('README.md', 'r') as fileobj:
return fileobj.read()
def _set_up():
setuptools.setup(
name='bci_learning_studio',
version=_get_version(),
author='moto',
author_email='[email protected]',
description='Collective tools for train BCI system.',
long_description=_get_long_description(),
long_description_content_type='text/markdown',
url='https://github.com/hellomoto-ai/bci-learning-studio',
packages=setuptools.find_packages(
exclude=['tests*'],
),
test_suite='tests',
install_requires=[
'pyqt5',
'u-msgpack-python == 2.5.0',
'openbci_interface',
'scipy >= 1.2.0',
'pyqtgraph',
],
extras_require={
'dev': [
'pylint',
'flake8',
'flake8-print',
'pytest',
'pytest-qt',
'pytest-cov',
'pytest-mock',
],
},
package_data={
'bci_learning_studio': _get_package_data(),
},
entry_points={
'console_scripts': [
'bci_learning_studio = bci_learning_studio.__main__:main',
]
},
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
)
if __name__ == '__main__':
_set_up()