forked from boskee/Minecraft
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
59 lines (50 loc) · 1.45 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
# Imports, sorted alphabetically.
# Python packages
from Cython.Distutils import build_ext
from distutils.core import setup
from distutils.extension import Extension
import os
# Third-party packages
# Nothing for now...
# Modules from this project
import globals as G
excluded_modules = (
'globals',
'gui',
'views',
'controllers',
'setup-py2exe',
'pyglet.gl.glext_arb',
'pyglet.gl.glext_nv',
'pyglet.image.codecs',
'pyglet.image.codecs.pypng',
'pyglet.media',
'pyglet.media.drivers.alsa.asound',
'pyglet.window',
'pyglet.window.xlib.xlib',
)
def get_modules(path=None):
first = False
if path is None:
path = os.path.abspath(os.path.dirname(__file__))
first = True
for f_or_d in os.listdir(path):
if not first:
f_or_d = os.path.join(path, f_or_d)
if os.path.isdir(f_or_d):
d = f_or_d
for name, f in get_modules(d):
yield name, f
else:
f = f_or_d
if f.endswith(('.py', 'pyx')):
name = '.'.join(s for s in f.split('.')[0].replace("\\","/").split('/')
if s != '__init__')
if name and name not in excluded_modules:
yield name, f
ext_modules = [Extension(name, [f]) for name, f in get_modules()]
setup(
name=G.APP_NAME,
cmdclass={'build_ext': build_ext},
ext_modules=ext_modules, requires=['pyglet', 'Cython']
)