fix: удалена упаковка системных библиотек вместе с программой (Linux)

This commit is contained in:
Maxim Slipenko 2023-09-28 17:25:49 +03:00
parent 67958838fc
commit b6e10c4209
2 changed files with 36 additions and 0 deletions

View File

@ -1,4 +1,15 @@
# -*- mode: python ; coding: utf-8 -*-
import sys
import typing
from pprint import pprint
if typing.TYPE_CHECKING:
from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ # noqa: F401
from PyInstaller.building.build_main import Analysis # noqa: F401
from PyInstaller.building.datastruct import TOC, Target, Tree # noqa: F401
from PyInstaller.building.osx import BUNDLE # noqa: F401
from PyInstaller.building.splash import Splash # noqa: F401
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
@ -16,6 +27,13 @@ a = Analysis(
excludes=[],
noarchive=False,
)
prev_binaries = set(a.binaries)
if sys.platform in ('linux', 'darwin'):
a.exclude_system_libraries(list_of_exceptions=[]) # glob expression
print('\n\nSTRIPPED SYSTEM LIBS')
pprint(sorted(set(prev_binaries) - set(a.binaries)))
pyz = PYZ(a.pure)
exe = EXE(

View File

@ -1,4 +1,15 @@
# -*- mode: python ; coding: utf-8 -*-
import sys
import typing
from pprint import pprint
if typing.TYPE_CHECKING:
from PyInstaller.building.api import COLLECT, EXE, MERGE, PYZ # noqa: F401
from PyInstaller.building.build_main import Analysis # noqa: F401
from PyInstaller.building.datastruct import TOC, Target, Tree # noqa: F401
from PyInstaller.building.osx import BUNDLE # noqa: F401
from PyInstaller.building.splash import Splash # noqa: F401
from PyInstaller.utils.hooks import copy_metadata
datas = [('statapp/images/sticker.gif', 'images')]
@ -17,6 +28,13 @@ a = Analysis(
excludes=[],
noarchive=False,
)
prev_binaries = set(a.binaries)
if sys.platform in ('linux', 'darwin'):
a.exclude_system_libraries(list_of_exceptions=[]) # glob expression
print('\n\nSTRIPPED SYSTEM LIBS')
pprint(sorted(set(prev_binaries) - set(a.binaries)))
pyz = PYZ(a.pure)
exe = EXE(