This commit is contained in:
ZtRXR 2024-05-05 22:27:17 +08:00
parent a30664b060
commit 3ef857725e
4 changed files with 20 additions and 3 deletions

17
build.py Normal file
View File

@ -0,0 +1,17 @@
import os
import subprocess
import shutil
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
source_dir = os.path.join(script_dir,"webp_to_png","data")
des_dir = os.path.join(source_dir,"dist","pyinstaller")
if sys.platform.startswith('win32'):
des_dir = os.path.join(des_dir,"win_amd64")
print("You are on the windows platform,it will put data into",des_dir)
else:
print("you are on the other platform please put webp_to_png/data \"data\" directory into the exe directory")
subprocess.run(["poetry","build"], check=True)
shutil.copytree(source_dir,des_dir)

View File

@ -1,9 +1,9 @@
[tool.poetry-pyinstaller-plugin.scripts] [tool.poetry-pyinstaller-plugin.scripts]
webp_to_png = { source = "webp_to_png/__main__.pyw", type = "onefile", bundle = false, icon="../../../../favicon.ico"} webp_to_png = { source = "webp_to_png/__main__.pyw", type = "onefile", bundle = false, icon="../../../../webp_to_png/data/favicon.ico", console=true}
[tool.poetry-pyinstaller-plugin.collect] # [tool.poetry-pyinstaller-plugin.collect]
# Collect all submodules, data files & binaries for 'package_A' and 'package_B' # Collect all submodules, data files & binaries for 'package_A' and 'package_B'
data = ["webp_to_png"] # all = ["webp_to_png"]
[tool.poetry] [tool.poetry]

View File

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB