Skip to content

Commit

Permalink
Attempting fixing Nuitka workflow ignoring include-data-dir directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shararamosh committed Oct 28, 2024
1 parent eebab8c commit 1445a66
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
jobs:
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Checkout
Expand All @@ -15,9 +16,12 @@ jobs:
with:
python-version: "3.11"
- name: Install requirements
run: pip install pillow tqdm i18nice[YAML] pyinstaller
run: pip install -r requirements.txt
- name: Install PyInstaller
run: pip install pyinstaller
- name: Run PyInstaller for Deserializer, Downloader and Batch Deserializer
run: |
set PYTHONOPTIMIZE=2
pyinstaller --onefile --name="flatc_deserializer" --console --icon=images\flatbuffers-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_deserializer.py
pyinstaller --onefile --name="flatc_downloader" --console --icon=images\flatbuffers-downloader-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_downloader.py
pyinstaller --onefile --name="flatc_deserializer_batch" --console --icon=images\flatbuffers-batch-logo-clean.png --add-data="images:images" --add-data="localization:localization" flatc_deserializer_batch.py
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/build_executable_nuitka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
jobs:
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Checkout
Expand All @@ -15,7 +16,7 @@ jobs:
with:
python-version: "3.11"
- name: Install requirements
run: pip install pillow tqdm i18nice[YAML] imageio
run: pip install -r requirements.txt
- name: Run Nuitka for Deserializer
uses: Nuitka/Nuitka-Action@main
with:
Expand All @@ -24,8 +25,10 @@ jobs:
onefile: true
enable-plugins: tk-inter
include-data-dir: |
localization=localization
images=images
.\localization=localization
.\images=images
product-name: Flatbuffers Deserializer
file-description: Program for deserialization of Flatbuffers binary files based on single schema.
windows-icon-from-ico: "images/flatbuffers-logo-clean.png"
- name: Run Nuitka for Downloader
uses: Nuitka/Nuitka-Action@main
Expand All @@ -35,8 +38,10 @@ jobs:
onefile: true
enable-plugins: tk-inter
include-data-dir: |
localization=localization
images=images
.\localization=localization
.\images=images
product-name: Flatbuffers Schema Compiler Downloader
file-description: Program for downloading latest version of Flatbuffers schema compiler for Windows.
windows-icon-from-ico: "images/flatbuffers-downloader-logo-clean.png"
- name: Run Nuitka for Batch Deserializer
uses: Nuitka/Nuitka-Action@main
Expand All @@ -46,8 +51,10 @@ jobs:
onefile: true
enable-plugins: tk-inter
include-data-dir: |
localization=localization
images=images
.\localization=localization
.\images=images
product-name: Flatbuffers Batch Deserializer
file-description: Program for deserialization of Flatbuffers binary files based on multiple schemas.
windows-icon-from-ico: "images/flatbuffers-batch-logo-clean.png"
- name: Move Executables from build to root directory
run: |
Expand Down
4 changes: 2 additions & 2 deletions flatc_deserializer_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
if __name__ == "__main__":
sys.tracebacklimit = 0
init_app("images/flatbuffers-batch-logo-clean.png")
parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_name"),
description=t("main.flatc_deserializer_desc"))
parser = argparse.ArgumentParser(prog=t("main.flatc_deserializer_batch_name"),
description=t("main.flatc_deserializer_batch_desc"))
parser.add_argument("-s", "--schemas_path", type=str, default="",
help=t("main.schemas_directory_arg"))
parser.add_argument("-b", "--binaries_path", type=str, default="",
Expand Down
10 changes: 6 additions & 4 deletions localization/en_US/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
tkinter_flatc_select: Select schema compiler
exe_filetype: Windows Executable
tkinter_fbs_select: Select schema file
fbs_filetype: Flatbuffers scheme
fbs_filetype: Flatbuffers schema
tkinter_binaries_select: Select binary files
flatc_binary_filetype: Binary Flatbuffers file
tkinter_output_select: Select output directory
files: Files
unsupported_platform: "Can't run on unsupported platform: %s."
unsupported_platform: "%s platform is not supported."
executable_not_found: Executable %s not found.
file_not_found: File %s not found.
directory_not_found: Directory %s not found.
Expand All @@ -22,8 +22,10 @@ output_directory_arg: Output directory for deserialized files
schema_file_arg: Schema file
binary_files_arg: Binary files
flatc_path_arg: Path to schema compiler (flatc)
flatc_deserializer_name: Flatbuffers Batch Deserializer
flatc_deserializer_desc: Program for batch deserialization of Flatbuffers binary files.
flatc_deserializer_name: Flatbuffers Deserializer
flatc_deserializer_desc: Program for deserialization of Flatbuffers binary files based on single schema.
flatc_deserializer_batch_name: Flatbuffers Batch Deserializer
flatc_deserializer_batch_desc: Program for deserialization of Flatbuffers binary files based on multiple schemas.
file_failed_to_open: Failed to open file %s.
flatc_downloader_name: Flatbuffers Schema Compiler Downloader
flatc_downloader_desc: Program for downloading latest version of Flatbuffers schema compiler for this platform.
Expand Down
8 changes: 5 additions & 3 deletions localization/ru_RU/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tkinter_binaries_select: Выбор бинарных файлов
flatc_binary_filetype: Бинарный файл Flatbuffers
tkinter_output_select: Выбор директории вывода
files: Файлы
unsupported_platform: "Запуск невозможен на неподдерживаемой платформе: %s."
unsupported_platform: "Платформа %s не поддерживается."
executable_not_found: Исполняемый файл %s не найден.
file_not_found: Файл %s не найден.
directory_not_found: Директория %s не найдена.
Expand All @@ -22,8 +22,10 @@ output_directory_arg: Директория вывода для десериал
schema_file_arg: Файл схемы
binary_files_arg: Бинарные файлы
flatc_path_arg: Путь к компилятору схемы (flatc)
flatc_deserializer_name: Flatbuffers Batch Deserializer
flatc_deserializer_desc: Программа для пакетной десериализации бинарных файлов Flatbuffers.
flatc_deserializer_name: Flatbuffers Deserializer
flatc_deserializer_desc: Программа для десериализации бинарных файлов Flatbuffers, основанных на одной схеме.
flatc_deserializer_batch_name: Flatbuffers Batch Deserializer
flatc_deserializer_batch_desc: Программа для десериализации бинарных файлов Flatbuffers, основанных на нескольких схемах.
file_failed_to_open: Не удалось открыть файл %s.
flatc_downloader_name: Flatbuffers Schema Compiler Downloader
flatc_downloader_desc: Программа для скачивания последней версии компилятора схемы Flatbuffers для данной платформы.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
"i18nice[YAML]"
]
authors = [{name = "Shararamosh"}]
description = "Program for batch deserialization of Flatbuffers binary files."
description = "Program for deserialization of Flatbuffers binary files based on single or multiple schemas."
keywords = [
"json",
"flatbuffers",
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pillow
tqdm
i18nice[YAML]

0 comments on commit 1445a66

Please sign in to comment.