-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
75 lines (68 loc) · 2.1 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
from setuptools import setup, find_packages
import os
import subprocess
import codecs
import os.path
depend_links = []
# detect if on raspberry pi, and
# set location to wheel if we are
IS_RASPI = False
try:
ret = subprocess.call(['grep', '-q', 'BCM', '/proc/cpuinfo'])
if ret == 0:
IS_RASPI = True
os.system("sudo +x INSTALL")
os.system("sudo ./INSTALL")
except:
# fine, not a raspi if it don't have grep or cpuinfo
pass
# keeping this around for proper packaging later
# get wheel name
#external_files = os.listdir(os.path.join(os.getcwd(), 'external'))
#pyside_wheel = [whl for whl in external_files if whl.endswith('.whl') and whl.startswith("PySide2")][0]
#depend_links.append(os.path.join(os.getcwd(), 'external', pyside_wheel))
def read(rel_path):
"""
https://packaging.python.org/guides/single-sourcing-package-version/
"""
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
"""
https://packaging.python.org/guides/single-sourcing-package-version/
"""
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
setup(
name="pvp",
author="pvp team",
author_email="[email protected]",
description="some description of how we made a ventilator",
keywords="vents ventilators etc",
url="https://ventilator.readthedocs.io",
version=get_version('pvp/__init__.py'),
packages=find_packages(),
install_requires=[
'numpy',
'PySide2==5.11.*',
'pyqtgraph~=0.11.0rc0',
'pytest-qt',
'pytest-timeout',
'pigpio',
'tables',
'scipy'
],
package_data={
"*": ["data/*", "assets/*", ""],
"pvp": ["external/*",
"gui/images/*",
"io/config/*"]
},
dependency_links=depend_links,
python_requires='>=3.7,<3.8'
)