Browse Source

Only use copy mode in windows

pull/55/head
Ionite 1 year ago
parent
commit
9743688c69
No known key found for this signature in database
  1. 4
      StabilityMatrix.Core/Processes/ProcessRunner.cs
  2. 5
      StabilityMatrix.Core/Python/PyVenvRunner.cs

4
StabilityMatrix.Core/Processes/ProcessRunner.cs

@ -125,7 +125,9 @@ public static class ProcessRunner
Dictionary<string, string>? environmentVariables = null) Dictionary<string, string>? environmentVariables = null)
{ {
// Quote arguments containing spaces // Quote arguments containing spaces
var args = string.Join(" ", arguments.Select(Quote)); var args = string.Join(" ", arguments
.Where(s => !string.IsNullOrEmpty(s))
.Select(Quote));
return StartProcess(fileName, args, workingDirectory, outputDataReceived, environmentVariables); return StartProcess(fileName, args, workingDirectory, outputDataReceived, environmentVariables);
} }

5
StabilityMatrix.Core/Python/PyVenvRunner.cs

@ -93,8 +93,9 @@ public class PyVenvRunner : IDisposable
// Create RootPath if it doesn't exist // Create RootPath if it doesn't exist
RootPath.Create(); RootPath.Create();
// Create venv // Create venv (copy mode if windows)
var args = new string[] { "-m", "virtualenv", "--always-copy", RootPath }; var args = new string[] { "-m", "virtualenv",
Compat.IsWindows ? "--always-copy" : "", RootPath };
var venvProc = ProcessRunner.StartProcess(PyRunner.PythonExePath, args); var venvProc = ProcessRunner.StartProcess(PyRunner.PythonExePath, args);
await venvProc.WaitForExitAsync(); await venvProc.WaitForExitAsync();

Loading…
Cancel
Save