Mercurial > rinkhals
annotate setup.py @ 315:0a3161fec434
Check whether we've made the list before submitting the score
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 05 Sep 2009 18:56:33 +0000 |
parents | 2db4673ea6c2 |
children | 2f83360e6442 |
rev | line source |
---|---|
301 | 1 # setup.py |
2 # -*- coding: utf8 -*- | |
3 # vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4 | |
4 | |
5 """Setuptools setup.py file for Operation Fox Assault.""" | |
6 | |
7 from setuptools import setup, find_packages | |
8 from gamelib import version | |
9 | |
10 try: | |
11 import py2exe | |
12 from py2exe.build_exe import py2exe as builder | |
13 import os | |
14 import glob | |
15 | |
16 class PkgResourceBuilder(builder): | |
17 def copy_extensions(self, extensions): | |
18 """Hack the py2exe C extension copier | |
19 to put pkg_resources into the | |
20 library.zip file. | |
21 """ | |
22 builder.copy_extensions(self, extensions) | |
23 package_data = self.distribution.package_data.copy() | |
24 | |
25 for package, patterns in self.distribution.package_data.items(): | |
26 package_dir = os.path.join(*package.split('.')) | |
27 collect_dir = os.path.join(self.collect_dir, package_dir) | |
28 | |
29 # create sub-dirs in py2exe collection area | |
30 # Copy the media files to the collection dir. | |
31 # Also add the copied file to the list of compiled | |
32 # files so it will be included in zipfile. | |
33 for pattern in patterns: | |
34 pattern = os.path.join(*pattern.split('/')) | |
35 for f in glob.glob(os.path.join(package_dir, pattern)): | |
36 name = os.path.basename(f) | |
37 folder = os.path.join(collect_dir, os.path.dirname(f)) | |
38 if not os.path.exists(folder): | |
39 self.mkpath(folder) | |
40 self.copy_file(f, os.path.join(collect_dir, name)) | |
41 self.compiled_files.append(os.path.join(package_dir, name)) | |
42 | |
43 except ImportError: | |
44 PkgResourceBuilder = None | |
45 | |
46 setup ( # Metadata | |
47 name = version.NAME, | |
48 version = version.VERSION_STR, | |
49 description = version.DESCRIPTION, | |
50 | |
51 author = version.AUTHOR_NAME, | |
52 author_email = version.AUTHOR_EMAIL, | |
53 | |
54 maintainer = version.MAINTAINER_NAME, | |
55 maintainer_email = version.MAINTAINER_EMAIL, | |
56 | |
57 # url = version.SOURCEFORGE_URL, | |
58 # download_url = version.PYPI_URL, | |
59 | |
60 license = version.LICENSE, | |
61 | |
62 classifiers = version.CLASSIFIERS, | |
63 | |
64 platforms = version.PLATFORMS, | |
65 | |
66 # Dependencies | |
67 install_requires = version.INSTALL_REQUIRES, | |
68 | |
69 # Files | |
70 packages = find_packages(), | |
71 package_data = { | |
72 # NOTE: PkgResourceBuilder cannot handle the | |
73 # catch-all empty package ''. | |
74 # Include SVG files from sutekh.gui package | |
75 #'sutekh.gui': ['*.svg'], | |
76 # Include LICENSE information for sutekh package | |
77 # Include everything under the docs directory | |
78 #'sutekh': ['COPYING', 'docs/html/*'], | |
79 }, | |
80 scripts = ['scripts/foxassault.py','scripts/testconsole.py'], | |
81 | |
82 # py2exe | |
83 console = ['scripts/testconsole.py'], | |
84 windows = [{ | |
85 'script': 'scripts/foxassault.py', | |
86 # 'icon_resources': [(0, "artwork/sutekh-icon-inkscape.ico")], | |
87 }], | |
88 cmdclass = { | |
89 'py2exe': PkgResourceBuilder, | |
90 }, | |
91 options = { 'py2exe': { | |
92 'skip_archive': 1, | |
93 'dist_dir': 'dist/foxassault-%s' % version.VERSION_STR, | |
94 'packages': [ | |
95 'logging', 'encodings', | |
96 ], | |
97 'includes': [ | |
98 # pygame | |
99 'pygame', 'pgu', | |
100 ], | |
101 'excludes': [ | |
314
2db4673ea6c2
Tweak excludes and ignores.
Simon Cross <hodgestar@gmail.com>
parents:
301
diff
changeset
|
102 'numpy', |
301 | 103 ], |
104 'ignores': [ | |
314
2db4673ea6c2
Tweak excludes and ignores.
Simon Cross <hodgestar@gmail.com>
parents:
301
diff
changeset
|
105 # all database modules |
301 | 106 'pgdb', 'Sybase', 'adodbapi', |
107 'kinterbasdb', 'psycopg', 'psycopg2', 'pymssql', | |
314
2db4673ea6c2
Tweak excludes and ignores.
Simon Cross <hodgestar@gmail.com>
parents:
301
diff
changeset
|
108 'sapdb', 'pysqlite2', 'sqlite', 'sqlite3', |
301 | 109 'MySQLdb', 'MySQLdb.connections', |
110 'MySQLdb.constants.CR', 'MySQLdb.constants.ER', | |
111 # old datetime equivalents | |
112 'DateTime', 'DateTime.ISO', | |
113 'mx', 'mx.DateTime', 'mx.DateTime.ISO', | |
114 # email modules | |
115 'email.Generator', 'email.Iterators', 'email.Utils', | |
116 ], | |
117 }}, | |
118 data_files = [ | |
119 'COPYRIGHT', | |
120 'COPYING', | |
121 ], | |
122 ) |