@@ -267,7 +267,8 @@ WORKDIR /workspace
267267
268268COPY --from=csrc-build /workspace/dist /precompiled-wheels
269269
270- COPY . .
270+ # Exclude .git to avoid cache misses
271+ COPY --exclude=.git . .
271272
272273ARG GIT_REPO_CHECK=0
273274RUN --mount=type=bind,source=.git,target=.git \
@@ -279,12 +280,22 @@ ENV VLLM_TARGET_DEVICE=${vllm_target_device}
279280# Skip adding +precompiled suffix to version (preserves git-derived version)
280281ENV VLLM_SKIP_PRECOMPILED_VERSION_SUFFIX=1
281282
283+ ARG USE_GIT_VERSION=0
284+ RUN --mount=type=cache,target=/root/.cache/uv \
285+ if [ "$USE_GIT_VERSION" = "0" ]; then \
286+ if [ "${vllm_target_device}" = "cuda" ]; then \
287+ export VLLM_PRECOMPILED_WHEEL_LOCATION=$(ls /precompiled-wheels/*.whl); \
288+ fi && \
289+ SETUPTOOLS_SCM_PRETEND_VERSION="0.0.0+src.build" python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
290+ fi
282291RUN --mount=type=cache,target=/root/.cache/uv \
283292 --mount=type=bind,source=.git,target=.git \
284- if [ "${vllm_target_device}" = "cuda" ]; then \
285- export VLLM_PRECOMPILED_WHEEL_LOCATION=$(ls /precompiled-wheels/*.whl); \
286- fi && \
287- python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38
293+ if [ "$USE_GIT_VERSION" != "0" ]; then \
294+ if [ "${vllm_target_device}" = "cuda" ]; then \
295+ export VLLM_PRECOMPILED_WHEEL_LOCATION=$(ls /precompiled-wheels/*.whl); \
296+ fi && \
297+ python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
298+ fi
288299
289300# Install DeepGEMM from source
290301ARG DEEPGEMM_GIT_REF
0 commit comments