a REAL em dash
[naja.git] / setup.py
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 Robolock II."""
6
7 from setuptools import setup, find_packages
8 from setuptools.command.sdist import sdist
9 from setuptools.command.install import install
10
11 from tools import gen_json
12
13 try:
14     import py2exe
15     py2exe  # To make pyflakes happy.
16 except ImportError:
17     pass
18
19
20 # This should probably be pulled from constants.py
21 # These two constants are used by darwin-py2app.sh.
22 VERSION_STR = "0.1"
23 NAME_STR = "robolock-II"
24
25
26 class NajaSdist(sdist):
27     def run(self):
28         gen_json.main()
29         sdist.run(self)
30
31
32 class NajaInstall(install):
33     def run(self):
34         gen_json.main(update=False)
35         install.run(self)
36
37
38 setup(
39     name=NAME_STR,
40     version=VERSION_STR,
41     description="Robolock II - a puzzle game",
42
43     author=(", ".join([
44         "Simon Cross",
45         "Neil Muller",
46         "Adrianna PiƄska",
47         "Stefano Rivera",
48         "David Sharpe",
49         "Jeremy Thurgood",
50     ])),
51     author_email="ctpug@googlegroups.com",
52
53     maintainer="Team Naja (CTPUG)",
54     maintainer_email="ctpug@googlegroups.com",
55
56     url="http://robolock.org/",
57     download_url="http://ctpug.org.za/git/naja",
58
59     license="MIT",
60
61     classifiers=[
62         'Development Status :: 4 - Beta',
63         'Environment :: MacOS X',
64         'Environment :: Win32 (MS Windows)',
65         'Environment :: X11 Applications',
66         'Intended Audience :: End Users/Desktop',
67         'License :: OSI Approved :: MIT License',
68         'Natural Language :: English',
69         'Operating System :: Microsoft :: Windows',
70         'Operating System :: POSIX',
71         'Operating System :: MacOS :: MacOS X',
72         'Programming Language :: Python :: 2.6',
73         'Programming Language :: Python :: 2.7',
74         'Topic :: Games/Entertainment',
75     ],
76
77     platforms=[
78         'Linux',
79         'Mac OS X',
80         'Windows',
81     ],
82
83     # Dependencies
84     install_requires=[
85         'pygame',
86     ],
87
88     setup_requires=[
89         'PyYAML',
90     ],
91
92     # Files
93     packages=find_packages(),
94     scripts=[
95         'scripts/naja',
96     ],
97
98     cmdclass={
99         'sdist': NajaSdist,
100         'install': NajaInstall,
101     },
102
103     # py2exe
104     windows=[{
105         'script': 'scripts/naja',
106         'icon_resources': [(0, "data/icons/robolock.ico")],
107     }],
108     app=['scripts/naja'],
109     options={
110         'py2exe': {
111             'skip_archive': 1,
112             'dist_dir': 'dist/naja-%s' % VERSION_STR,
113             'packages': [
114                 'logging', 'encodings', 'naja',
115             ],
116             'includes': [
117                 'pygame',
118             ],
119             'excludes': [
120                 'numpy', 'pygame.sdlmain_osx', 'winreg', 'AppKit',
121                 'Foundation', 'Numeric', 'OpenGL.GL', '_scproxy',
122                 '_sysconfigdata', 'copyreg', 'dummy.Process', 'pkg_resources',
123                 'queue', 'win32evtlog', 'win32evtlogutil',
124             ],
125             'ignores': [
126                 # all database modules
127                 'pgdb', 'Sybase', 'adodbapi',
128                 'kinterbasdb', 'psycopg', 'psycopg2', 'pymssql',
129                 'sapdb', 'pysqlite2', 'sqlite', 'sqlite3',
130                 'MySQLdb', 'MySQLdb.connections',
131                 'MySQLdb.constants.CR', 'MySQLdb.constants.ER',
132                 # old datetime equivalents
133                 'DateTime', 'DateTime.ISO',
134                 'mx', 'mx.DateTime', 'mx.DateTime.ISO',
135                 # email modules
136                 'email.Generator', 'email.Iterators', 'email.Utils',
137             ],
138         },
139         'py2app': {
140             'app': ['run_game.py'],
141             'argv_emulation': True,
142             'iconfile': 'data/icons/robolock.icns',
143             'packages': [
144                 'logging', 'encodings', 'pygame', 'naja', 'data',
145             ],
146             'excludes': ['numpy'],
147         }},
148     data_files=[
149         # 'COPYRIGHT',
150         'LICENSE.txt',
151         'README.txt',
152     ],
153     include_package_data=True,
154 )