This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
forked from wjakob/nanogui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
75 lines (68 loc) · 2.21 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
import sys
import platform
class PyVersionException(Exception):
"""Exception for platform and python version errors"""
def __init__(self, message="Your platform and Python Version combination is not supported"):
self.message = message
super().__init__(self.message)
distributions = {
'Windows': {
6: {
'': ['nanogui.cp36-win_amd64.pyd', 'nanogui.dll', 'vcruntime140_1.dll']
},
7: {
'': ['nanogui.cp37-win_amd64.pyd', 'nanogui.dll', 'vcruntime140_1.dll']
},
8: {
'': ['nanogui.cp38-win_amd64.pyd', 'nanogui.dll', 'vcruntime140_1.dll']
}
},
'Linux': {
6: {
'': ['nanogui.cpython-36m-x86_64-linux-gnu.so', 'libnanogui.so']
},
7: {
'': ['nanogui.cpython-37m-x86_64-linux-gnu.so', 'libnanogui.so']
},
8: {
'': ['nanogui.cpython-38-x86_64-linux-gnu.so', 'libnanogui.so']
}
},
'Darwin': {
6: {
'': ['nanogui.cpython-36m-darwin.so', 'libnanogui.dylib']
},
7: {
'': ['nanogui.cpython-37m-darwin.so', 'libnanogui.dylib']
},
8: {
'': ['nanogui.cpython-38m-darwin.so', 'libnanogui.dylib']
}
}
}
try:
os_distributions = distributions[platform.system()]
except KeyError:
# don't use f-strings to prevent syntax error on older Python versions
sys.exit('Unrecognized platform: ' + platform.system())
if platform.system() == 'Darwin' and sys.version_info[0] == 3 and sys.version_info[1] == 8:
raise PyVersionException
try:
if sys.version_info[0] != 3:
raise KeyError
package_data = os_distributions[sys.version_info[1]]
except KeyError:
# don't use f-strings to prevent syntax error on older Python versions
sys.exit('Currently we only support Python 3.6, 3.7 or 3.8, but you are using ' + sys.version)
setup(
name='nanogui',
python_requires='>=3.6, <3.9',
version='1.1.0',
description='Python bindings for the C++ GUI library nanogui.',
author='BETA Technologies',
author_email='info@beta.team',
packages=[''],
package_dir={'': 'bin'},
package_data=package_data,
)