Library packaging: import as babel_validation + split runtime/dev deps#95
Open
gaurav wants to merge 2 commits into
Open
Library packaging: import as babel_validation + split runtime/dev deps#95gaurav wants to merge 2 commits into
gaurav wants to merge 2 commits into
Conversation
Mechanical rename of every dotted module reference (imports, `python -m` commands, and doc strings) from `src.babel_validation` to `babel_validation`, so consumers import the library as `babel_validation` rather than the non-idiomatic `src.` prefix. Filesystem paths (`src/babel_validation/...` in comments/docs) are unchanged; the code still lives under src/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Ship src/babel_validation as the top-level wheel package (was the whole src/ dir), and drop the now-dead src/__init__.py. - Point the csv-to-babeltests script at babel_validation.tools.*. - Keep only runtime deps (requests, pyyaml, pygithub, python-dotenv, click, tqdm, filelock) in [project.dependencies] so library consumers don't pull the test stack. Move pytest/xdist/subtests/timeout/deepdiff/ openapi-spec-validator/black into a uv [dependency-groups] dev group, which `uv run`/`uv sync` install for local dev + CI but never ships to consumers. PyGitHub stays a core dependency: issue-test definitions live in GitHub issues, so every consumer needs it to fetch them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Packaging-focused change to make src/babel_validation install as the canonical import package babel_validation (dropping the src. import prefix), while separating runtime dependencies from development/testing dependencies.
Changes:
- Renames imports across tests and library code from
src.babel_validation.*tobabel_validation.*, and updates doc regeneration commands accordingly. - Adjusts wheel packaging to ship only
src/babel_validationas the top-level wheel package and repoints thecsv-to-babeltestsconsole script. - Splits runtime vs dev dependencies using uv dependency groups and updates
uv.lockto reflect the split.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Moves pytest/formatting/validation tools into a dev dependency group in the lockfile metadata. |
| pyproject.toml | Updates runtime deps vs dev dependency group, repoints console script, and changes hatch wheel packaging to ship babel_validation as the top-level package. |
| src/init.py | Removes the now-dead src package marker to prevent import src... after install. |
| src/babel_validation/tools/csv_to_babeltests.py | Updates internal imports to use the new babel_validation.* package path. |
| src/babel_validation/sources/google_sheets/google_sheet_test_cases.py | Updates TestRow import to the new babel_validation.* path. |
| src/babel_validation/sources/github/github_issues_test_cases.py | Updates service/assertion imports to the new babel_validation.* path. |
| src/babel_validation/assertions/init.py | Updates internal imports and regeneration instructions to babel_validation.*. |
| src/babel_validation/assertions/common.py | Updates base-class import to babel_validation.assertions. |
| src/babel_validation/assertions/gen_docs.py | Updates module invocation instructions and imports to babel_validation.*. |
| src/babel_validation/assertions/nodenorm.py | Updates imports to babel_validation.*. |
| src/babel_validation/assertions/nameres.py | Updates imports to babel_validation.*. |
| src/babel_validation/assertions/README.md | Updates auto-generated regeneration commands to babel_validation.*. |
| tests/tools/test_csv_to_babeltests.py | Updates imports to babel_validation.* (including handler registry import). |
| tests/test_environment/test_env.py | Updates imports to babel_validation.*. |
| tests/test_environment/test_assertions_docs.py | Updates imports and regeneration instruction string to babel_validation.*. |
| tests/nodenorm/test_nodenorm_from_gsheet.py | Updates imports to babel_validation.*. |
| tests/nameres/test_nameres_from_gsheet.py | Updates imports to babel_validation.*. |
| tests/nameres/test_blocklist.py | Updates imports to babel_validation.*. |
| tests/github_issues/test_system.py | Updates imports to babel_validation.*. |
| tests/github_issues/test_github_issues.py | Updates imports to babel_validation.*. |
| tests/github_issues/conftest.py | Updates imports to babel_validation.*. |
| CLAUDE.md | Updates contributor guidance examples to use babel_validation.* imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
12
to
16
| dependencies = [ | ||
| "black>=25.9.0", | ||
| "click>=8.1", | ||
| "pyyaml>=6.0", | ||
| "requests>=2.32.5", | ||
| "tqdm>=4.67.1", |
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.
Stacked on #67 (base branch is
add-github-issue-tests, notmain). This is the first of two follow-up PRs that make the GitHub-issue test framework usable as an installable library; see #67 for how they relate.This PR is the packaging groundwork — no behavior change.
Changes
src.babel_validation→babel_validation(40 references across 17 files; purely mechanical). Filesystem paths (src/babel_validation/...in comments/docs) are unchanged — the code still lives undersrc/.src/babel_validationas the top-level wheel package (was the wholesrc/dir), so consumersimport babel_validationrather than the non-idiomaticsrc.prefix (which could also collide with a consumer's own top-levelsrc/). Drops the now-deadsrc/__init__.py.csv-to-babeltestsconsole script atbabel_validation.tools.*.requests,pyyaml,pygithub,python-dotenv,click,tqdm,filelock) in[project.dependencies]so library consumers don't pull the test stack. Movepytest/pytest-xdist/pytest-subtests/pytest-timeout/deepdiff/openapi-spec-validator/blackinto a uv[dependency-groups] devgroup —uv run/uv syncinstall it for local dev + CI, but it is never shipped to consumers.PyGitHub stays a core dependency: issue-test definitions live in GitHub issues, so every consumer needs it to fetch them.
Verification
uv run pytest -m unit→ green (49 passed).uv buildproduces a wheel whose only top-level entry isbabel_validation(nosrc/);import babel_validationworks;import src.babel_validationno longer resolves from an install.🤖 Generated with Claude Code