-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
100 lines (89 loc) · 3.03 KB
/
setup.py
File metadata and controls
100 lines (89 loc) · 3.03 KB
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
100
from setuptools import setup, Distribution
from setuptools.command import build_py
import distutils.cmd
import os
import sys
import shutil
import glob
def get_platform():
platforms = {
'linux' : 'Linux',
'linux1' : 'Linux',
'linux2' : 'Linux',
'darwin' : 'OS X',
'win32' : 'Windows'
}
if sys.platform not in platforms:
return sys.platform
return platforms[sys.platform]
class BinaryDistribution(Distribution):
def has_ext_modules(var):
return True
def setup_package():
src_path = os.path.dirname(os.path.abspath(__file__))
old_path = os.getcwd()
os.chdir(src_path)
sys.path.insert(0, src_path)
metadata = dict(
name='pilotlight', # Required
version="0.1.14", # Required
author="Jonathan Hoffstadt", # Optional
author_email="jonathanhoffstadt@yahoo.com", # Optional
description='Pilot Light', # Required
# long_description=long_description, # Optional
# long_description_content_type='text/markdown', # Optional
url='https://github.com/PilotLightTech/pilotlight-python', # Optional
license = 'MIT',
python_requires='>=3.14',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Education',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: User Interfaces',
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages=['pilotlight'],
package_data={},
distclass=BinaryDistribution
)
if get_platform() == "Windows":
metadata['package_data']['pilotlight'] = [
"__init__.py",
"*.pyd",
"*.py",
"shaders/*.inc",
"shaders/*.comp",
"shaders/*.glsl",
"shaders/*.frag",
"shaders/*.vert"
]
else:
metadata['package_data']['pilotlight'] = [
"__init__.py",
"pilotlight.so",
"imgui.so",
"*.py",
"shaders/*.inc",
"shaders/*.comp",
"shaders/*.glsl",
"shaders/*.frag",
"shaders/*.vert"
]
if "--force" in sys.argv:
sys.argv.remove('--force')
try:
setup(**metadata)
finally:
del sys.path[0]
os.chdir(old_path)
return
if __name__ == '__main__':
setup_package()