comparison setup.py @ 213:9bdf116bb2a5

Add a distutils setup and don’t hardcode DAT list.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 27 Nov 2011 15:13:31 +0100
parents
children 9634eefd2063
comparison
equal deleted inserted replaced
212:78e9957ad344 213:9bdf116bb2a5
1 # -*- encoding: utf-8 -*-
2
3 import os, sys
4 #import shutil
5 from distutils.core import setup
6 from distutils.extension import Extension
7
8 try:
9 from Cython.Distutils import build_ext
10 except ImportError:
11 print('You don’t seem to have Cython installed. Please get a '
12 'copy from www.cython.org and install it')
13 sys.exit(1)
14
15 packages = []
16 extensions = []
17
18 for directory, _, files in os.walk('pytouhou'):
19 package = directory.replace(os.path.sep, '.')
20 packages.append(package)
21 for filename in files:
22 if filename.endswith('.pyx'):
23 extensions.append(Extension('%s.%s' % (package, filename[:-4]),
24 ['%s/%s' % (directory, filename)]))
25
26 #TODO: put eclviewer.py in /usr/bin/ the right way
27 #shutil.copyfile('eclviewer.py', 'pytouhou/pytouhou')
28
29 setup(name='PyTouhou',
30 packages=packages,
31 ext_modules=extensions,
32 #scripts=['pytouhou/pytouhou'],
33 cmdclass = {'build_ext': build_ext})