pesterchum/setup.py

54 lines
1.7 KiB
Python
Raw Normal View History

2011-06-26 18:14:19 -04:00
# Windows-only cx_freeze setup file
from cx_Freeze import setup, Executable
import sys
2021-03-24 17:34:55 -04:00
from version import buildVersion
2011-06-26 18:14:19 -04:00
2021-03-24 12:27:09 -04:00
if sys.version_info < (3, 0, 0):
2021-03-24 17:34:55 -04:00
sys.exit("Python versions lower than 3 are not supported.")
2021-03-24 12:27:09 -04:00
def is_64bit() -> bool:
return sys.maxsize > 2**32
2011-06-26 18:14:19 -04:00
if sys.platform == "win32":
base = "Win32GUI"
else:
2021-03-24 17:34:55 -04:00
sys.exit("This script won't work on this platform </3")
2011-06-26 18:14:19 -04:00
2021-03-24 17:34:55 -04:00
includefiles = ["quirks",
"smilies",
"themes",
"README.md",
"README-karxi.mkdn",
"README-pesterchum.mkdn",
"themes.txt",
"server.json",
"PCskins.png",
"Pesterchum.png"]
build_exe_options = {
2021-03-24 17:34:55 -04:00
"includes": ["requests","urllib","pytwmn"],
"excludes": ["collections.sys",
"collections._sre",
"collections._json",
"collections._locale",
"collections._struct",
"collections.array",
"collections._weakref"],
'include_files': includefiles
#'build_exe': ["build"]
}
2021-03-24 17:34:55 -04:00
#print("type(includefiles) = " + str(type(includefiles)))
#print("type(build_exe_options) = " + str(type(build_exe_options))
if is_64bit() == True:
2021-03-24 12:27:09 -04:00
setup(
2021-03-24 17:34:55 -04:00
name = "PESTERCHUM ALT.",
version = buildVersion,
url = "https://github.com/Dpeta/pesterchum-alt-servers",
description = "P3ST3RCHUM ALT.",
2021-03-24 12:27:09 -04:00
options = {"build_exe": build_exe_options},
executables = [Executable("pesterchum.py",
base=base,
2021-03-24 17:34:55 -04:00
icon="pesterchum.ico"
2021-03-24 12:27:09 -04:00
)])