Revert "Cleaned up the pyinstaller spec file"

This commit is contained in:
gentlegiantJGC 2022-07-03 14:16:35 +01:00 committed by GitHub
parent 578471afc6
commit b0b62a94dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,14 +16,12 @@ sys.path = [path for path in sys.path if os.path.normcase(os.path.realpath(path)
sys.path.append(cwd)
import amulet
import amulet_nbt
import PyMCTranslate
import minecraft_model_reader
import amulet_map_editor
sys.modules["FixTk"] = None
AMULET_NBT_PATH = amulet_nbt.__path__[0]
AMULET_PATH = amulet.__path__[0]
PYMCT_PATH = PyMCTranslate.__path__[0]
MINECRAFT_MODEL_READER = minecraft_model_reader.__path__[0]
@ -48,7 +46,6 @@ a = Analysis(
os.path.join(AMULET_MAP_EDITOR, "__pyinstaller"),
os.path.join(AMULET_PATH, "__pyinstaller"),
os.path.join(PYMCT_PATH, "__pyinstaller"),
os.path.join(AMULET_NBT_PATH, "__pyinstaller"),
],
runtime_hooks=[],
excludes=["FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter"],
@ -88,6 +85,14 @@ non_data_ext = ["*.pyc", "*.py", "*.dll", "*.so", "*.dylib"]
a.datas += Tree(AMULET_PATH, "amulet", excludes=non_data_ext)
a.datas += Tree(AMULET_MAP_EDITOR, "amulet_map_editor", excludes=non_data_ext)
a.datas += Tree(MINECRAFT_MODEL_READER, "minecraft_model_reader", excludes=non_data_ext)
a.datas += Tree(PYMCT_PATH, "PyMCTranslate", excludes=non_data_ext + ["json"])
a.datas += [
(
os.path.join("PyMCTranslate", "build_number"),
os.path.join(PYMCT_PATH, "build_number"),
"DATA",
)
]
print("Added data files")
for d in filter(lambda dt: "PyMCTranslate" in dt[0], a.datas):