From f099edc255ba07f7822455dc1cf197d36f502892 Mon Sep 17 00:00:00 2001 From: ionite34 Date: Wed, 27 Dec 2023 20:56:01 +0800 Subject: [PATCH 1/2] Filter warnings in pip show parse --- CHANGELOG.md | 4 ++++ StabilityMatrix.Core/Python/PipShowResult.cs | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5791f7092..7258569bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## v2.7.7 +### Fixed +- Fixed Python Packages manager crash when pip show returns warnings + ## v2.7.6 ### Added - Added SDXL Turbo and Stable Video Diffusion to the Hugging Face tab diff --git a/StabilityMatrix.Core/Python/PipShowResult.cs b/StabilityMatrix.Core/Python/PipShowResult.cs index 4bc132fe0..15e86cfcd 100644 --- a/StabilityMatrix.Core/Python/PipShowResult.cs +++ b/StabilityMatrix.Core/Python/PipShowResult.cs @@ -29,7 +29,9 @@ public static PipShowResult Parse(string output) // Decode each line by splitting on first ":" to key and value var lines = output .SplitLines(StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) - .Select(line => line.Split(new[] { ':' }, 2)) + // Filter warning lines + .Where(line => !line.StartsWith("WARNING", StringComparison.OrdinalIgnoreCase)) + .Select(line => line.Split(':', 2)) .Where(split => split.Length == 2) .Select(split => new KeyValuePair(split[0].Trim(), split[1].Trim())) .ToDictionary(pair => pair.Key, pair => pair.Value); @@ -46,11 +48,11 @@ public static PipShowResult Parse(string output) Location = lines.GetValueOrDefault("Location"), Requires = lines .GetValueOrDefault("Requires") - ?.Split(new[] { ',' }, StringSplitOptions.TrimEntries) + ?.Split(',', StringSplitOptions.TrimEntries) .ToList(), RequiredBy = lines .GetValueOrDefault("Required-by") - ?.Split(new[] { ',' }, StringSplitOptions.TrimEntries) + ?.Split(',', StringSplitOptions.TrimEntries) .ToList() }; } From c076b675820e8f62fe234bdab4ed775329ef29c4 Mon Sep 17 00:00:00 2001 From: ionite34 Date: Thu, 28 Dec 2023 10:22:37 +0800 Subject: [PATCH 2/2] Move changelog --- CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7258569bb..94d3db159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,17 +5,13 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). -## v2.7.7 -### Fixed -- Fixed Python Packages manager crash when pip show returns warnings - ## v2.7.6 ### Added - Added SDXL Turbo and Stable Video Diffusion to the Hugging Face tab ### Changed - ControlNet model selector will now show the parent directory of a model when relevant ### Fixed -- Fixed Python Packages dialog crash +- Fixed Python Packages dialog crash due to pip commands including warnings - Fixed Base Model downloads from the Hugging Face tab downloading to the wrong folder ## v2.7.5