Add py2exe rules to setup.py
authorNeil <neil@dip.sun.ac.za>
Sun, 11 Sep 2016 12:40:59 +0000 (14:40 +0200)
committerNeil <neil@dip.sun.ac.za>
Sun, 11 Sep 2016 13:05:21 +0000 (15:05 +0200)
setup.py

index 009c3442b025efc852cb152ff24d3cc01acd6389..53756bbd8f341b4415cba5dbb44cc3de3c547d63 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,12 @@
 from setuptools import setup, find_packages
 
+try:
+    import py2exe
+    py2exe  # To make pyflakes happy.
+except ImportError:
+    pass
+
+
 setup(
     name="tabakrolletjie",
     version="0.0.1",
@@ -25,4 +32,32 @@ setup(
         'Programming Language :: Python :: 2.7',
         'Topic :: Games/Entertainment',
     ],
+    options={
+        'py2exe': {
+            'skip_archive': 1,
+            'dist_dir': 'dist/tabakrolletjie-1.0.0',
+            'packages': [
+                'logging', 'encodings', 'tabakrolletjie',
+            ],
+            'includes': [
+                'pygame', 'pymunk',
+            ],
+            'excludes': [
+                'numpy',
+            ],
+            'ignores': [
+                # all database modules
+                'pgdb', 'Sybase', 'adodbapi',
+                'kinterbasdb', 'psycopg', 'psycopg2', 'pymssql',
+                'sapdb', 'pysqlite2', 'sqlite', 'sqlite3',
+                'MySQLdb', 'MySQLdb.connections',
+                'MySQLdb.constants.CR', 'MySQLdb.constants.ER',
+                # old datetime equivalents
+                'DateTime', 'DateTime.ISO',
+                'mx', 'mx.DateTime', 'mx.DateTime.ISO',
+                # email modules
+                'email.Generator', 'email.Iterators', 'email.Utils',
+            ],
+        },
+    }
 )