Skip to content

[S360] Add version constraints from root constraint-dependencies#216

Merged
gwharris7 merged 8 commits intomainfrom
users/gwharris7/fix-setup-utils
Apr 1, 2026
Merged

[S360] Add version constraints from root constraint-dependencies#216
gwharris7 merged 8 commits intomainfrom
users/gwharris7/fix-setup-utils

Conversation

@gwharris7
Copy link
Copy Markdown
Contributor

Problem:
Package pyproject.toml files declare dependencies by name only (no version)
for uv workspace resolution. But setuptools.build_meta copies these bare names
into published wheels, allowing vulnerable old versions to satisfy the constraint.

Solution:
This backend intercepts the wheel/sdist build, temporarily rewrites pyproject.toml
to include version constraints from the root constraint-dependencies, builds the
package, then restores the original file.

Usage in package pyproject.toml:
[build-system]
requires = ["setuptools>=68", "wheel", "tzdata"]
build-backend = "build_backend"
backend-path = ["../../versioning/helper"]

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 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.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA ff10c57.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
pip/setuptools 82.0.1 UnknownUnknown
pip/tomlkit 0.14.0 UnknownUnknown

Scanned Files

  • uv.lock

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 introduces a custom PEP 517 build backend to ensure published wheel metadata includes centralized minimum-version constraints (from the root tool.uv.constraint-dependencies) instead of shipping bare dependency names from per-package pyproject.toml files.

Changes:

  • Added versioning/helper/build_backend.py wrapping setuptools.build_meta to inject constraints during wheel/sdist/metadata builds.
  • Enhanced versioning/helper/setup_utils.py to read root constraints and apply them to bare external dependencies.
  • Updated multiple library pyproject.toml files to use the new build_backend via backend-path.

Reviewed changes

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

Show a summary per file
File Description
versioning/helper/setup_utils.py Parses root constraint-dependencies and applies them to bare external deps in get_dynamic_dependencies().
versioning/helper/build_backend.py New build backend that rewrites pyproject.toml during build to inject centralized constraints into published metadata.
libraries/microsoft-agents-a365-tooling/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-tooling-extensions-semantickernel/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-tooling-extensions-openai/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-tooling-extensions-googleadk/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-tooling-extensions-agentframework/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-runtime/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-hosting/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-extensions-semantickernel/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-extensions-openai/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-extensions-langchain/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-observability-core/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.
libraries/microsoft-agents-a365-notifications/pyproject.toml Switches build backend to build_backend with backend-path to enable constraint injection.

Copilot AI review requested due to automatic review settings March 31, 2026 21:53
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 17 out of 17 changed files in this pull request and generated 6 comments.

@gwharris7 gwharris7 merged commit fbdc187 into main Apr 1, 2026
9 checks passed
@gwharris7 gwharris7 deleted the users/gwharris7/fix-setup-utils branch April 1, 2026 20:36
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