-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.py
119 lines (108 loc) Β· 3.96 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import sys
import os
from setuptools import setup, find_packages
from stuntcat import __version__
here = os.path.abspath(os.path.dirname(__file__))
name = "stuntcat"
from io import open
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
freeze_cmds = ["bdist_dmg", "bdist_msi", 'build_exe', 'bdist_mac']
if any(x in sys.argv for x in freeze_cmds):
# https://cx-freeze.readthedocs.io/en/latest/distutils.html
# Note: we needed to use git cx_freeze because it does not work on mac py3.7.
# git+https://github.com/anthony-tuininga/cx_Freeze.git
#
from cx_Freeze import setup, Executable
import cx_Freeze.hooks
if not hasattr(cx_Freeze.hooks, 'load_pymunk'):
def load_pymunk(finder, module):
"""The chipmunk.dll or .dylib or .so is included in the package.
But it is not found by cx_Freeze, so we include it.
"""
import pymunk
finder.IncludeFiles(pymunk.chipmunk_path,
os.path.join(os.path.basename(pymunk.chipmunk_path)),
copyDependentFiles = False)
cx_Freeze.hooks.load_pymunk = load_pymunk
if not hasattr(cx_Freeze.hooks, 'load_pycparser'):
def load_pycparser(finder, module):
""" These files are missing which causes
permission denied issues on windows when they are regenerated.
"""
finder.IncludeModule("pycparser.lextab")
finder.IncludeModule("pycparser.yacctab")
cx_Freeze.hooks.load_pycparser = load_pycparser
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"packages": [
"os", "pygame", "sys", "typing", "random", "pyscroll", "pytmx", "thorpy", "pymunk"
],
"excludes": ["tkinter"],
}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform.startswith("win"):
base = "Win32GUI"
options = {
"build_exe": build_exe_options
}
executables = [Executable("run_game.py", base=base)]
print("options, executables, base", options, executables, base)
else:
options = {}
executables = []
setup(
name=name,
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Software Development :: Libraries :: pygame',
'Topic :: Games/Entertainment :: Arcade',
],
license='LGPL',
author='stuntcat team',
author_email='[email protected]',
maintainer='stuntcat team',
maintainer_email='[email protected]',
description='Stuntcat is the first pygame 2 community game.',
include_package_data=True,
long_description=long_description,
long_description_content_type='text/markdown',
options=options,
executables=executables,
package_dir={'stuntcat': 'stuntcat'},
packages=find_packages(),
# package_data={'stuntcat': []},
url='https://github.com/pygame/stuntcat',
install_requires=[
"pygame",
"pyscroll",
"pytmx",
"thorpy",
"pymunk>=5.4.2",
],
version=__version__,
extras_require={
':python_version < "3.5"': [
'typing',
],
},
entry_points={
'console_scripts': [
'stuntcat=stuntcat.cli:main',
],
},
)