Skip to content

Bundle demo-catalog flow YAMLs for PyInstaller#548

Open
Edwardvaneechoud wants to merge 1 commit into
mainfrom
claude/relaxed-turing-cw53ie
Open

Bundle demo-catalog flow YAMLs for PyInstaller#548
Edwardvaneechoud wants to merge 1 commit into
mainfrom
claude/relaxed-turing-cw53ie

Conversation

@Edwardvaneechoud

@Edwardvaneechoud Edwardvaneechoud commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds PyInstaller data collection for demo-catalog flow YAML files to ensure they are bundled correctly in the compiled application. Without this, the demo catalog seeding fails at runtime because PyInstaller stores .py files as bytecode only, making relative YAML file lookups inaccessible.

Changes

  • New function get_demo_flows_datas(): Collects the demo_flows/ directory from flowfile_core/flowfile_core/catalog/ and maps it for PyInstaller bundling to flowfile_core/catalog/demo_flows in the built application.
  • Updated Analysis datas: Adds demo_flows_datas to the PyInstaller Analysis datas list alongside existing data collections (numpy, pyarrow, connectorx, alembic, code_generator, etc.).

Implementation Details

  • The function mirrors the pattern of existing data collectors (get_code_generator_datas(), get_alembic_datas()) with a directory existence check.
  • Preserves the relative path structure expected by demo_seed.py at runtime, which reads flows via Path(__file__).parent / "demo_flows".
  • Ensures demo catalog initialization works correctly in PyInstaller-bundled distributions.

https://claude.ai/code/session_01PWr1cBV6omT7tYQcybqXNH

Summary by CodeRabbit

  • New Features
    • Packaged builds now include demo flow examples, so the app can ship with the full set of demo catalog content available out of the box.

The desktop (Tauri) app freezes the Python backend with PyInstaller, which
stores .py modules as bytecode but does not include arbitrary data files
unless they are listed in the spec's `datas`. The demo-catalog flow YAMLs
(`flowfile_core/catalog/demo_flows/*.yaml`) were only declared for the PyPI
sdist/wheel, so in the packaged app `demo_seed.py` resolved
`Path(__file__).parent / "demo_flows"` to a directory with no YAMLs and
seeding raised:

    FileNotFoundError: Flow file not found:
    .../Resources/binaries/_internal/flowfile_core/catalog/demo_flows/demo_sales_by_region.yaml

Add `get_demo_flows_datas()` (mirroring the existing alembic / project_shim
helpers) and wire it into the Analysis `datas` so both demo flows ship under
`flowfile_core/catalog/demo_flows/` in the bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWr1cBV6omT7tYQcybqXNH
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d14a9ae-ad06-43f2-ab18-a4ec7d7982fb

📥 Commits

Reviewing files that changed from the base of the PR and between b21f518 and 631dee7.

📒 Files selected for processing (1)
  • build_backends/build_backends/main.py

📝 Walkthrough

Walkthrough

The PyInstaller spec generator in build_backends/build_backends/main.py gains a get_demo_flows_datas() helper embedded in the generated spec string. It locates flowfile_core/flowfile_core/catalog/demo_flows and returns it as a PyInstaller datas tuple when present. The result is appended to the Analysis(datas=...) list so demo flow YAMLs are bundled in the built application.

Changes

Demo-catalog YAML bundling in PyInstaller spec

Layer / File(s) Summary
Add demo_flows_datas helper and wire into Analysis
build_backends/build_backends/main.py
Embeds get_demo_flows_datas() in the generated spec string to collect demo-catalog YAMLs from flowfile_core/.../catalog/demo_flows when the directory exists, and includes the result in the Analysis(datas=...) composition.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop hop, the YAML files are packed,
Demo flows now neatly stacked,
A helper checks the folder's there,
Then bundles everything with care.
No flow left behind — that's a fact! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: packaging demo-catalog flow YAMLs into the PyInstaller build.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/relaxed-turing-cw53ie

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for flowfile-wasm canceled.

Name Link
🔨 Latest commit 631dee7
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/6a3bf521df8524000886094f

1 similar comment
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for flowfile-wasm canceled.

Name Link
🔨 Latest commit 631dee7
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/6a3bf521df8524000886094f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants