From 822e87907c38b26fed3d9a094912c0127948b2fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 10 Jul 2025 11:59:06 +0200 Subject: [PATCH] chore: use uv build backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The uv build backend is a great choice for most Python projects. It has reasonable defaults, with the goal of requiring zero configuration for most users, but provides flexible configuration to accommodate most Python project structures. It integrates tightly with uv, to improve messaging and user experience. It validates project metadata and structures, preventing common mistakes. And, finally, it's very fast. uv_build backend was declared stable and ready to use in 0.7.20. Reference: https://docs.astral.sh/uv/concepts/build-backend/ Signed-off-by: Sébastien Han --- .github/actions/setup-runner/action.yml | 4 ++-- .github/workflows/python-build-test.yml | 2 +- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 9 +++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-runner/action.yml b/.github/actions/setup-runner/action.yml index 25d7b6128..2fb31460c 100644 --- a/.github/actions/setup-runner/action.yml +++ b/.github/actions/setup-runner/action.yml @@ -9,11 +9,11 @@ runs: using: "composite" steps: - name: Install uv - uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1 + uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 with: python-version: ${{ inputs.python-version }} activate-environment: true - version: 0.7.6 + version: 0.7.20 - name: Install dependencies shell: bash diff --git a/.github/workflows/python-build-test.yml b/.github/workflows/python-build-test.yml index 63ddd9b54..1282d08d2 100644 --- a/.github/workflows/python-build-test.yml +++ b/.github/workflows/python-build-test.yml @@ -24,7 +24,7 @@ jobs: with: python-version: ${{ matrix.python-version }} activate-environment: true - version: 0.7.6 + version: 0.7.20 - name: Build Llama Stack package run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c744c6bc..0d93493c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -89,7 +89,7 @@ repos: - id: distro-codegen name: Distribution Template Codegen additional_dependencies: - - uv==0.7.8 + - uv==0.7.20 entry: uv run --group codegen ./scripts/distro_codegen.py language: python pass_filenames: false @@ -98,7 +98,7 @@ repos: - id: provider-codegen name: Provider Codegen additional_dependencies: - - uv==0.7.8 + - uv==0.7.20 entry: uv run --group codegen ./scripts/provider_codegen.py language: python pass_filenames: false @@ -107,7 +107,7 @@ repos: - id: openapi-codegen name: API Spec Codegen additional_dependencies: - - uv==0.7.8 + - uv==0.7.20 entry: sh -c 'uv run ./docs/openapi_generator/run_openapi_generator.sh > /dev/null' language: python pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index 2974ff996..4609bdb1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ [build-system] -requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" +requires = ["uv_build>=0.7.20,<0.8.0"] +build-backend = "uv_build" + +[tool.uv.build-backend] +module-root = "" [project] name = "llama_stack" @@ -139,6 +142,8 @@ Homepage = "https://github.com/meta-llama/llama-stack" llama = "llama_stack.cli.llama:main" install-wheel-from-presigned = "llama_stack.cli.scripts.run:install_wheel_from_presigned" +# Keep this for the docs build even if the build backend is uv_build but that's for the package +# build. [tool.setuptools.packages.find] where = ["."] include = ["llama_stack", "llama_stack.*"]