Skip to content

Commit 63c9360

Browse files
committed
add Windows PyInstaller spec file
1 parent 53d212f commit 63c9360

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
# This file is part of Slice.
4+
#
5+
# Slice is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# Slice is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with Slice. If not, see <https://www.gnu.org/licenses/>.
17+
18+
import json
19+
from pathlib import Path
20+
21+
22+
with open(Path("src/build/settings/base.json")) as f:
23+
base_json = json.load(f)
24+
VERSION = base_json["version"]
25+
APP_NAME = base_json["app_name"]
26+
MAIN_MODULE_PATH = base_json["main_module"]
27+
28+
ICON_PATH = Path("icons/Icon.ico").resolve()
29+
30+
block_cipher = None
31+
32+
33+
a = Analysis([Path(MAIN_MODULE_PATH).resolve()],
34+
pathex=[Path('target/PyInstaller-Windows').resolve()],
35+
binaries=[],
36+
datas=[],
37+
hiddenimports=[],
38+
hookspath=[],
39+
runtime_hooks=[],
40+
excludes=[],
41+
win_no_prefer_redirects=False,
42+
win_private_assemblies=False,
43+
cipher=block_cipher,
44+
noarchive=False)
45+
pyz = PYZ(a.pure, a.zipped_data,
46+
cipher=block_cipher)
47+
exe = EXE(pyz,
48+
a.scripts,
49+
a.binaries,
50+
a.zipfiles,
51+
a.datas,
52+
[],
53+
name=APP_NAME,
54+
debug=False,
55+
bootloader_ignore_signals=False,
56+
strip=False,
57+
upx=False,
58+
console=False ,
59+
runtime_tmpdir=None,
60+
icon=[str(ICON_PATH)], )

0 commit comments

Comments
 (0)