-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
Description
Description
When running a365 deploy for a Python project that has a requirements.txt but no pyproject.toml or setup.py, the CLI overwrites the project's requirements.txt with:
--find-links dist
--pre
-e .
This causes the Azure Oryx build to fail with:
ERROR: file:///tmp/8de6a0cc7ececaa (from -r requirements.txt (line 3)) does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
Steps to Reproduce
- Create a Python agent project with only
requirements.txt(nopyproject.tomlorsetup.py) - Run
a365 deploy --verbose - Observe that
publish/requirements.txtis overwritten with-e . - Azure deployment fails because there's no
pyproject.toml
Expected Behavior
The CLI should detect the project structure:
- If
pyproject.tomlorsetup.pyexists: Use-e .approach (editable install) - If only
requirements.txtexists: Copy the existingrequirements.txtto the publish folder as-is
Actual Behavior
The CLI always overwrites requirements.txt with -e ., regardless of whether pyproject.toml exists.
Code Location
src/Microsoft.Agents.A365.DevTools.Cli/Services/PythonBuilder.cs - CreateAzureRequirementsTxt() method:
private async Task CreateAzureRequirementsTxt(string publishPath, bool verbose)
{
var requirementsTxt = Path.Combine(publishPath, "requirements.txt");
// Azure-native requirements.txt that mirrors local workflow
// --pre allows installation of pre-release versions
var content = "--find-links dist\n--pre\n-e .\n";
await File.WriteAllTextAsync(requirementsTxt, content);
_logger.LogInformation("Created requirements.txt for Azure deployment");
}Proposed Fix
Check for pyproject.toml or setup.py before deciding which approach to use. Will submit a PR with the fix.
Environment
- CLI Version: 1.1.62-preview
- OS: Windows 11
- Python: 3.12
Workaround
Manually copy the original requirements.txt to the publish/ folder after a365 deploy creates it, then redeploy with az webapp deploy.
Reactions are currently unavailable