Skip to content

[Build] Do not add cmake/ninja dependencies when they are installed #12739

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[build-system]
# Should be mirrored in requirements/build.txt
# Please do not add cmake or ninja here, they are handled in setup.py
requires = [
"cmake>=3.26.1",
"ninja",
"packaging>=24.2",
"setuptools>=77.0.3,<80.0.0",
"setuptools-scm>=8.0",
Expand Down
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def is_ninja_available() -> bool:
return which("ninja") is not None


def is_cmake_available() -> bool:
return which("cmake") is not None


def is_url_available(url: str) -> bool:
from urllib.request import urlopen

Expand Down Expand Up @@ -682,11 +686,18 @@ def _read_requirements(filename: str) -> list[str]:
repackage_wheel if envs.VLLM_USE_PRECOMPILED else cmake_build_ext
}

setup_requires = []
if not is_cmake_available():
setup_requires += ["cmake>=3.26.1"]
if not is_ninja_available():
setup_requires += ["ninja"]

setup(
# static metadata should rather go in pyproject.toml
version=get_vllm_version(),
ext_modules=ext_modules,
install_requires=get_requirements(),
setup_requires=setup_requires,
extras_require={
"bench": ["pandas", "datasets"],
"tensorizer": ["tensorizer>=2.9.0"],
Expand Down