Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Downgrade pyinstaller and add static SpeechJokey.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
HackXIt committed Nov 27, 2023
1 parent 3c6f51b commit 1fdd9ee
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 109 deletions.
46 changes: 2 additions & 44 deletions .github/scripts/windows/build_exe_onefile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,9 @@ poetry install --only main --no-root
# Create SpeechJokey.spec file
$Target = 'SpeechJokey'
$TargetSpecFile = "$Target.spec"
@"
# -*- mode: python ; coding: utf-8 -*-
from kivy_deps import sdl2, glew
from kivymd import hooks_path as kivymd_hooks_path

block_cipher = None
app_name = 'SpeechJokey'
#win_icon = '.\icon.ico'
a = Analysis(
['src\\main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[kivymd_hooks_path],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
Tree('src\\'),
a.scripts,
a.binaries,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
name=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
"@ | Set-Content $TargetSpecFile
# Copy SpeechJokey.spec from .github/static to the current directory
Copy-Item ".github/static/$TargetSpecFile" -Destination "."

# Remove null bytes from spec file (PyInstaller compatibility issue)
(Get-Content .\$TargetSpecFile) -replace "`0", "" | Set-Content .\$TargetSpecFile
Expand Down
43 changes: 43 additions & 0 deletions .github/static/SpeechJokey.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- mode: python ; coding: utf-8 -*-
from kivy_deps import sdl2, glew
from kivymd import hooks_path as kivymd_hooks_path

block_cipher = None
app_name = 'SpeechJokey'
#win_icon = '.\icon.ico'

a = Analysis(
['src\\main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[kivymd_hooks_path],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
Tree('src\\'),
a.scripts,
a.binaries,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
name=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# VSCode environment
.vscode/.history


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -34,6 +35,8 @@ MANIFEST
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Do not ignore spec files for workflow
!/.github/static/*.spec

# Installer logs
pip-log.txt
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To run the application, execute the following command in the root of the project
poetry run python src/main.py
```

## Building the application executable (Windows / Production)
## Building the application executable (Windows / Local Development)
To build the application, execute the following command in the root of the project:
_(You might wanna grab a coffee while running this)_
```
Expand All @@ -70,6 +70,12 @@ Inside the `dist` output folder a folder with the name `SpeechJokey` can be foun
For a detailed step-by-step guide on how to build a Kivy application, see [this written tutorial](https://github.com/CovidCoder/Kivy-App-Package-Windows-Tutorial/blob/master/KivyPackageTut.md).
_(Keep in mind that the tutorial doesn't use poetry, so any command should be preceeded by `poetry run`)_

## Building the application executable (Windows / CI)
To build the application similar to how it would be built by the CI, copy the `SpeechJokey.spec` from `.github\static` to the project root and then execute the following command in the root of the project:
```
poetry run pyinstaller SpeechJokey.spec
```

# Tutorials for beginner contributors
## How to use Git
Git is a version control system. It allows you to keep track of changes made to your code and to collaborate with others. To learn more about Git, see [this fundamental beginner tutorial](https://www.youtube.com/watch?v=HVsySz-h9r4).
Expand Down
79 changes: 16 additions & 63 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python = ">=3.9,<3.12" # Lower than 3.12 because of kiv
kivy = { version = "2.2.1", extras = ["base"] }
six = "^1.16.0"
buildozer = "^1.5.0"
pyinstaller = "^6.2.0"
pyinstaller = "^5.6.2"
kivymd = "^1.1.1"

[build-system]
Expand Down

0 comments on commit 1fdd9ee

Please sign in to comment.