Skip to content
Draft
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
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ env:
jobs:

build:
name: Build
name: Build (${{ matrix.platform }}, Go ${{ matrix.go-version }}, Python ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
# TODO: Consider official support matrix (OS and Go versions) and adjust this matrix accordingly
go-version: [1.25.x, 1.24.x, 1.23.x, 1.22.x]
platform: [ubuntu-latest, windows-latest, macos-15]
python-version: ['3.11', '3.12']
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -33,7 +34,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ matrix.python-version }}

- name: Install Go
uses: actions/setup-go@v5
Expand Down
10 changes: 8 additions & 2 deletions bind/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ func boolPyToGo(b C.char) bool {
}

func complex64GoToPy(c complex64) *C.PyObject {
return C.PyComplex_FromDoubles(C.double(real(c)), C.double(imag(c)))
gstate := C.PyGILState_Ensure()
obj := C.PyComplex_FromDoubles(C.double(real(c)), C.double(imag(c)))
C.PyGILState_Release(gstate)
return obj
}

func complex64PyToGo(o *C.PyObject) complex64 {
Expand All @@ -203,7 +206,10 @@ func complex64PyToGo(o *C.PyObject) complex64 {
}

func complex128GoToPy(c complex128) *C.PyObject {
return C.PyComplex_FromDoubles(C.double(real(c)), C.double(imag(c)))
gstate := C.PyGILState_Ensure()
obj := C.PyComplex_FromDoubles(C.double(real(c)), C.double(imag(c)))
C.PyGILState_Release(gstate)
return obj
}

func complex128PyToGo(o *C.PyObject) complex128 {
Expand Down
Loading