镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class PythonNet : IDisposable
{
public bool Initialized { get; }

public bool VersionMismatch { get; }

public PythonNet()
{
bool pythonSet = Environment.GetEnvironmentVariable("PYTHONNET_PYDLL") != null;
Expand All @@ -44,7 +46,17 @@ public PythonNet()
return;
}

PythonEngine.Initialize();
try
{
PythonEngine.Initialize();
}
catch (NotSupportedException e) when (e.Message.Contains("Python ABI ") && e.Message.Contains("not supported"))
{
// An unsupported version of Python is being used
Initialized = false;
VersionMismatch = true;
return;
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
PythonEngine.PythonPath.IndexOf("dlls", StringComparison.OrdinalIgnoreCase) < 0)
Expand All @@ -66,6 +78,8 @@ public CDataSchemaPythonTest(PythonNet pythonNet)
{
if (!pythonNet.Initialized)
{
Skip.If(pythonNet.VersionMismatch, "VM has incompatible version of Python installed; skipping C Data Interface tests.");

bool inCIJob = Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
bool inVerificationJob = Environment.GetEnvironmentVariable("TEST_CSHARP") == "1";

Expand Down