From fe874f623ad06a3b3c482be2aa13328fc47cd952 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sat, 22 Mar 2025 00:17:36 -0400 Subject: [PATCH] sdist: include .ggml_build_number in tarball With that, builds using tarball will still have the correct cmake package version for ggml. This assumes the file is read by llama.cpp build system, see: https://github.com/ggml-org/llama.cpp/pull/12509 Fixes #1979 Signed-off-by: Ihar Hrachyshka --- .github/workflows/publish.yaml | 2 ++ .gitignore | 1 + pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index bb76f5394..cac62d753 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + fetch-depth: 0 submodules: "recursive" - name: Set up Python @@ -41,6 +42,7 @@ jobs: - name: Build source distribution run: | + (cd vendor/llama.cpp && git rev-list --count HEAD) > .ggml_build_number python -m build --sdist - name: Publish distribution to PyPI diff --git a/.gitignore b/.gitignore index 9d68dbcd9..03c57ebda 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +.ggml_build_number # PyInstaller # Usually these files are written by a python script from a template diff --git a/pyproject.toml b/pyproject.toml index 9983ef777..911fcac2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ wheel.packages = ["llama_cpp"] cmake.verbose = true cmake.minimum-version = "3.21" minimum-version = "0.5.1" -sdist.include = [".git", "vendor/llama.cpp/*"] +sdist.include = [".ggml_build_number", "vendor/llama.cpp/*"] [tool.scikit-build.metadata.version] provider = "scikit_build_core.metadata.regex"