-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remaining Python type annotations to build backend #10434
Add remaining Python type annotations to build backend #10434
Conversation
Thanks! Given that PEP 517 explicitly marks |
@konstin the only issue with Given uv is trying to be as performant as possible, this could be an issue. What do you think? |
If your goal is to avoid importing typing at runtime I beleive this is accepted by all type checkers:
|
Thanks @notatallshaw, I gave that a try and it seemed to work! The results are in 449fa44. |
Note that So in case |
This PR makes the dictionary type annotations more generic with the `typing.Mapping` abstract class. Suggested in astral-sh#10434 (comment)
Summary
This PR add remaining Python type annotations to build backend, specifically in
python/uv/_build_backend.py
.Test Plan
uvx ruff check --select ANN python/
checks that annotations are available everywhere.Adding this into
ruff.toml
would cause all of the scripts to get checked, which I could update if requested, but currently is out of scope for this PR.uvx mypy --strict python/
checks that there are no typing issues