Skip to content

Fix python builds with a365 deploy#355

Merged
sellakumaran merged 7 commits intomainfrom
users/gwharris7/fix-python-deploy
Apr 14, 2026
Merged

Fix python builds with a365 deploy#355
sellakumaran merged 7 commits intomainfrom
users/gwharris7/fix-python-deploy

Conversation

@gwharris7
Copy link
Copy Markdown
Contributor

Editable installs were failing for Python builds on Azure. This PR resolves that issue, tested with Python Claude sample agent.

This pull request updates the Python packaging logic for Azure deployments to address issues with editable installs and to improve package name detection. Instead of using editable installs (which fail on Azure), the process now installs from a pre-built wheel, and a new helper method is introduced to reliably detect the package name from the wheel or pyproject.toml.

Azure Python packaging improvements:

  • Switched from using editable installs (-e .) to installing from a pre-built wheel in the dist/ directory, as editable installs fail on Azure due to build location mismatches. The generated requirements.txt now references the wheel and the detected package name instead of using -e ..
  • Added a new private method DetectPackageName to extract the package name from the wheel filename or, as a fallback, from pyproject.toml. If neither is found, it defaults to ".". This ensures the correct package is installed during deployment.

@gwharris7 gwharris7 requested review from a team as code owners April 8, 2026 21:59
Copilot AI review requested due to automatic review settings April 8, 2026 21:59
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates Azure Python deployment packaging to avoid editable installs (which fail under Oryx) by generating a requirements.txt that installs the app from a pre-built wheel in dist/, and adds package-name detection to support that flow.

Changes:

  • Switched Azure requirements.txt generation from -e . editable installs to wheel-based installs using --find-links dist.
  • Added DetectPackageName helper to infer distribution name from a wheel filename or pyproject.toml.
  • Updated logging to reflect the new wheel install approach.

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs Outdated
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 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 9d458f3.
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.

Scanned Files

None

ajmfehr
ajmfehr previously approved these changes Apr 8, 2026
sellakumaran
sellakumaran previously approved these changes Apr 10, 2026
@gwharris7 gwharris7 dismissed stale reviews from sellakumaran and ajmfehr via d7f9f97 April 13, 2026 20:03
Copilot AI review requested due to automatic review settings April 13, 2026 20:17
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 2 out of 2 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/PythonBuilderTests.cs:28

  • These test names still say CreatesEditableRequirementsTxt, but the assertions now validate wheel-based installation (and explicitly assert NotContain(\"-e .\")). Renaming the tests to reflect the new behavior (e.g., CreatesWheelRequirementsTxt / CreatesAzureRequirementsTxt_ForWheelInstall) will reduce confusion and keep intent aligned with the implementation.
    public async Task BuildAsync_WithPyprojectToml_CreatesEditableRequirementsTxt()

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Services/PythonBuilderTests.cs:60

  • These test names still say CreatesEditableRequirementsTxt, but the assertions now validate wheel-based installation (and explicitly assert NotContain(\"-e .\")). Renaming the tests to reflect the new behavior (e.g., CreatesWheelRequirementsTxt / CreatesAzureRequirementsTxt_ForWheelInstall) will reduce confusion and keep intent aligned with the implementation.
    public async Task BuildAsync_WithSetupPy_CreatesEditableRequirementsTxt()

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
sellakumaran
sellakumaran previously approved these changes Apr 13, 2026
Copilot AI review requested due to automatic review settings April 13, 2026 23:54
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 2 out of 2 changed files in this pull request and generated 8 comments.

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs
@sellakumaran sellakumaran merged commit ff1bd05 into main Apr 14, 2026
8 checks passed
@sellakumaran sellakumaran deleted the users/gwharris7/fix-python-deploy branch April 14, 2026 18:02
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