Skip to content

Update Optional[x] -> x | None and Union[x, y] to x | y#26633

Merged
simon-mo merged 33 commits intovllm-project:mainfrom
hmellor:update-typing-syntax
Oct 12, 2025
Merged

Update Optional[x] -> x | None and Union[x, y] to x | y#26633
simon-mo merged 33 commits intovllm-project:mainfrom
hmellor:update-typing-syntax

Conversation

@hmellor
Copy link
Copy Markdown
Member

@hmellor hmellor commented Oct 11, 2025

Removes all UP rule ignores from pyproject.toml now that we no longer support Python 3.9 #26247.

This will be the last repo-wide formatting PR for a long time.

Thank you everyone for persevering with these changes. They will be good for the long-term health of the codebase.

There are still some left so I have not updated the rules in `pyproject.toml` (I didn't have time to resolve them all). The follow up PR shouldn't take long or be too disruptive.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor hmellor requested a review from noooop as a code owner October 12, 2025 09:55
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
…ecause it's not used for `|`

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented Oct 12, 2025

There are lots of forward reference fixes because they were masked by from __future__ import annotations. These imports have been removed so that we don't have any implicit forward references.

@simon-mo simon-mo disabled auto-merge October 12, 2025 16:51
@simon-mo simon-mo merged commit 8fcaaf6 into vllm-project:main Oct 12, 2025
82 of 84 checks passed
@andylolu2
Copy link
Copy Markdown
Contributor

@hmellor just FYI I believe this PR missed some changes, pre-commit seems to be failing on main
https://github.com/vllm-project/vllm/actions/runs/18446887777/job/52554866861

Error: vllm/model_executor/models/bert.py:612:23: F821 Undefined name `Optional`
Error: vllm/model_executor/models/bert.py:613:23: F821 Undefined name `Optional`

@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented Oct 12, 2025

Thanks for letting me know. This can happen when making changes to pre-commit rules if other PRs merge but don't cause conflicts. I'll forward fix it

@hmellor
Copy link
Copy Markdown
Member Author

hmellor commented Oct 12, 2025

Looks like someone beat me to it #26665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models documentation Improvements or additions to documentation frontend gpt-oss Related to GPT-OSS models kv-connector llama Related to Llama models multi-modality Related to multi-modality (#4194) new-model Requests to new models performance Performance-related issues qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm speculative-decoding structured-output tool-calling tpu Related to Google TPUs v1

Projects

Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants