Skip to content

Commit 16c6424

Browse files
authored
Merge pull request LykosAI#1207 from ionite34/backport/main/pr-1206
[dev to main] backport: Fix the missing pkg_resources error for real this time (1206)
2 parents d5fbc07 + f461c91 commit 16c6424

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

StabilityMatrix.Core/Models/Packages/A3WebUI.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ torchIndex is TorchIndex.Cuda
226226
// 1. Configure the entire install process declaratively.
227227
var config = new PipInstallConfig
228228
{
229-
RequirementsFilePaths = ["requirements_versions.txt", "setuptools<82"],
229+
RequirementsFilePaths = ["requirements_versions.txt"],
230230
TorchVersion = torchIndex == TorchIndex.Mps ? "==2.3.1" : (isBlackwell ? "" : "==2.1.2"),
231231
TorchvisionVersion = torchIndex == TorchIndex.Mps ? "==0.18.1" : (isBlackwell ? "" : "==0.16.2"),
232232
XformersVersion = isBlackwell ? " " : "==0.0.23.post1",
@@ -235,7 +235,6 @@ torchIndex is TorchIndex.Cuda
235235
ExtraPipArgs =
236236
[
237237
"https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip",
238-
"setuptools<82",
239238
],
240239
};
241240

StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ await PyInstallationManager.GetInstallationAsync(pythonVersion.Value).ConfigureA
235235
await venvRunner.Setup(true, onConsoleOutput).ConfigureAwait(false);
236236
}
237237

238+
// Constrain setuptools<82 in uv's isolated build environments.
239+
// setuptools 82+ removed pkg_resources, breaking source builds that import it.
240+
var buildConstraintsPath = Path.Combine(installedPackagePath, venvName, "uv-build-constraints.txt");
241+
await File.WriteAllTextAsync(buildConstraintsPath, "setuptools<82\n").ConfigureAwait(false);
242+
venvRunner.UpdateEnvironmentVariables(env =>
243+
env.SetItem("UV_BUILD_CONSTRAINT", buildConstraintsPath)
244+
);
245+
238246
// ensure pip is installed
239247
await venvRunner.PipInstall("pip", onConsoleOutput).ConfigureAwait(false);
240248

StabilityMatrix.Core/Models/Packages/SDWebForge.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,9 @@ public override async Task InstallPackage(
185185
torchIndex is TorchIndex.Cuda
186186
&& (SettingsManager.Settings.PreferredGpu?.IsBlackwellGpu() ?? HardwareHelper.HasBlackwellGpu());
187187

188-
var isAmd = torchIndex is TorchIndex.Rocm;
189-
190188
var config = new PipInstallConfig
191189
{
192-
PrePipInstallArgs = ["joblib", "setuptools<82"],
190+
PrePipInstallArgs = ["joblib"],
193191
RequirementsFilePaths = requirementsPaths,
194192
TorchVersion = "",
195193
TorchvisionVersion = "",
@@ -199,7 +197,7 @@ torchIndex is TorchIndex.Cuda
199197
[
200198
"https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip",
201199
],
202-
PostInstallPipArgs = ["numpy==1.26.4", "setuptools<82"],
200+
PostInstallPipArgs = ["numpy==1.26.4"],
203201
};
204202

205203
await StandardPipInstallProcessAsync(

0 commit comments

Comments
 (0)