Skip to content
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

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

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",
"ninja",
"packaging",
"setuptools>=61",
"setuptools-scm>=8.0",
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def is_ninja_available() -> bool:
return which("ninja") is not None


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


class CMakeExtension(Extension):

def __init__(self, name: str, cmake_lists_dir: str = '.', **kwa) -> None:
Expand Down Expand Up @@ -628,6 +632,12 @@ 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"]
if not is_ninja_available():
setup_requires += ["ninja"]

setup(
name="vllm",
version=get_vllm_version(),
Expand Down