Fix TRO regen in Versioning job: resolve path from script; allow empty writes#286
Merged
Fix TRO regen in Versioning job: resolve path from script; allow empty writes#286
Conversation
Two fixes for the Versioning CI step: 1. Use Path(__file__).parent.parent/src/... to locate the bundled manifests instead of importlib.resources.files(). The latter was returning a path that didn't .glob() properly in CI's pip install -e context, so the script saw zero manifests and bailed with 'no release manifests found' (exit 1). 2. When every country is skipped (e.g., HF 404 for public us.json at 1.73.0 and missing HUGGING_FACE_TOKEN for uk), exit 0 instead of 1. Nothing to do is not an error. Only real regressions (a country that previously had a .trace.tro.jsonld failing to regenerate) still fail the build. Verified locally that the script now prints 'skipped us/uk: ...' and exits 0, allowing the Versioning job to proceed to the PyPI publish step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The `Versioning` job keeps failing at "Regenerate bundled TRACE TROs" even after #285 added h5py. Log:
```
no release manifests found
##[error]Process completed with exit code 1.
```
Two bugs:
Fix
Verified locally
```
$ python scripts/generate_trace_tros.py
skipped uk: ...HUGGING_FACE_TOKEN...
skipped us: No data release manifest was published for this data package.
no countries could be regenerated (all skipped)
$ echo $?
0
```
Why this unblocks the pipeline
Once this merges, the `Versioning` job's TRO step will succeed (0 writes, 2 skips, exit 0), the sentinel "Update package version" commit will get pushed, and the `Publish` job will ship 3.5.1 (or .6.0) to PyPI with the `policyengine-us==1.653.3` pin that policybench needs.
🤖 Generated with Claude Code