Skip to content

Consolidate scripts at the repo root#936

Merged
Kludex merged 3 commits into
pydantic:mainfrom
mbeijen:fix/unasync-paths-for-httpcore2-layout
May 14, 2026
Merged

Consolidate scripts at the repo root#936
Kludex merged 3 commits into
pydantic:mainfrom
mbeijen:fix/unasync-paths-for-httpcore2-layout

Conversation

@mbeijen

@mbeijen mbeijen commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • src/httpcore2/scripts/unasync.py still references upstream encode/httpcore's directory paths (httpcore/_async, httpcore/_sync, tests/_async, tests/_sync). In this fork the package is httpcore2/ and the test tree lives at tests/httpcore2/_{async,sync}/ (relative to the repo root, i.e. ../../tests/httpcore2/_{async,sync}/ from src/httpcore2/).
  • With the stale paths, os.walk finds nothing, no substitutions ever fire, and python scripts/unasync.py --check exits 1 with "These patterns were not used" — meaning src/httpcore2/scripts/check has been silently broken on main since the fork. Top-level CI didn't catch this because scripts/check at the repo root doesn't invoke the per-package check.
  • Two-line change to main() in unasync.py pointing it at the correct trees.

Test plan

  • cd src/httpcore2 && python scripts/unasync.py --check exits 0 on main after this change (was exit 1 before).
  • cd src/httpcore2 && python scripts/unasync.py (regen) produces zero file diffs against main, confirming the existing _sync/ trees are already consistent with their _async/ sources — this is purely fixing the tooling, no code drift to clean up.

🤖 Generated with Claude Code

mbeijen and others added 2 commits May 14, 2026 10:09
`scripts/unasync.py` still referenced upstream `encode/httpcore`'s
paths (`httpcore/_async`, `httpcore/_sync` and `tests/_async`,
`tests/_sync`). In this fork the package directories are
`httpcore2/_async` and `httpcore2/_sync`, and the test trees live
at the repo root in `tests/httpcore2/_{async,sync}/` rather than
under `src/httpcore2/tests/`.

With the stale paths, `os.walk` finds nothing, no substitutions
ever fire, and `scripts/unasync.py --check` exits 1 with "These
patterns were not used" — meaning `src/httpcore2/scripts/check`
has been silently failing on `main` since the fork, but nothing
in top-level CI invokes it so the breakage went unnoticed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move unasync.py and benchmark from src/httpcore2/scripts/ to the
top-level scripts/ directory and drop the rest of the inner scripts.

- scripts/unasync.py: paths repointed to repo-root-relative
  (src/httpcore2/httpcore2/_{async,sync} and tests/httpcore2/_{async,sync}).
- scripts/check: now runs `python scripts/unasync.py --check`.
- scripts/lint: now runs `python scripts/unasync.py` after ruff.
- scripts/benchmark: switched to `uv run python` and the
  tests/httpcore2/benchmark/ paths used in this fork.
@Kludex Kludex changed the title Fix unasync.py paths for the httpcore2 repo layout Consolidate scripts at the repo root May 14, 2026
@Kludex Kludex enabled auto-merge (squash) May 14, 2026 14:01
@Kludex Kludex merged commit 3d1a76c into pydantic:main May 14, 2026
8 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.

2 participants