/
setup.py
53 lines (47 loc) · 1.61 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
from setuptools import setup, find_packages
import py2exe
import fnmatch
import glob
import os
import accessible_output2
import libaudioverse
def get_datafiles(directory="share", match="*"):
"""builds list of data files to be with data_files in setuptools
A typical task in a setup.py file is to set the path and name of a list
of data files to provide with the package. For instance files in share/data
directory. One difficulty is to find those files recursively. This can be
achieved with os.walk or glob. Here is a simple function that perform this
task.
.. todo:: exclude pattern
"""
datafiles = []
matches = []
for root, dirnames, filenames in os.walk(directory):
for filename in fnmatch.filter(filenames, match):
matches.append(os.path.join(root, filename))
this_filename = os.path.join(root, filename)
datafiles.append((root, [this_filename]))
return datafiles
def list_sounds():
return get_datafiles('sounds')
def list_maps():
return [('', glob.glob('*.yml'))]
def list_docs():
return [('', glob.glob('*.txt'))]
setup(
name = "Shooter",
author = "Christopher Toth",
author_email = "q@q-continuum.net",
packages = find_packages(),
data_files = accessible_output2.find_datafiles() + libaudioverse.find_datafiles() + list_maps() + list_sounds() + list_docs(),
options = {
'py2exe': {
'compressed': False,
'excludes': ['win32pipe', 'win32com.gen_py', 'ingress', 'Tkinter', 'IPython', 'zmq'],
},
},
windows = [{
'script': 'main.pyw',
'dest_base': 'Shooter',
},],
)