Skip to content

fix: include all data files in package (not just *.json) - #1

Merged
niccokunzmann merged 1 commit into
pycalendar:mainfrom
tobixen:fix-missing-md-package-data
Apr 19, 2026
Merged

fix: include all data files in package (not just *.json)#1
niccokunzmann merged 1 commit into
pycalendar:mainfrom
tobixen:fix-missing-md-package-data

Conversation

@tobixen

@tobixen tobixen commented Apr 17, 2026

Copy link
Copy Markdown
Member

A trivial bugfix ... the diff is probably more informative than the blob below:

⚠️ This comment is AI-generated (Claude Sonnet 4.6 via Claude Code) on behalf of tobixen ⚠️

Summary

  • prepare_repository.py (added in v0.0.7) reads data/assistant-guidelines.md via importlib.resources
  • The [tool.setuptools.package-data] glob was data/*.json, so .md files were excluded from the built distribution
  • At runtime this causes FileNotFoundError: No such file or directory: '.../data/assistant-guidelines.md'

Fix

Change the glob from data/*.json to data/* so all data files are included.

Reproduction

pre-commit run --hook-stage manual prepare-ai-repository

Fails with:

FileNotFoundError: [Errno 2] No such file or directory: '.../ai_prompt_auto_commit/data/assistant-guidelines.md'

⚠️ This comment is AI-generated (Claude Sonnet 4.6 via Claude Code) on behalf of tobixen ⚠️

prepare_repository.py reads data/assistant-guidelines.md (added in v0.0.7)
but the package-data glob was data/*.json, so the .md file was never
included in the built wheel/sdist, causing FileNotFoundError at runtime.

prompt: Write a PR for the upstream packaging bug found when adding ai-prompt-auto-commit to https://github.com/tobixen/caldav-server-tester — v0.0.7 fails with FileNotFoundError because assistant-guidelines.md is not included in the package data (only data/*.json is matched)
@niccokunzmann
niccokunzmann merged commit 959d0e9 into pycalendar:main Apr 19, 2026
6 checks passed
@niccokunzmann

Copy link
Copy Markdown
Member

Thanks!

@niccokunzmann

Copy link
Copy Markdown
Member

Included in v0.0.8

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