Skip to content

fix: remove backend-path to resolve ValueError: paths must be inside …#231

Merged
sellakumaran merged 4 commits into
mainfrom
users/sellak/remove-backend-path-from-pyprojects
Apr 16, 2026
Merged

fix: remove backend-path to resolve ValueError: paths must be inside …#231
sellakumaran merged 4 commits into
mainfrom
users/sellak/remove-backend-path-from-pyprojects

Conversation

@sellakumaran
Copy link
Copy Markdown
Contributor

…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.

…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.
Copilot AI review requested due to automatic review settings April 16, 2026 04:04
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix CI python -m build failures caused by pyproject_hooks rejecting backend-path entries that resolve outside each package’s source tree, by removing backend-path from all package pyproject.toml files and updating the build backend documentation accordingly.

Changes:

  • Removed backend-path = ["../../versioning/helper"] from 14 package pyproject.toml files.
  • Updated versioning/helper/build_backend.py docstring to describe resolving the backend via PYTHONPATH.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
versioning/helper/build_backend.py Updates documentation for how the custom build backend is resolved after removing backend-path.
libraries/microsoft-agents-a365-tooling/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-runtime/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-hosting/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-observability-core/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.
libraries/microsoft-agents-a365-notifications/pyproject.toml Removes backend-path to avoid pyproject_hooks path validation failure.

Comment thread versioning/helper/build_backend.py
Comment thread libraries/microsoft-agents-a365-runtime/pyproject.toml
Comment thread libraries/microsoft-agents-a365-tooling/pyproject.toml
ajmfehr
ajmfehr previously approved these changes Apr 16, 2026
gwharris7
gwharris7 previously approved these changes Apr 16, 2026
@sellakumaran sellakumaran disabled auto-merge April 16, 2026 17:30
@gwharris7 gwharris7 requested review from a team as code owners April 16, 2026 17:31
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.
Copilot AI review requested due to automatic review settings April 16, 2026 17:50
@sellakumaran sellakumaran dismissed stale reviews from ajmfehr and gwharris7 via db4c89b April 16, 2026 17:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/ci.yml
Comment thread versioning/helper/build_backend.py Outdated
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.
@sellakumaran sellakumaran enabled auto-merge (squash) April 16, 2026 18:23
@sellakumaran sellakumaran merged commit 23785d2 into main Apr 16, 2026
9 checks passed
@sellakumaran sellakumaran deleted the users/sellak/remove-backend-path-from-pyprojects branch April 16, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants