Add build-config, spec and building instructions
This commit is contained in:
parent
3012155649
commit
401f7f8481
3 changed files with 188 additions and 6 deletions
49
BUILDING.md
49
BUILDING.md
|
|
@ -1,6 +1,40 @@
|
||||||
# Building using Nuitka
|
# Building using PyInstaller
|
||||||
|
|
||||||
## Installing Nuitka
|
### First, install PyInstaller:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
pip install pyinstaller
|
||||||
|
```
|
||||||
|
|
||||||
|
### Then build the application:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
pyinstaller `
|
||||||
|
--noconfirm `
|
||||||
|
--onefile `
|
||||||
|
--windowed `
|
||||||
|
--icon ".\assets\icon.ico" `
|
||||||
|
--name "Drum Track Converter" `
|
||||||
|
--add-data ".\src;src/" `
|
||||||
|
--add-data=".\assets\icon.ico;assets/icon.ico." `
|
||||||
|
--add-data ".\.venv\Lib\site-packages\demucs\remote;demucs/remote/" `
|
||||||
|
--hidden-import "eyed3" `
|
||||||
|
--hidden-import "demucs" `
|
||||||
|
--hidden-import "tinytag" `
|
||||||
|
--hidden-import "wavinfo" `
|
||||||
|
--hidden-import "numpy" `
|
||||||
|
--collect-submodules "demucs" `
|
||||||
|
--collect-submodules "numpy" `
|
||||||
|
".\src\gui.py"
|
||||||
|
```
|
||||||
|
|
||||||
|
# Outdated Nuitka Building Guide
|
||||||
|
|
||||||
|
### I wanted to use Nuitka, but ran into problems with Numpy
|
||||||
|
|
||||||
|
As a result, PyInstaller has been used instead. Outdated instructions are stilli included just in case :)
|
||||||
|
|
||||||
|
### Installing Nuitka
|
||||||
|
|
||||||
Nuitka can be installed using pip -- I prefer not to do so globally, so I just run the module later on rather than the global `nuitka` command. Install Nuitka via:
|
Nuitka can be installed using pip -- I prefer not to do so globally, so I just run the module later on rather than the global `nuitka` command. Install Nuitka via:
|
||||||
|
|
||||||
|
|
@ -8,15 +42,18 @@ Nuitka can be installed using pip -- I prefer not to do so globally, so I just r
|
||||||
pip install nuitka
|
pip install nuitka
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building to a single executable
|
### Building to a single executable
|
||||||
|
|
||||||
Again, if you install `nuitka` globally using the `-u` switch, then replace `python -m nuitka` with just `nuitka` 😉
|
Again, if you install `nuitka` globally using the `-u` switch, then replace `python -m nuitka` with just `nuitka` 😉
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
python -m nuitka `
|
python -m nuitka `
|
||||||
--onefile `
|
--onefile `
|
||||||
--enable-plugin=pyqt6 `
|
--enable-plugin=pyside6 `
|
||||||
--output-filename=Drum\ Track\ Converter.exe `
|
--enable-plugin=numpy `
|
||||||
--windows-icon-from-ico=icon.png `
|
--follow-import-to=numpy `
|
||||||
|
--include-package-data=demucs `
|
||||||
|
--output-filename="Drum Track Converter.exe" `
|
||||||
|
--windows-icon-from-ico=assets\icon.ico `
|
||||||
.\src\gui.py
|
.\src\gui.py
|
||||||
```
|
```
|
||||||
|
|
|
||||||
44
Drum Track Converter.spec
Normal file
44
Drum Track Converter.spec
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
from PyInstaller.utils.hooks import collect_submodules
|
||||||
|
|
||||||
|
hiddenimports = ['eyed3', 'demucs', 'tinytag', 'wavinfo', 'numpy']
|
||||||
|
hiddenimports += collect_submodules('demucs')
|
||||||
|
hiddenimports += collect_submodules('numpy')
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['src\\gui.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[('.\\src', 'src/'), ('.\\assets\\icon.ico', 'assets/icon.ico.'), ('.\\.venv\\Lib\\site-packages\\demucs\\remote', 'demucs/remote/')],
|
||||||
|
hiddenimports=hiddenimports,
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
noarchive=False,
|
||||||
|
optimize=0,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='Drum Track Converter',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
icon=['assets\\icon.ico'],
|
||||||
|
)
|
||||||
101
build-config.json
Normal file
101
build-config.json
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
{
|
||||||
|
"version": "auto-py-to-exe-configuration_v1",
|
||||||
|
"pyinstallerOptions": [
|
||||||
|
{
|
||||||
|
"optionDest": "noconfirm",
|
||||||
|
"value": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "filenames",
|
||||||
|
"value": "C:/Users/Jose/Documents/Code/Drum-Track-Converter/src/gui.py"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "onefile",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "console",
|
||||||
|
"value": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "icon_file",
|
||||||
|
"value": "C:/Users/Jose/Documents/Code/Drum-Track-Converter/assets/icon.ico"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "name",
|
||||||
|
"value": "DTS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "clean_build",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "strip",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "noupx",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "disable_windowed_traceback",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "uac_admin",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "uac_uiaccess",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "argv_emulation",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "bootloader_ignore_signals",
|
||||||
|
"value": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "datas",
|
||||||
|
"value": "C:/Users/Jose/Documents/Code/Drum-Track-Converter/src;src/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "hiddenimports",
|
||||||
|
"value": "eyed3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "hiddenimports",
|
||||||
|
"value": "demucs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "hiddenimports",
|
||||||
|
"value": "tinytag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "hiddenimports",
|
||||||
|
"value": "wavinfo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "collect_submodules",
|
||||||
|
"value": "demucs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "datas",
|
||||||
|
"value": "C:/Users/Jose/Documents/Code/Drum-Track-Converter/.venv/Lib/site-packages/demucs/remote;demucs/remote/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "collect_submodules",
|
||||||
|
"value": "numpy"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"optionDest": "hiddenimports",
|
||||||
|
"value": "numpy"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"nonPyinstallerOptions": {
|
||||||
|
"increaseRecursionLimit": true,
|
||||||
|
"manualArguments": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue