From 2b6c9ae657d6def428c5c211d5036977b3a5d18b Mon Sep 17 00:00:00 2001 From: Sellakumaran Kanagarathnam Date: Wed, 15 Apr 2026 20:55:03 -0700 Subject: [PATCH 1/3] fix: remove backend-path to resolve ValueError: paths must be inside source tree python -m build fails in CI with: ValueError: paths must be inside source tree This is thrown by pyproject_hooks.BuildBackendHookCaller.__init__ which validates that all backend-path entries resolve inside the package source directory. The backend-path = ["../../versioning/helper"] in each package's pyproject.toml points outside the package tree, triggering this check before any build code runs. Setting PYTHONPATH has no effect since the error fires during path validation, not import. Fix: remove backend-path from all 14 packages. The CI pipeline already exports PYTHONPATH="${ROOT_DIR}/versioning/helper" which makes build_backend importable in the hook subprocess. The custom backend and its S360 version constraint injection are unaffected. uv build from the repo root continues to work for local development. --- .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../microsoft-agents-a365-runtime/pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../pyproject.toml | 1 - .../microsoft-agents-a365-tooling/pyproject.toml | 1 - versioning/helper/build_backend.py | 13 +++++++++---- 15 files changed, 9 insertions(+), 18 deletions(-) diff --git a/libraries/microsoft-agents-a365-notifications/pyproject.toml b/libraries/microsoft-agents-a365-notifications/pyproject.toml index be8511a1..8ec5d86b 100644 --- a/libraries/microsoft-agents-a365-notifications/pyproject.toml +++ b/libraries/microsoft-agents-a365-notifications/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-notifications" diff --git a/libraries/microsoft-agents-a365-observability-core/pyproject.toml b/libraries/microsoft-agents-a365-observability-core/pyproject.toml index 37740bf1..e86e51c3 100644 --- a/libraries/microsoft-agents-a365-observability-core/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-core/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-core" diff --git a/libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml b/libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml index 45335204..924cd027 100644 --- a/libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-extensions-agent-framework" diff --git a/libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml b/libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml index 4f8cbce4..7a6ebf27 100644 --- a/libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-extensions-langchain" diff --git a/libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml b/libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml index 5c7a368e..604f5196 100644 --- a/libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-extensions-openai" diff --git a/libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml b/libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml index ffaadcd7..8c898b98 100644 --- a/libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-extensions-semantic-kernel" diff --git a/libraries/microsoft-agents-a365-observability-hosting/pyproject.toml b/libraries/microsoft-agents-a365-observability-hosting/pyproject.toml index 3b1aa46b..4c4ac387 100644 --- a/libraries/microsoft-agents-a365-observability-hosting/pyproject.toml +++ b/libraries/microsoft-agents-a365-observability-hosting/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-observability-hosting" diff --git a/libraries/microsoft-agents-a365-runtime/pyproject.toml b/libraries/microsoft-agents-a365-runtime/pyproject.toml index 8b3a739d..ebe7722b 100644 --- a/libraries/microsoft-agents-a365-runtime/pyproject.toml +++ b/libraries/microsoft-agents-a365-runtime/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-runtime" diff --git a/libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml b/libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml index f0b6e125..7bc9d648 100644 --- a/libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling-extensions-agentframework" diff --git a/libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml b/libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml index 31c1dafe..5b040d25 100644 --- a/libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling-extensions-azureaifoundry" diff --git a/libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml b/libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml index 3af61f81..e0b831ec 100644 --- a/libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling-extensions-googleadk" diff --git a/libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml b/libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml index 8c23fc27..1e118515 100644 --- a/libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling-extensions-openai" diff --git a/libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml b/libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml index b2264bb5..a3cdbca7 100644 --- a/libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling-extensions-semantickernel" diff --git a/libraries/microsoft-agents-a365-tooling/pyproject.toml b/libraries/microsoft-agents-a365-tooling/pyproject.toml index f96287f1..0f0780d9 100644 --- a/libraries/microsoft-agents-a365-tooling/pyproject.toml +++ b/libraries/microsoft-agents-a365-tooling/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" -backend-path = ["../../versioning/helper"] [project] name = "microsoft-agents-a365-tooling" diff --git a/versioning/helper/build_backend.py b/versioning/helper/build_backend.py index e92451b9..2b68065e 100644 --- a/versioning/helper/build_backend.py +++ b/versioning/helper/build_backend.py @@ -5,15 +5,20 @@ Custom build backend that wraps setuptools.build_meta to inject centralized version constraints into published wheel metadata. -Note: backend-path references a directory outside the package. This is intentional -for monorepo wheel builds. Individual sdist publishing is not supported; packages -are published as wheels only from CI. +Note: Individual sdist publishing is not supported; packages are published as +wheels only from CI. Usage in package pyproject.toml: [build-system] requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit"] build-backend = "build_backend" - backend-path = ["../../versioning/helper"] + +The build backend module is resolved via PYTHONPATH, which must include the +path to this directory (versioning/helper) when building. The CI pipeline sets +this automatically. For local builds, use 'uv build' from the repo root, or +set PYTHONPATH manually: + export PYTHONPATH="$(git rev-parse --show-toplevel)/versioning/helper:$PYTHONPATH" + python -m build --no-isolation --wheel """ from __future__ import annotations From db4c89b0797ed8a3fcc50670ac882f103eeb21be Mon Sep 17 00:00:00 2001 From: Sellakumaran Kanagarathnam Date: Thu, 16 Apr 2026 10:48:00 -0700 Subject: [PATCH 2/3] Set PYTHONPATH for install step in CI workflow Added PYTHONPATH environment variable pointing to versioning/helper during the "Install the project" step in the CI workflow. This ensures Python can locate necessary modules during installation. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8c89ea..c655f5e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,8 @@ jobs: - name: Install the project run: uv lock && uv sync --locked --all-extras --dev + env: + PYTHONPATH: ${{ github.workspace }}/versioning/helper - name: Verify centralized version constraints run: uv run --frozen tox -e verify-constraints From 7d6dd70bc6cc25e447fb4fef3d704cc2d5ec2908 Mon Sep 17 00:00:00 2001 From: Sellakumaran Kanagarathnam Date: Thu, 16 Apr 2026 11:15:48 -0700 Subject: [PATCH 3/3] fix: set PYTHONPATH at job level so all steps can import build_backend Step-level env only applies to a single step. uv sync passed but uv build and tox steps still failed with ModuleNotFoundError: No module named build_backend. Moving PYTHONPATH to job-level env ensures it is available for all steps: uv sync, uv build, tox, and any future steps that invoke the build backend. Also fix docstring example in build_backend.py to include packaging in build-system.requires, matching what the packages actually declare. --- .github/workflows/ci.yml | 4 ++-- versioning/helper/build_backend.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c655f5e1..7948c964 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,8 @@ jobs: defaults: run: working-directory: ./ + env: + PYTHONPATH: ${{ github.workspace }}/versioning/helper strategy: matrix: @@ -105,8 +107,6 @@ jobs: - name: Install the project run: uv lock && uv sync --locked --all-extras --dev - env: - PYTHONPATH: ${{ github.workspace }}/versioning/helper - name: Verify centralized version constraints run: uv run --frozen tox -e verify-constraints diff --git a/versioning/helper/build_backend.py b/versioning/helper/build_backend.py index 2b68065e..100696bf 100644 --- a/versioning/helper/build_backend.py +++ b/versioning/helper/build_backend.py @@ -10,7 +10,7 @@ Usage in package pyproject.toml: [build-system] - requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit"] + requires = ["setuptools>=68", "wheel", "tzdata", "tomlkit", "packaging"] build-backend = "build_backend" The build backend module is resolved via PYTHONPATH, which must include the