From 58d607b62a0aac41be6a0daaa25c3887955dafd0 Mon Sep 17 00:00:00 2001 From: Domenic Barbuzzi Date: Fri, 21 Jun 2024 15:03:33 +0000 Subject: [PATCH] Embed git commit hash into Python source --- .github/actions/nm-build-vllm/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/nm-build-vllm/action.yml b/.github/actions/nm-build-vllm/action.yml index c78a9a8b27d65..bcbb755ea6163 100644 --- a/.github/actions/nm-build-vllm/action.yml +++ b/.github/actions/nm-build-vllm/action.yml @@ -30,6 +30,14 @@ runs: run: | COMMIT=${{ github.sha }} VENV="${{ inputs.venv }}-${COMMIT:0:7}" + + # add githash `to version.py` and include in 'all' for `vllm/__init__.py` + echo "__githash__ = '$COMMIT'" >> vllm/version.py + # update import line + sed -i 's/import __version__/import __githash__, __version__/' vllm/__init__.py + # update "__all__" list + sed -i 's/"__version__",/"__githash__",\n "__version__",/' vllm/__init__.py + source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate # TODO: adjust when we need a proper release. use nightly now. pip3 install -r requirements-cuda.txt -r requirements-build.txt