diff --git a/BUILDING.md b/BUILDING.md index ebb1aed..c999f04 100644 --- a/BUILDING.md +++ b/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: @@ -8,15 +42,18 @@ Nuitka can be installed using pip -- I prefer not to do so globally, so I just r 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` 😉 ```powershell python -m nuitka ` --onefile ` - --enable-plugin=pyqt6 ` - --output-filename=Drum\ Track\ Converter.exe ` - --windows-icon-from-ico=icon.png ` + --enable-plugin=pyside6 ` + --enable-plugin=numpy ` + --follow-import-to=numpy ` + --include-package-data=demucs ` + --output-filename="Drum Track Converter.exe" ` + --windows-icon-from-ico=assets\icon.ico ` .\src\gui.py ``` diff --git a/Drum Track Converter.spec b/Drum Track Converter.spec new file mode 100644 index 0000000..159af0d --- /dev/null +++ b/Drum Track Converter.spec @@ -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'], +) diff --git a/build-config.json b/build-config.json new file mode 100644 index 0000000..cf45608 --- /dev/null +++ b/build-config.json @@ -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": "" + } +} \ No newline at end of file