From 9d17918f0dc00250c261e4456f94ba415201b05b Mon Sep 17 00:00:00 2001 From: danielrossyamitrano Date: Sat, 1 May 2021 21:56:41 -0300 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20el=20script=20setup.py=20para=20?= =?UTF-8?q?compilar=20el=20c=C3=B3digo=20usando=20CX=5Ffreeze.=20=20*=20Lo?= =?UTF-8?q?=20hab=C3=ADa=20subido=20a=20la=20branch=20equivocada,=20lo=20q?= =?UTF-8?q?ue=20va=20a=20traer=20problemas=20=20=20=20luego.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - setup.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 2452caa..d891d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ __pycache__ /posiciĆ³n de las estrellas.txt /test.py /build/ -/setup.py /data/favicon.ico diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..eb7f93b --- /dev/null +++ b/setup.py @@ -0,0 +1,35 @@ +import sys +from cx_Freeze import setup, Executable +import os +from datetime import datetime + +now = ''.join([char for char in str(datetime.now()) if char not in [' ', '.', ':', '-']]) + +build_exe_options = {"packages": ["pygame", "pint"], + "excludes": ["tkinter", "http", "errno", "getop", "gettext", "glob", "http.client", "http.server", + "imp", "io", "lib2to3", "multiprocessing", "zipimport", "xml.parsers", + "pkg_resources", "pydoc", "pprint", "quopri", "runpy", "select", "selectors", + "socket", "stringprep", "subprocess", "tarfile", "unittest", "xml", + "importlib_metadata", + + "pygame.camera", "pygame.joystick", "pygame.mixer", "pygame.music", "pygame.cdrom", + "pygame.examples", "pygame.scrap", "pygame.tests", "pygame.touch", "pygame.midi", + "pygame.sndarray","pygame.surfarray","pygame.pixelcopy" + + ], + "include_files": [('data/favicon.png',) * 2], + "optimize": 2, + "build_exe": os.path.join(os.getcwd(), 'build', now) + } + +base = None +if sys.platform == "win32": + base = "Win32GUI" +icono = os.path.join(os.getcwd(), 'data', 'favicon.ico') +setup( + name="Worldbuilding", + version="1.0", + description="An app for worldbuilders", + options={"build_exe": build_exe_options}, + executables=[Executable(script="main.py", base=base, target_name="Worldbuilding", icon=icono)] +)