Skip to content

chore: bundle taxonomy.yaml and templates in wheel#57

Merged
shaypal5 merged 3 commits into
mainfrom
chore/bundle-data-files
May 3, 2026
Merged

chore: bundle taxonomy.yaml and templates in wheel#57
shaypal5 merged 3 commits into
mainfrom
chore/bundle-data-files

Conversation

@shaypal5
Copy link
Copy Markdown
Member

@shaypal5 shaypal5 commented May 2, 2026

Summary

Closes #4.

  • Moved configs/taxonomy.yaml into the package tree at synthbanshee/data/taxonomy.yaml
  • Switched taxonomy.py from __file__-relative path to importlib.resources, so the taxonomy is always loadable when installed from a wheel
  • Added Hatch artifacts config to include *.yaml, *.j2, and *.txt files inside synthbanshee/
  • Updated .gitignore to allow synthbanshee/data/ while keeping top-level data/ ignored
  • Updated all references to the old path in cli.py, iaa.py, dataset_card.py, AGENTS.md, and README.md

Changes by file

File Change
synthbanshee/data/taxonomy.yaml Moved from configs/taxonomy.yaml
synthbanshee/data/__init__.py New — makes synthbanshee.data a package for importlib.resources
synthbanshee/config/taxonomy.py Use importlib.resources instead of __file__-relative path
pyproject.toml Add [tool.hatch.build] artifacts for *.yaml, *.j2, *.txt
.gitignore Add !synthbanshee/data/ negation
synthbanshee/cli.py Update comment references
synthbanshee/labels/iaa.py Update comment reference
synthbanshee/package/dataset_card.py Update dataset card text
AGENTS.md Update taxonomy path in repo layout and label taxonomy section
README.md Update taxonomy path

Test plan

  • pytest — 1375 passed
  • ruff check — passed
  • mypy — passed (pre-existing errors only, no new ones)
  • Verify pip install . in a venv and synthbanshee --help works

🤖 Generated with Claude Code

Move configs/taxonomy.yaml into synthbanshee/data/ and load it via
importlib.resources so the CLI works when installed from a wheel.
Add Hatch build artifacts config for *.yaml, *.j2, and *.txt files
inside the package tree.

Closes #4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 10:48
@shaypal5 shaypal5 added the enhancement New feature or request label May 2, 2026
@github-actions

This comment has been minimized.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures internal runtime data (label taxonomy) and bundled templates are shipped inside the wheel so installs-from-wheel can always load required resources.

Changes:

  • Moves the label taxonomy YAML into the package (synthbanshee/data/taxonomy.yaml) and switches the loader to importlib.resources.
  • Adds Hatch build configuration to include non-Python package files (*.yaml, *.j2, *.txt) in wheel artifacts.
  • Updates docs/comments to reference the new taxonomy location and adjusts .gitignore to allow tracking synthbanshee/data/.

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
synthbanshee/data/taxonomy.yaml New in-package taxonomy source of truth for runtime loading.
synthbanshee/data/__init__.py Makes synthbanshee.data a package so importlib.resources can resolve files.
synthbanshee/config/taxonomy.py Loads taxonomy via importlib.resources instead of __file__-relative paths.
pyproject.toml Adds Hatch build artifacts patterns to include YAML/Jinja2/TXT files.
.gitignore Un-ignores synthbanshee/data/ while keeping top-level data/ ignored.
synthbanshee/cli.py Updates taxonomy path references in comments/error messaging.
synthbanshee/labels/iaa.py Updates taxonomy path reference in comment.
synthbanshee/package/dataset_card.py Updates dataset card text to reference new taxonomy path.
AGENTS.md Documents new repo layout and taxonomy path.
README.md Updates taxonomy path reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread synthbanshee/cli.py
Comment thread synthbanshee/config/taxonomy.py Outdated
@github-actions

This comment has been minimized.

…es, fix error message

- Pass `synthbanshee.data` module object to `resources.files()` instead
  of a hardcoded string (COPILOT-2).
- Rephrase error message to direct users to `_EMOTION_ALIASES` or
  reinstall, since bundled YAML isn't user-editable in site-packages
  (COPILOT-1).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

- Remove `[tool.hatch.build] artifacts` — Hatch already includes
  non-py files inside declared packages by default (verified by
  inspecting built wheel).
- Update remaining `configs/taxonomy.yaml` references in
  docs/implementation_plan.md, docs/audio_generation_v3_design.md,
  and llms.txt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 11:47
@github-actions

This comment has been minimized.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread synthbanshee/cli.py
Comment thread synthbanshee/config/taxonomy.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

pr-agent-context report:

This is a refreshed snapshot of the current PR state.

This run includes unresolved review comments on PR #57 in repository https://github.com/DataHackIL/SynthBanshee

For each unresolved review comment, recommend one of: resolve as irrelevant, accept and implement
the recommended solution, open a separate issue and resolve as out-of-scope for this PR, accept and
implement a different solution, or resolve as already treated by the code.

After I reply with my decision per item, implement the accepted actions, resolve the corresponding
PR comments, and push all of these changes in a single commit.

# Copilot Comments

## COPILOT-1
Location: synthbanshee/cli.py:190
URL: https://github.com/DataHackIL/SynthBanshee/pull/57#discussion_r3176579737
Root author: copilot-pull-request-reviewer

Comment:
    This error message suggests “add it to taxonomy.yaml and reinstall”, but doesn’t say which file (the taxonomy is now bundled under `synthbanshee/data/taxonomy.yaml`). To reduce confusion for users installing from wheels, consider explicitly naming the path (and/or clarifying that this requires changing the source tree and reinstalling) rather than implying there’s an editable local `taxonomy.yaml`.

## COPILOT-2
Location: synthbanshee/config/taxonomy.py:20
URL: https://github.com/DataHackIL/SynthBanshee/pull/57#discussion_r3176579741
Root author: copilot-pull-request-reviewer

Comment:
    `load_taxonomy()` now reads `taxonomy.yaml` via `importlib.resources`, which will fail at runtime if `synthbanshee/data/taxonomy.yaml` is not included in the built wheel. In the current `pyproject.toml`, `[tool.hatch.build.targets.wheel]` only lists `packages = ["synthbanshee"]` and does not include any Hatchling include/artifact rules for `*.yaml`/`*.j2`/`*.txt`, so both the taxonomy and Jinja2 templates are likely to be omitted from the wheel. Please add explicit wheel include rules (or equivalent Hatchling config) so these non-`.py` files are packaged.

Run metadata:

Tool ref: v4
Tool version: 4.0.21
Trigger: schedule
Workflow run: 25251369256 attempt 1
Comment timestamp: 2026-05-02T11:58:02.925076+00:00
PR head commit: 8a22f7640e5f8baade5b13d5819e002566aebd3c

@shaypal5 shaypal5 merged commit 0039502 into main May 3, 2026
10 checks passed
@shaypal5 shaypal5 deleted the chore/bundle-data-files branch May 3, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: bundle internal data files in wheel (taxonomy.yaml, Jinja2 templates)

2 participants