Browse Source

Merge pull request #461 from ionite34/backport/main/pr-434

[dev to main] backport: MacOS fixes and allow multi argument pip install (434)
pull/397/head
Ionite 10 months ago committed by GitHub
parent
commit
6a34795c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      StabilityMatrix.Avalonia/ViewModels/Dialogs/PythonPackagesViewModel.cs

15
StabilityMatrix.Avalonia/ViewModels/Dialogs/PythonPackagesViewModel.cs

@ -140,10 +140,7 @@ public partial class PythonPackagesViewModel : ContentDialogViewModelBase
? UpgradePackageVersion(
item.Package.Name,
item.SelectedVersion,
PythonPackagesItemViewModel.GetKnownIndexUrl(
item.Package.Name,
item.SelectedVersion
),
PythonPackagesItemViewModel.GetKnownIndexUrl(item.Package.Name, item.SelectedVersion),
isDowngrade: item.CanDowngrade
)
: Task.CompletedTask;
@ -167,9 +164,7 @@ public partial class PythonPackagesViewModel : ContentDialogViewModelBase
Resources.Label_ConfirmQuestion
);
dialog.PrimaryButtonText = isDowngrade
? Resources.Action_Downgrade
: Resources.Action_Upgrade;
dialog.PrimaryButtonText = isDowngrade ? Resources.Action_Downgrade : Resources.Action_Upgrade;
dialog.IsPrimaryButtonEnabled = true;
dialog.DefaultButton = ContentDialogButton.Primary;
dialog.CloseButtonText = Resources.Action_Cancel;
@ -225,7 +220,7 @@ public partial class PythonPackagesViewModel : ContentDialogViewModelBase
var dialog = DialogHelper.CreateTextEntryDialog("Install Package", "", fields);
var result = await dialog.ShowAsync();
if (result != ContentDialogResult.Primary || fields[0].Text is not { } packageName)
if (result != ContentDialogResult.Primary || fields[0].Text is not { } packageArgs)
{
return;
}
@ -236,14 +231,14 @@ public partial class PythonPackagesViewModel : ContentDialogViewModelBase
{
VenvDirectory = VenvPath,
WorkingDirectory = VenvPath.Parent,
Args = new[] { "install", packageName }
Args = new ProcessArgs(packageArgs).Prepend("install")
}
};
var runner = new PackageModificationRunner
{
ShowDialogOnStart = true,
ModificationCompleteMessage = $"Installed Python Package '{packageName}'"
ModificationCompleteMessage = $"Installed Python Package '{packageArgs}'"
};
EventManager.Instance.OnPackageInstallProgressAdded(runner);
await runner.ExecuteSteps(steps);

Loading…
Cancel
Save