Skip to content

Commit e308ba1

Browse files
committed
Refactor build scripts to enhance cross-platform compatibility and remove redundant code
1 parent d118bec commit e308ba1

File tree

5 files changed

+8
-54
lines changed

5 files changed

+8
-54
lines changed

automations/build_exe.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
class BuildExe:
26-
"""Contains the logic for building the macOS EXE file."""
26+
"""Contains the logic for building the EXE file."""
2727

2828
def __init__(self) -> None:
2929
"""Constructor."""
@@ -45,6 +45,9 @@ def setup_build_environment(self) -> None:
4545
tmp_edited_init_py_filepath = pathlib.Path(
4646
const.PROJECT_ROOT_DIR / "edited/pymol", "__init__.py"
4747
)
48+
tmp_edited_startup_wrapper_py_filepath = pathlib.Path(
49+
const.PROJECT_ROOT_DIR / "edited/pymol", "startup_wrapper.py"
50+
)
4851
tmp_alternative_logo_filepath = pathlib.Path(
4952
const.PROJECT_ROOT_DIR / "alternative_design" / "alt_logo.png"
5053
)
@@ -65,6 +68,10 @@ def setup_build_environment(self) -> None:
6568
tmp_edited_init_py_filepath,
6669
pathlib.Path(const.PYMOL_PACKAGE_DIR / "__init__.py")
6770
)
71+
shutil.copy(
72+
tmp_edited_startup_wrapper_py_filepath,
73+
pathlib.Path(const.PYMOL_PACKAGE_DIR / "startup_wrapper.py")
74+
)
6875
shutil.copy(
6976
tmp_alternative_logo_filepath,
7077
pathlib.Path(const.PYMOL_PACKAGE_DIR / "data/pymol/icons", "alt_logo.png")

edited/pymol/startup_wrapper.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,3 @@
44

55
if __name__ == '__main__':
66
pymol.launch(sys.argv)
7-
8-
# <editor-fold desc="Coping startup_wrapper script into the application package">
9-
# Definition
10-
tmp_edited_startup_wrapper_py_filepath = pathlib.Path(
11-
const.PROJECT_ROOT_DIR / "edited/pymol", "startup_wrapper.py"
12-
)
13-
14-
# Copy
15-
shutil.copy(
16-
tmp_edited_startup_wrapper_py_filepath,
17-
pathlib.Path(const.PYMOL_PACKAGE_DIR / "startup_wrapper.py")
18-
)
19-
# </editor-fold>

os_specific/linux/setup_build_exe.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,3 @@
5454
}
5555
],
5656
)
57-
58-
59-
# <editor-fold desc="Coping Linux build script into the application package">
60-
# Definition
61-
tmp_os_specific_build_exe_filepath = pathlib.Path(
62-
const.OS_SPECIFIC_SETUP_BUILD_EXE
63-
)
64-
65-
# Copy
66-
shutil.copy(
67-
tmp_os_specific_build_exe_filepath,
68-
pathlib.Path(const.PYMOL_PACKAGE_DIR / "setup_build_exe.py")
69-
)
70-
# </editor-fold>

os_specific/macos/setup_build_exe.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,3 @@
5959
}
6060
],
6161
)
62-
63-
# <editor-fold desc="Coping macOS build script into the application package">
64-
# Definition
65-
tmp_os_specific_build_exe_filepath = pathlib.Path(
66-
const.OS_SPECIFIC_SETUP_BUILD_EXE
67-
)
68-
69-
# Copy
70-
shutil.copy(
71-
tmp_os_specific_build_exe_filepath,
72-
pathlib.Path(const.PYMOL_PACKAGE_DIR / "setup_build_exe.py")
73-
)
74-
# </editor-fold>

os_specific/windows/setup_build_exe.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,3 @@
5353
}
5454
],
5555
)
56-
57-
# <editor-fold desc="Coping Windows build script into the application package">
58-
# Definition
59-
tmp_os_specific_build_exe_filepath = pathlib.Path(
60-
const.OS_SPECIFIC_SETUP_BUILD_EXE
61-
)
62-
63-
# Copy
64-
shutil.copy(
65-
tmp_os_specific_build_exe_filepath,
66-
pathlib.Path(const.PYMOL_PACKAGE_DIR / "setup_build_exe.py")
67-
)
68-
# </editor-fold>

0 commit comments

Comments
 (0)