Bootstrap uv workflow and initial ty config#746
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bootstraps a uv-based developer workflow for the project (while keeping mypy as the primary type checker), adds an initial ty configuration placeholder, and updates local tooling/CI to run checks via uv.
Changes:
- Add
uv.lockand update setup/docs to useuv sync/uv runcommands. - Switch pre-commit hooks and GitHub Actions workflows to execute Ruff/mypy/pytest via
uv. - Add an initial
[tool.ty]section and document an opt-intycheck.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Introduces a uv lockfile to pin dependency resolution. |
setup.sh |
Moves repo setup to uv sync + uv run pre-commit install. |
pyproject.toml |
Adds a starter [tool.ty] configuration section. |
README.md |
Documents uv-based development setup and commands, including opt-in ty. |
.vscode/tasks.json |
Adds VS Code tasks for syncing and running checks via uv. |
.vscode/settings.json |
Points VS Code’s interpreter at the .venv Python executable. |
.pre-commit-config.yaml |
Replaces remote hooks with local hooks that run tools via uv. |
.github/workflows/tests.yml |
Updates CI test/lint/typecheck steps to use uv. |
.github/workflows/pythonpublish.yml |
Updates publish workflow build/upload steps to use uv run --with .... |
setup.sh
Outdated
| if ! command -v uv >/dev/null 2>&1; then | ||
| echo "uv is required for setup. Install uv from https://docs.astral.sh/uv/" | ||
| exit 1 | ||
| fi | ||
|
|
||
| python3 -m pip install ".[requirements, requirements-test, requirements-dev]" | ||
| pre-commit install | ||
| uv sync --all-extras | ||
| uv run pre-commit install |
There was a problem hiding this comment.
setup.sh hard-fails when uv is missing, but the PR description says the workflow should prefer uv with a venv/pip fallback. Either implement the fallback path here (create venv + pip install + pre-commit install) or update the PR description/docs to reflect that uv is required.
| - id: ruff-check | ||
| name: ruff check | ||
| entry: uv run --extra requirements-test ruff check --fix | ||
| language: system | ||
| types_or: [python, pyi] | ||
| - id: ruff-format | ||
| args: | ||
| - --target-version=py313 | ||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.19.1 | ||
| hooks: | ||
| name: ruff format | ||
| entry: uv run --extra requirements-test ruff format | ||
| language: system | ||
| types_or: [python, pyi] | ||
| - id: mypy | ||
| language_version: python3.14 | ||
| additional_dependencies: [ | ||
| "httpx==0.28.1", | ||
| "orjson==3.11.5", | ||
| "packaging==25.0", | ||
| "types-xmltodict==v1.0.1.20260113" | ||
| ] | ||
| exclude: ^tests/ | ||
| name: mypy | ||
| entry: uv run --extra requirements-test mypy axis | ||
| language: system |
There was a problem hiding this comment.
These local pre-commit hooks invoke uv directly; if uv isn’t installed, developers will get a generic “command not found” failure. Consider adding an explicit uv presence check (with a clearer message) in the hook entry, or ensure the repository docs/setup make uv a hard requirement (matching the PR description).
Summary
Notes