Skip to content

Commit d0280bb

Browse files
committed
update nuitka_build.py
1 parent fcf323b commit d0280bb

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,5 @@ cython_debug/
198198
.temp
199199
temp/
200200
.vscode/
201-
.idea/
201+
.idea/
202+
**/*.bak

package/nuitka_build.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import argparse
77
from pathlib import Path
88
# from zip import zip_files_and_folders
9+
import uuid
10+
import shutil
911

1012
def main():
1113
print("="*50)
@@ -120,8 +122,12 @@ def main():
120122
# print(f"警告: UPX目录不存在 {upx_dir}")
121123
# else:
122124
# print("不使用UPX压缩")
125+
123126
# 添加主Python文件
124-
cmd.append(str(python_file))
127+
t_file = str(uuid.uuid4()) + ".py"
128+
shutil.copy(str(python_file), t_file)
129+
t_file_path = base_dir / t_file
130+
cmd.append(str(t_file_path))
125131

126132
# 打印并执行命令
127133
print("执行命令:", ' '.join(cmd))
@@ -137,7 +143,7 @@ def main():
137143
result = subprocess.run(cmd)
138144

139145
if result.returncode == 0:
140-
print(f"(onefile)打包成功: {dist_path / output_name}")
146+
print(f"打包成功: {dist_path / output_name}")
141147
success_count += 1
142148
else:
143149
print(f"打包失败,退出码: {result.returncode}")

package/nuitka_config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
icon:
1414
windows-disable-console: False
1515
distpath: 'dist'
16-
timeout: 1200
16+
timeout: 2700
1717
output-name-template: '{{name}}_{{version}}_nuitka_{{os}}_{{arch}}'
1818

1919
- name: 'Keyboard_monitoring'
@@ -29,7 +29,7 @@
2929
icon:
3030
windows-disable-console: False
3131
distpath: 'dist'
32-
timeout: 1200
32+
timeout: 2700
3333
output-name-template: '{{name}}_{{version}}_nuitka_{{os}}_{{arch}}'
3434

3535
- name: 'NetEase_Cloud_Music_Download'
@@ -46,7 +46,7 @@
4646
icon:
4747
windows-disable-console: False
4848
distpath: 'dist'
49-
timeout: 1200
49+
timeout: 2700
5050
output-name-template: '{{name}}_{{version}}_nuitka_{{os}}_{{arch}}'
5151

5252
- name: 'ftp_server'
@@ -60,7 +60,7 @@
6060
icon:
6161
windows-disable-console: False
6262
distpath: 'dist'
63-
timeout: 1200
63+
timeout: 2700
6464
output-name-template: '{{name}}_{{version}}_nuitka_{{os}}_{{arch}}'
6565

6666
- name: 'sunrise_sunset_info'
@@ -74,5 +74,5 @@
7474
icon:
7575
windows-disable-console: False
7676
distpath: 'dist'
77-
timeout: 1200
77+
timeout: 2700
7878
output-name-template: '{{name}}_{{version}}_nuitka_{{os}}_{{arch}}'

0 commit comments

Comments
 (0)