Skip to content

Commit

Permalink
Updates for ignite build (#118)
Browse files Browse the repository at this point in the history
* Update how python binary is found

* update preview link
  • Loading branch information
robch authored Nov 14, 2023
1 parent 0853924 commit 6166c6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ai/Program_AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AiProgramData : IProgramData
#region name data
public string Name => "ai";
public string DisplayName => "Azure AI CLI";
public string WarningBanner => "`#e_;This PRIVATE PREVIEW version may change at any time.\nSee: https://aka.ms/azure-ai-cli-private-preview";
public string WarningBanner => "`#e_;This PRIVATE PREVIEW version may change at any time.\nSee: https://aka.ms/azure-ai-cli-public-preview";
public string TelemetryUserAgent => "ai-cli 0.0.1";
#endregion

Expand Down
10 changes: 3 additions & 7 deletions src/common/details/helpers/python_runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,16 @@ private static string EnsureFindPython()
if (_pythonBinary == null)
{
_pythonBinary = FindPython();
AI.DBG_TRACE_VERBOSE($"Python found: {_pythonBinary}");
}

return _pythonBinary;
}

private static string FindPython()
{
var process = ProcessHelpers.RunShellCommandAsync("python3", "--version").Result;
if (process.ExitCode == 0 && process.MergedOutput.Contains("Python 3.")) return "python3";

process = ProcessHelpers.RunShellCommandAsync("python", "--version").Result;
if (process.ExitCode == 0 && process.MergedOutput.Contains("Python 3.")) return "python";

var lastTry = FindPythonBinaryInOsPath();
process = ProcessHelpers.RunShellCommandAsync("python", "--version").Result;
var process = ProcessHelpers.RunShellCommandAsync(lastTry, "--version").Result;
if (process.ExitCode == 0 && process.MergedOutput.Contains("Python 3.")) return lastTry;

return null;
Expand Down

0 comments on commit 6166c6c

Please sign in to comment.