Browse Source

Merge pull request #591 from ionite34/fix-setuptools-distutils

Fix setuptools distutils errors
pull/629/head
Ionite 7 months ago committed by GitHub
parent
commit
9716ae2bf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs
  3. 13
      StabilityMatrix.Core/Models/Settings/Settings.cs

1
CHANGELOG.md

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
### Fixed ### Fixed
- Fixed [#559](https://github.com/LykosAI/StabilityMatrix/issues/559) - "Unable to load bitmap from provided data" error in Checkpoints page - Fixed [#559](https://github.com/LykosAI/StabilityMatrix/issues/559) - "Unable to load bitmap from provided data" error in Checkpoints page
- Fixed [#522](https://github.com/LykosAI/StabilityMatrix/issues/522) - Incorrect output directory path for latest Auto1111 - Fixed [#522](https://github.com/LykosAI/StabilityMatrix/issues/522) - Incorrect output directory path for latest Auto1111
- Fixed CLIP Install errors due to setuptools distutils conflict, added default environment variable setting `SETUPTOOLS_USE_DISTUTILS=stdlib`
## v2.10.0-pre.2 ## v2.10.0-pre.2
### Added ### Added

4
StabilityMatrix.Avalonia/ViewModels/Settings/MainSettingsViewModel.cs

@ -365,7 +365,7 @@ public partial class MainSettingsViewModel : PageViewModelBase
var viewModel = dialogFactory.Get<EnvVarsViewModel>(); var viewModel = dialogFactory.Get<EnvVarsViewModel>();
// Load current settings // Load current settings
var current = settingsManager.Settings.EnvironmentVariables ?? new Dictionary<string, string>(); var current = settingsManager.Settings.UserEnvironmentVariables ?? new Dictionary<string, string>();
viewModel.EnvVars = new ObservableCollection<EnvVarKeyPair>( viewModel.EnvVars = new ObservableCollection<EnvVarKeyPair>(
current.Select(kvp => new EnvVarKeyPair(kvp.Key, kvp.Value)) current.Select(kvp => new EnvVarKeyPair(kvp.Key, kvp.Value))
); );
@ -385,7 +385,7 @@ public partial class MainSettingsViewModel : PageViewModelBase
.EnvVars.Where(kvp => !string.IsNullOrWhiteSpace(kvp.Key)) .EnvVars.Where(kvp => !string.IsNullOrWhiteSpace(kvp.Key))
.GroupBy(kvp => kvp.Key, StringComparer.Ordinal) .GroupBy(kvp => kvp.Key, StringComparer.Ordinal)
.ToDictionary(g => g.Key, g => g.First().Value, StringComparer.Ordinal); .ToDictionary(g => g.Key, g => g.First().Value, StringComparer.Ordinal);
settingsManager.Transaction(s => s.EnvironmentVariables = newEnvVars); settingsManager.Transaction(s => s.UserEnvironmentVariables = newEnvVars);
} }
} }

13
StabilityMatrix.Core/Models/Settings/Settings.cs

@ -110,7 +110,18 @@ public class Settings
public bool IsDiscordRichPresenceEnabled { get; set; } public bool IsDiscordRichPresenceEnabled { get; set; }
public Dictionary<string, string>? EnvironmentVariables { get; set; } [JsonIgnore]
public Dictionary<string, string> DefaultEnvironmentVariables { get; } =
new() { ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib" };
[JsonPropertyName("EnvironmentVariables")]
public Dictionary<string, string>? UserEnvironmentVariables { get; set; }
[JsonIgnore]
public IReadOnlyDictionary<string, string> EnvironmentVariables =>
DefaultEnvironmentVariables
.Concat(UserEnvironmentVariables ?? [])
.ToDictionary(x => x.Key, x => x.Value);
public HashSet<string>? InstalledModelHashes { get; set; } = new(); public HashSet<string>? InstalledModelHashes { get; set; } = new();

Loading…
Cancel
Save