Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

25 changes: 22 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,28 @@ jobs:
run: |
pip install numpy
./bin/Debug/tap run bin/Debug/test.TapPlan --non-interactive



test-alpine:
runs-on: ubuntu-latest
container:
image: alpine:3.21
steps:
- name: Install dependencies
run: |
apk add --no-cache \
bash git python3 python3-dev py3-pip py3-numpy \
dotnet-sdk-8.0 \
icu-libs
- name: Checkout
uses: actions/checkout@v4
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: ./bin/Debug/tap python test
- name: Test Plan
run: ./bin/Debug/tap run bin/Debug/test.TapPlan --non-interactive

publish-package:
if: github.ref == 'refs/heads/dev' || contains(github.ref, 'refs/heads/release') || contains(github.ref, 'refs/tags/v')
environment: packages.opentap.io
Expand Down
2 changes: 1 addition & 1 deletion .gitversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This is the version number that will be used. Prerelease numbers are calculated by
# counting git commits since the last change in this value.
version = 3.2.0
version = 3.2.1

# A version is determined to be a "beta" prerelease if it originates from the default branch
# The default branch is the first branch that matches the following regular expession.
Expand Down
21 changes: 16 additions & 5 deletions OpenTap.Python/PythonInstallationDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static bool GetVersion(string libPath, out int major, out int minor)

var sh = SharedLib.Load(libPath);

if (sh is null)
return false;

var versionSymbol = sh.GetSymbol("Py_GetVersion");
if (versionSymbol == IntPtr.Zero)
return false;
Expand All @@ -75,7 +78,8 @@ static IEnumerable<string> GetPythonsInFolder(string folderPath)
List<string> pys = new List<string>();
foreach (var dir in Directory.GetDirectories(folderPath))
{
if (Path.GetFileName(dir).Contains("Python"))
string fileName = Path.GetFileName(dir);
if (fileName.ToLower().Contains("python"))
{
pys.Add(dir);
}
Expand All @@ -101,8 +105,10 @@ static IEnumerable<string> LocatePythonsWin32()
var programFiles5 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Programs", "Python");
var programFiles6 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
var programFiles7 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Python");

return drives.Concat(new[] { programFiles, programFiles6, programFiles2, programFiles3, programFiles4, programFiles5 })
return drives.Concat(new[] { programFiles, programFiles2, programFiles3, programFiles4, programFiles5, programFiles6, programFiles7 })
.SelectMany(GetPythonsInFolder).Distinct().ToArray();
}

Expand Down Expand Up @@ -175,9 +181,14 @@ static IEnumerable<string> LocatePythonsWin32()
}

}
else
else // Assume OS is Linux
{
foreach(var basePath in new [] {"/usr/lib/x86_64-linux-gnu/", "/usr/lib/aarch64-linux-gnu/"}
foreach(var basePath in new [] {
"/usr/lib/x86_64-linux-gnu/",
"/usr/lib/aarch64-linux-gnu/",
"/usr/lib/" // alpine linux

}
.Where(Directory.Exists))
foreach (var python in TryFindPythons(basePath))
{
Expand Down Expand Up @@ -239,4 +250,4 @@ static IEnumerable<string> TryFindPythons(string path)
}
}
}
}
}
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@ Pythonnet is used for integrating Python and C#. The original source can be foun
This plugin depends on a fork of PythonNet: [PythonNet Fork](https://github.com/pythonnet/pythonnet/): https://github.com/rmadsen-ks/pythonnet

- git commit: 338b01fac14e1f8a5882949970125fe817c2d8d3

__Developers__
- Lim Jing Huey
- Kyler Lee
- Gordon Ong
- Jingwei Liang
- Joseph Hoff
- Navjodh Dhillon
- Rolf Madsen (*Maintainer* @rmadsen-ks, rolf_madsen@keysight.com)
Loading