Skip to content

Update deprecated Python 3.8 typing #13971

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

Merged
merged 8 commits into from
Mar 3, 2025

Conversation

hmellor
Copy link
Member

@hmellor hmellor commented Feb 27, 2025

The main change is in pyproject.toml, the rest is just fixing the pre-commit errors that creates.

The following two rules have been enabled:

They have been enabled:

  • Outside of the vllm/ directory
  • Inside vllm/v1 and vllm/entrypoints
  • For the direct children vllm/*.py

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

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is not necessary. we should keep the compatibility if it does not hurt.
for example, if someone still uses a fork of vllm, and he sticks to python 3.8, this PR will make their rebase and update very painful.

@DarkLight1337
Copy link
Member

DarkLight1337 commented Feb 27, 2025

Python 3.8 is effectively not supported anymore (even without this PR) as we now directly subscript builtins like list, dict in multiple places in vLLM.

@youkaichao
Copy link
Member

Python 3.8 is effectively not supported anymore (even without this PR) as we now directly subscript builtins like list, dict in multiple places in vLLM.

I think it's fine to use new type annotation like list directly in new code, but i doubt the necessity to change all the existing code.

@DarkLight1337
Copy link
Member

We can selectively enforce this rule via https://docs.astral.sh/ruff/settings/#lint_per-file-ignores

Perhaps we can start by applying this to V1 code?

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

We can selectively enforce this rule via docs.astral.sh/ruff/settings#lint_per-file-ignores

Perhaps we can start by applying this to V1 code?

I'm fine with applying it to new code, but I think changing thousands of lines as in this PR is not necessary.

@hmellor
Copy link
Member Author

hmellor commented Feb 27, 2025

I don't think there is any harm in using the modern syntax throughout vLLM.

I'm in favour of updating everything because then the whole repo is consistent and little consistencies like these add up to make the library more maintainable.

@hmellor
Copy link
Member Author

hmellor commented Feb 27, 2025

if someone still uses a fork of vllm, and he sticks to python 3.8

Also, PyTorch has dropped Python 3.8 and we already use the modern syntax in some places. So as @DarkLight1337 said, we already do not support Python 3.8.

@NickLucche
Copy link
Contributor

For what is worth torch still appears to be using the old List syntax in the codebase for one.

@hmellor
Copy link
Member Author

hmellor commented Feb 27, 2025

How's this?

I have reverted everything inside vllm/vllm except:

  • v1
  • entrypoints
  • Python files that are direct children of vllm

Copy link

mergify bot commented Feb 27, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 27, 2025
@DarkLight1337
Copy link
Member

This sounds good to me. Let's merge this over the weekend to avoid conflicts.

@mergify mergify bot removed the needs-rebase label Feb 28, 2025
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@DarkLight1337
Copy link
Member

Can you update this PR?

@hmellor
Copy link
Member Author

hmellor commented Mar 2, 2025

Does it need rebasing? The last thing the bot did was remove the label.

@DarkLight1337
Copy link
Member

Yeah, GH says there are merge conflicts.

@hmellor
Copy link
Member Author

hmellor commented Mar 2, 2025

Ok, I've updated

@DarkLight1337
Copy link
Member

Pre-commit is failing

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 2, 2025
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) March 2, 2025 15:09
@vllm-bot vllm-bot merged commit cf069aa into vllm-project:main Mar 3, 2025
61 of 64 checks passed
Akshat-Tripathi pushed a commit to krai/vllm that referenced this pull request Mar 3, 2025
@hmellor hmellor deleted the remove-deprecated-typing branch March 10, 2025 10:55
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed speculative-decoding structured-output v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants