如题,相同的文件,使用 pyside6 写的 gui ,本地远程环境都是 3.11 ,本地编译 180MB ,github 编译 30MB
本地用的 conda 虚拟环境,创建了新环境并安装 requirements.txt ,尽可能模拟 github 的操作
结果下来并没有解决问题
看了一下包内容,在 resources 文件夹里,本地编译的引用的 framworks 下的快捷方式,github 同一份文件用了两次。resources 文件夹的内容也有些许差异(参考: https://imgur.com/a/srkOYRl )
有人遇到过这种情况吗,有什么办法可以解决?
感激不尽
spec 如下
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='myapp',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='myapp',
)
app = BUNDLE(
coll,
name='myapp.app',
bundle_identifier=None,
)
部分 workflow 如下
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Build (macOS)
run: pyinstaller build.spec
- name: Zip (macOS-arm)
run: |
cd dist
zip -9 -r myapp.zip ./myapp.app
- name: Upload
uses: actions/upload-artifact@v4
with:
path: dist/*.zip