Skip to content

csv-to-babeltests CLI for generating BabelTests YAML (4/4)#104

Open
gaurav wants to merge 3 commits into
split/2-assertionsfrom
split/4-csv-tool
Open

csv-to-babeltests CLI for generating BabelTests YAML (4/4)#104
gaurav wants to merge 3 commits into
split/2-assertionsfrom
split/4-csv-tool

Conversation

@gaurav

@gaurav gaurav commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Stack 4 of 4 splitting #67. Base: split/2-assertions (PR #102) — independent of the GitHub-issue PR #103; only needs the assertions framework.

Cherry-picked (with authorship preserved) from #67: a click CLI that converts a CSV of test cases into a BabelTests YAML block, reusing the assertions handlers from PR #102. Adds click + pyyaml; registers the csv-to-babeltests script entry point.

Verify

  • uv run pytest tests/tools/test_csv_to_babeltests.py -q → 13 passed.
  • uv run csv-to-babeltests --help, or run it on a small sample CSV and eyeball the YAML.

🤖 Generated with Claude Code

gaurav and others added 3 commits June 26, 2026 01:03
…AML.

Translator collaborators sometimes circulate spreadsheets pairing a CURIE
column with a label, equivalent CURIE, or Biolink type. This adds a click
CLI that ingests such CSVs and emits a paste-ready YAML babel_tests block
for a GitHub issue, optionally validating each row against a NodeNorm
target from tests/targets.ini and reporting failures on stderr.

The tool reuses ASSERTION_HANDLERS and CachedNodeNorm directly so the
emitted YAML is guaranteed to match what GitHubIssuesTestCases parses,
and per-assertion semantics never drift between the two code paths.

Wires hatchling as the build backend (packaging src/ as-is so existing
`from src.babel_validation.X` imports keep working) so the
csv-to-babeltests console script can be exposed via [project.scripts].

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Importing the tool registered the _FlowList representer on the global
yaml.SafeDumper, changing YAML output process-wide. Move it onto a local
_BabelTestDumper subclass; emitter output is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gaurav added a commit that referenced this pull request Jun 26, 2026
The repo's `.gitignore` predates the Python rewrite — it only covered
Scala/Giter8/IntelliJ artifacts, so `__pycache__/` and `*.pyc` showed up
as untracked noise throughout the tree and were easy to `git add` by
accident.

Appends the standard [GitHub
`Python.gitignore`](https://github.com/github/gitignore/blob/main/Python.gitignore)
template (bytecode, `build/`/`dist/`, `.pytest_cache/`, `.venv`/`.env`,
mypy/coverage caches, …) below the existing entries, plus a `.DS_Store`
line for macOS. Existing entries are kept at the top, so this is purely
additive.

Independent of the #67 split stack (#101#104) and based on `main`, so
it can merge immediately. No files are currently tracked that the new
patterns would retroactively ignore — `git ls-tree` shows no
`.pyc`/`__pycache__` in the tree — so nothing needs `git rm --cached`.

### Verify
```
git check-ignore -v src/__pycache__/x.pyc .venv .env   # all matched
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant