-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ability to create a mepo binary that can uploaded as an artifa…
…ct of a Github actions workflow. Pyinstaller requires that the top level script not use relative imports
- Loading branch information
1 parent
dab118d
commit acdd32a
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
import os | ||
import glob | ||
|
||
cmd_dir = os.path.join(SPECPATH, 'src/mepo/command') | ||
cmd_list = [os.path.basename(x).split('.')[0] for x in glob.glob(os.path.join(cmd_dir, '*.py'))] | ||
hidden_imports = [f'mepo.command.{x}' for x in cmd_list if '_' not in x] # exclude subcommands | ||
print(f'hidden_imports: {hidden_imports}') | ||
|
||
a = Analysis( | ||
['src/mepo/__main__.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=hidden_imports, | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
noarchive=False, | ||
optimize=0, | ||
) | ||
pyz = PYZ(a.pure) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
[], | ||
exclude_binaries=True, | ||
name='mepo', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
console=True, | ||
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='mepo', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
PyYAML>=5.4 | ||
pylint>=3.1.0 | ||
pylint | ||
build | ||
twine | ||
pyinstaller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters