mirror of
https://github.com/Ircama/epson_print_conf.git
synced 2025-05-09 13:42:03 -04:00
Fix importing black when building exe with pyinstaller
This commit is contained in:
parent
69a6e9bf06
commit
350ca81474
2 changed files with 18 additions and 3 deletions
|
@ -4,6 +4,7 @@ import argparse
|
|||
import os
|
||||
import os.path
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
|
||||
|
||||
|
||||
def create_image(png_file, text):
|
||||
|
@ -76,12 +77,25 @@ app.mainloop()
|
|||
with open(PROGRAM[0], 'w') as file:
|
||||
file.write(gui_wrapper)
|
||||
|
||||
# black submodules: https://github.com/pyinstaller/pyinstaller/issues/8270
|
||||
black_submodules = collect_submodules('black')
|
||||
blib2to3_submodules = collect_submodules('blib2to3')
|
||||
|
||||
# "black" data files: https://github.com/pyinstaller/pyinstaller/issues/8270
|
||||
blib2to3_data = collect_data_files('blib2to3')
|
||||
|
||||
a = Analysis(
|
||||
PROGRAM,
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=DATAS,
|
||||
hiddenimports=['babel.numbers'],
|
||||
datas=DATAS + blib2to3_data, # the latter required by black
|
||||
hiddenimports=[
|
||||
'babel.numbers',
|
||||
# The following modules are needed by "black": https://github.com/pyinstaller/pyinstaller/issues/8270
|
||||
'30fcd23745efe32ce681__mypyc',
|
||||
'6b397dd64e00b5aff23d__mypyc', 'click', 'json', 'platform',
|
||||
'mypy_extensions', 'pathspec', '_black_version', 'platformdirs'
|
||||
] + black_submodules + blib2to3_submodules, # the last two required by black
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
PyYAML
|
||||
pyyaml
|
||||
pyasn1==0.4.8
|
||||
git+https://github.com/etingof/pysnmp.git@master#egg=pysnmp
|
||||
pyasyncore;python_version>="3.12"
|
||||
tkcalendar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue