Skip to content

Enforce Conda pyproject.toml metadata in verifywhl#45012

Open
JennyPng wants to merge 10 commits intoAzure:mainfrom
JennyPng:enforce-pyproject
Open

Enforce Conda pyproject.toml metadata in verifywhl#45012
JennyPng wants to merge 10 commits intoAzure:mainfrom
JennyPng:enforce-pyproject

Conversation

@JennyPng
Copy link
Member

@JennyPng JennyPng commented Feb 4, 2026

closes #44883

(data plane) packages with stable releases are required to have a Conda tool section in their pyproject.toml to specify if packages are to be released individually or as part of a bundle

service teams should be responsible for specifying this information

existing stable packages have already been batch updated

@JennyPng JennyPng marked this pull request as ready for review February 4, 2026 23:44
Copilot AI review requested due to automatic review settings February 4, 2026 23:44
Copy link
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 pull request enforces that Python packages with stable releases on PyPI must include a [tool.azure-sdk-conda] section in their pyproject.toml file. This automation supports the Conda release process by ensuring service teams specify whether packages should be released individually or bundled.

Changes:

  • Adds validation to check for Conda metadata in packages with stable PyPI versions
  • Fixes logging calls to use the correct logger instance
  • Removes unused import statement

@JennyPng JennyPng marked this pull request as draft February 5, 2026 00:01
@JennyPng JennyPng changed the title Enforce Conda pyproject.toml metadata in CI Enforce Conda pyproject.toml metadata in verifywhl Feb 12, 2026
@JennyPng JennyPng marked this pull request as ready for review February 12, 2026 19:07
@JennyPng JennyPng requested a review from Copilot February 12, 2026 19:07
Copy link
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 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines 115 to 139
def verify_conda_section(
package_dir: str, package_name: str, parsed_pkg: ParsedSetup, pypi_versions: List[str]
) -> bool:
"""Verify that packages with stable versions on PyPI have [tool.azure-sdk-conda] section in pyproject.toml."""
if not has_stable_version_on_pypi(package_name, pypi_versions=pypi_versions):
logger.info(f"Package {package_name} has no stable version on PyPI, skipping conda section check")
return True

pyproject_path = os.path.join(package_dir, "pyproject.toml")
if not os.path.exists(pyproject_path):
logger.error(f"Package {package_name} has a stable version on PyPI but is missing pyproject.toml")
return False

config = parsed_pkg.get_conda_config()
if not config:
logger.error(
f"Package {package_name} has a stable version on PyPI but is missing "
"[tool.azure-sdk-conda] section in pyproject.toml. This section is required to "
"specify if the package should be released individually or bundled to Conda."
)
return False
elif "in_bundle" not in config:
logger.error(f"[tool.azure-sdk-conda] section in pyproject.toml is missing required field `in_bundle`.")
return False
return True
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

New conda-metadata validation logic (verify_conda_section) doesn’t appear to have automated test coverage in the azure-sdk-tools test suite. Adding tests for: (1) stable vs prerelease gating, (2) missing [tool.azure-sdk-conda], and (3) missing in_bundle would help prevent regressions, especially since this is enforcing a new release policy.

Copilot uses AI. Check for mistakes.
@JennyPng JennyPng requested a review from kashifkhan February 12, 2026 19:18
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.

enforce in CI that the pyproject section is required

1 participant