Skip to content

fix: prevent example collection crash for readme_generator#596

Merged
planetf1 merged 2 commits intogenerative-computing:mainfrom
planetf1:fix/example-collection-crash
Mar 6, 2026
Merged

fix: prevent example collection crash for readme_generator#596
planetf1 merged 2 commits intogenerative-computing:mainfrom
planetf1:fix/example-collection-crash

Conversation

@planetf1
Copy link
Contributor

@planetf1 planetf1 commented Mar 6, 2026

fix: prevent example collection crash for readme_generator

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Fixes: #592

This PR addresses a collection-time crash where the readme generator example attempted to initialize an Ollama backend during discovery.

Changes:

  1. Wrapped the generator call in a main guard to prevent execution during import, aligning with other complex examples. (this would avoid the crash. strictly not needed now due to 2. below, but is consistent with other examples)
  2. Patched the example configuration file to respect the skip marker during collection, ensuring skipped files are bypassed. (this was the actual cause of the crash)

Verified locally with collect-only.

Testing

  • Tests added to the respective file if code was changed (N/A - test infra)
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Mar 6, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@planetf1 planetf1 changed the title Fix/example collection crash fix: prevent example collection crash for readme_generator Mar 6, 2026
@planetf1 planetf1 marked this pull request as ready for review March 6, 2026 09:30
@planetf1 planetf1 requested a review from a team as a code owner March 6, 2026 09:30
@planetf1 planetf1 added this pull request to the merge queue Mar 6, 2026
Merged via the queue into generative-computing:main with commit 0e56243 Mar 6, 2026
8 of 9 checks passed
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.

example_readme_generator.py crashes at pytest collection time

2 participants