-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a section to convert the app to an executable to examples (#2100)
* add a section to convert the app to an executable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix vocabulary mistakes * add "datas" to the accepted list of word for codespell * Apply suggestions from code review Co-authored-by: German <[email protected]> * add details * fix vale * Apply suggestions from code review Co-authored-by: Kathy Pippert <[email protected]> * Apply suggestions from code review Co-authored-by: Kathy Pippert <[email protected]> * put the links in links.rst --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Camille <[email protected]> Co-authored-by: German <[email protected]> Co-authored-by: Kathy Pippert <[email protected]> Co-authored-by: German <[email protected]>
- Loading branch information
1 parent
c03293f
commit b38593e
Showing
4 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
doc/source/examples/extended_examples/executable/cli_rotor.spec
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,59 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
import os | ||
import importlib | ||
|
||
root = os.path.dirname(importlib.import_module("ansys.api.mapdl").__file__) | ||
# The ``files_to_add`` list contains tuples that define the mapping between the original file paths and their corresponding paths within the executable folder. | ||
# Note: If you have chosen the ``onefile`` mode, the files in ``files_to_add`` are integrated into the executable file. | ||
files_to_add = [ | ||
(os.path.join(root, "VERSION"), os.path.join(".", "ansys", "api", "mapdl")) | ||
] | ||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis( | ||
['cli_rotor.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=files_to_add, | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
[], | ||
exclude_binaries=True, | ||
name='cli_rotor', | ||
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.zipfiles, | ||
a.datas, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
name='cli_rotor', | ||
) |
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
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
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