Skip to content

Commit 06ff5f0

Browse files
committed
try to improve .dylib detection on Mac
1 parent 87c4a53 commit 06ff5f0

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CI/Build+Test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ steps:
5353
$interpreter = if ($IsWindows) { "python.exe" } else { "python" }
5454
$interpreter = Join-Path "$(GetPython.pythonLocation)" $interpreter
5555
56+
Write-Host "$interpreter"
57+
5658
Get-ChildItem -Recurse "$(GetPython.pythonLocation)"
5759
5860
$pyEnvs = (dotnet run --project app/WhichPython.App.csproj interpreter "$interpreter") | Out-String

src/PythonEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,6 @@ static bool IsSubDirectoryOrSame(DirectoryInfo parent, DirectoryInfo child) {
399399
const string PrintSysPathScript = @"import sys; print('\n'.join(sys.path))";
400400

401401
const string LinuxGetLibPathsScript = "from distutils import sysconfig; import os.path as op; v = sysconfig.get_config_vars(); fpaths = [op.join(v[pv], v['LDLIBRARY']) for pv in ('LIBDIR', 'LIBPL')]; print(list(filter(op.exists, fpaths))[0])";
402-
const string MacGetLibPathsScript = "from distutils import sysconfig; import os.path as op; v = sysconfig.get_config_vars(); fpaths = [op.join(v[pv], v['LIBRARY']) for pv in ('LIBDIR', 'LIBPL')]; print(list(filter(op.exists, fpaths))[0])";
402+
const string MacGetLibPathsScript = "from distutils import sysconfig; import os.path as op; v = sysconfig.get_config_vars(); fpaths = [op.join(v[pv], fname) for pv in ('LIBDIR', 'LIBPL') for fname in (op.splitext(v['LIBRARY'])[0] + '.dylib', v['LIBRARY'])]; print(list(filter(op.exists, fpaths))[0])";
403403
}
404404
}

0 commit comments

Comments
 (0)