Skip to content

Commit 21dce80

Browse files
mgoinDarkLight1337
andauthored
[CI/Build] Add support for Python 3.13 (#13164)
Signed-off-by: mgoin <michael@neuralmagic.com> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
1 parent e61bac8 commit 21dce80

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install(CODE "set(CMAKE_INSTALL_LOCAL_ONLY TRUE)" ALL_COMPONENTS)
3030
# Supported python versions. These versions will be searched in order, the
3131
# first match will be selected. These should be kept in sync with setup.py.
3232
#
33-
set(PYTHON_SUPPORTED_VERSIONS "3.9" "3.10" "3.11" "3.12")
33+
set(PYTHON_SUPPORTED_VERSIONS "3.9" "3.10" "3.11" "3.12", "3.13")
3434

3535
# Supported AMD GPU architectures.
3636
set(HIP_SUPPORTED_ARCHS "gfx906;gfx908;gfx90a;gfx942;gfx950;gfx1030;gfx1100;gfx1101;gfx1200;gfx1201")

docs/getting_started/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide will help you quickly get started with vLLM to perform:
88
## Prerequisites
99

1010
- OS: Linux
11-
- Python: 3.9 -- 3.12
11+
- Python: 3.9 -- 3.13
1212

1313
## Installation
1414

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ classifiers = [
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
2728
"Intended Audience :: Developers",
2829
"Intended Audience :: Information Technology",
2930
"Intended Audience :: Science/Research",
3031
"Topic :: Scientific/Engineering :: Artificial Intelligence",
3132
"Topic :: Scientific/Engineering :: Information Analysis",
3233
]
33-
requires-python = ">=3.9,<3.13"
34+
requires-python = ">=3.9,<3.14"
3435
dynamic = [ "version", "dependencies", "optional-dependencies"]
3536

3637
[project.urls]

vllm/config/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,17 @@ def pairwise(iterable):
191191
yield a, b
192192
a = b
193193

194-
cls_node = ast.parse(textwrap.dedent(inspect.getsource(cls))).body[0]
194+
try:
195+
cls_node = ast.parse(textwrap.dedent(inspect.getsource(cls))).body[0]
196+
except (OSError, KeyError, TypeError):
197+
# HACK: Python 3.13+ workaround - set missing __firstlineno__
198+
# Workaround can be removed after we upgrade to pydantic==2.12.0
199+
with open(inspect.getfile(cls)) as f:
200+
for i, line in enumerate(f):
201+
if f"class {cls.__name__}" in line and ":" in line:
202+
cls.__firstlineno__ = i + 1
203+
break
204+
cls_node = ast.parse(textwrap.dedent(inspect.getsource(cls))).body[0]
195205

196206
if not isinstance(cls_node, ast.ClassDef):
197207
raise TypeError("Given object was not a class.")

0 commit comments

Comments
 (0)