Skip to content

Commit

Permalink
Añadido el script setup.py para compilar el código usando CX_freeze.
Browse files Browse the repository at this point in the history
 * Lo había subido a la branch equivocada, lo que va a traer problemas
   luego.
  • Loading branch information
danielrossyamitrano committed May 2, 2021
1 parent b32eed2 commit 9d17918
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ __pycache__
/posición de las estrellas.txt
/test.py
/build/
/setup.py
/data/favicon.ico
35 changes: 35 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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)]
)

0 comments on commit 9d17918

Please sign in to comment.