From 2de9fdcdf65ec4f597968ec3e04bc9c0e81e3cf1 Mon Sep 17 00:00:00 2001 From: JT Date: Tue, 16 Apr 2024 18:16:33 -0700 Subject: [PATCH] more better comment parsing --- CHANGELOG.md | 2 +- StabilityMatrix.Core/Python/PipInstallArgs.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baffe87a..1d49d7d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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.something +## v2.10.2 ### Fixed - Fixed more crashes when loading invalid connected model info files - Fixed pip installs not parsing comments properly diff --git a/StabilityMatrix.Core/Python/PipInstallArgs.cs b/StabilityMatrix.Core/Python/PipInstallArgs.cs index 8c33f194..9359f4ec 100644 --- a/StabilityMatrix.Core/Python/PipInstallArgs.cs +++ b/StabilityMatrix.Core/Python/PipInstallArgs.cs @@ -30,7 +30,8 @@ public record PipInstallArgs : ProcessArgsBuilder { var requirementsEntries = requirements .SplitLines(StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) - .Where(s => !s.StartsWith('#')); + .Where(s => !s.StartsWith('#')) + .Select(s => s.Contains('#') ? s.Substring(0, s.IndexOf('#')) : s); if (excludePattern is not null) {