-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switched windows build script to cx_freeze
- Loading branch information
1 parent
62d5473
commit fb2ea45
Showing
3 changed files
with
40 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,24 @@ | ||
import os | ||
|
||
# from cx_Freeze import setup, Executable | ||
|
||
|
||
def find_all_scripts(directory): | ||
script_list = [] | ||
for root, _, files in os.walk(directory): | ||
for file in files: | ||
if file.endswith(".py"): | ||
script_list.append(os.path.relpath(os.path.join(root, file))) | ||
return script_list | ||
|
||
|
||
def parse_requirements(requirements_file): | ||
with open(requirements_file, mode="r", encoding="utf-8") as file: | ||
return [line.strip() for line in file] | ||
|
||
|
||
all_scripts = find_all_scripts("source") | ||
print(all_scripts) | ||
|
||
required_modules = parse_requirements("requirements.txt") | ||
print(required_modules) | ||
|
||
|
||
# build_exe_options = {"packages": ["os"], "includes": ["tkinter"]} | ||
# executables=[Executable("source/main.py", base=base)] | ||
|
||
# setup( | ||
# name="smwc-browser", | ||
# version="1.0", | ||
# description="A browser for SMW Central", | ||
# executables=[Executable(script) for script in all_scripts], | ||
# options={ | ||
# "build_exe": { | ||
# "packages": required_modules, | ||
# } | ||
# }, | ||
# ) | ||
from cx_Freeze import setup, Executable | ||
|
||
# todo: needs some fine tuning | ||
build_exe_options = { | ||
"excludes": [ | ||
"tkinter", | ||
"unittest", | ||
"asyncio", | ||
"tk86t", | ||
"tk8.6", | ||
], | ||
} | ||
|
||
target = Executable(script="source/main.py", icon="resources\windows_icon.ico") | ||
|
||
setup( | ||
name="smwc-browser", | ||
version="1.0", | ||
description="A browser for SMW Central", | ||
executables=[target], | ||
options={"build_exe": build_exe_options}, | ||
) |