-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
52 lines (47 loc) · 1.57 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
import os
from setuptools import setup, find_packages
import distutils
import distutils.command.build
from distutils.core import setup, Extension
_birch = Extension('birch._birch',
sources = [
'birch/_perlin.c',
'birch/_rect.c',
'birch/_world.c',
'birch/_birch.c'
])
# Override build command
class BuildCommand(distutils.command.build.build):
def run(self):
print('>>>>>> Running asset build')
examples_path = 'birch/examples'
listing = os.listdir(examples_path)
from build_assets import build_assets
for fn in filter(lambda fn: os.path.isdir(fn) and not fn.endswith('__pycache__'),
map(lambda fn: '%s/%s' % (examples_path, fn), listing)):
print('Processing assets for example %s' % fn)
build_assets('%s/assets_src' % fn, '%s/assets' % fn)
super().run()
setup(name='birch',
version='0.0.1',
description='a game',
url='http://github.com/lysol/birch',
author='Derek Arnold',
author_email='[email protected]',
license='ISC',
packages=find_packages(),
package_dir={'birch': 'birch'},
package_data={'birch': [
'examples/**/assets/*',
'examples/**/maps/*'
]},
install_requires=[
'pyglet==1.5.17',
'noise',
'pillow',
'cairosvg',
'numpy'
],
zip_safe=False,
cmdclass={"build": BuildCommand},
ext_modules=[_birch])