From e97cf7f9fe1e6ed50c5ecf1c5c61402f2775d3a2 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 26 Mar 2020 13:07:51 +0100 Subject: [PATCH 1/5] all: add Go-module support --- go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8dc3bb5 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/sbinet/go-python + +go 1.13 From fb007b5b0591c0bdec626386ead9bc6d1bba44a4 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 26 Mar 2020 13:08:24 +0100 Subject: [PATCH 2/5] ci: bump to Go-1.14+1.13 --- .travis.yml | 4 ++-- appveyor.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 678d6f3..a13c9f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: go go: - - 1.9.x - - 1.10.x + - 1.14.x + - 1.13.x before_install: - sudo apt-get update -qq diff --git a/appveyor.yml b/appveyor.yml index dbb5016..ad332c1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,7 +19,7 @@ environment: CPYTHON2DIR: "C:\\Python27-x64" PATH: '%GOPATH%\bin;%CPYTHON2DIR%;%CPYTHON2DIR%\\Scripts;C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%' -stack: go 1.11 +stack: go 1.13 build_script: - "%CPYTHON2DIR%\\python --version" From 5167a7b23e1d6ac26f3529a48ae01b9ffb62e1ed Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 26 Mar 2020 15:22:31 +0100 Subject: [PATCH 3/5] capi: prevent from directly wrapping Go functions Fixes #102. --- capi.go | 4 +++- heap.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/capi.go b/capi.go index 2d8d777..deec35f 100644 --- a/capi.go +++ b/capi.go @@ -16,11 +16,13 @@ func Py_BuildValue(format string, args ...interface{}) *PyObject { // ml_doc char * points to the contents of the docstring type PyMethodDef struct { Name string // name of the method - Meth func(self, args *PyObject) *PyObject + Meth PyCFunction Flags MethodDefFlags Doc string } +type PyCFunction C.PyCFunction + type MethodDefFlags int const ( diff --git a/heap.go b/heap.go index d3a00a1..d5f0c27 100644 --- a/heap.go +++ b/heap.go @@ -24,7 +24,7 @@ func cpyMethodDefs(name string, methods []PyMethodDef) *C.PyMethodDef { for i, meth := range methods { cmeth := C.PyMethodDef{ ml_name: C.CString(meth.Name), - ml_meth: (C.PyCFunction)(unsafe.Pointer(&meth.Meth)), + ml_meth: C.PyCFunction(meth.Meth), ml_flags: C.int(meth.Flags), ml_doc: C.CString(meth.Doc), } @@ -43,6 +43,7 @@ func Py_InitModule(name string, methods []PyMethodDef) (*PyObject, error) { obj := togo(C._gopy_InitModule(c_mname, cmeths)) if obj == nil { + PyErr_Print() return nil, errors.New("python: internal error; module creation failed.") } return obj, nil @@ -59,6 +60,7 @@ func Py_InitModule3(name string, methods []PyMethodDef, doc string) (*PyObject, obj := togo(C._gopy_InitModule3(cname, cmeths, cdoc)) if obj == nil { + PyErr_Print() return nil, errors.New("python: internal error; module creation failed.") } return obj, nil From d6ca9f284dab685f42c80cd635ef9169aa5f2afc Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Wed, 14 Apr 2021 10:53:08 +0200 Subject: [PATCH 4/5] doc: update GoDoc badge to point to godocs.io Fixes #113. Signed-off-by: Sebastien Binet --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f79d2e4..956edf6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ go-python [![Build Status](https://travis-ci.org/sbinet/go-python.svg?branch=master)](https://travis-ci.org/sbinet/go-python) [![Build status](https://ci.appveyor.com/api/projects/status/n0ujg8no487a89vo/branch/master?svg=true)](https://ci.appveyor.com/project/sbinet/go-python/branch/master) +[![GoDocs](https://godocs.io/github.com/sbinet/go-python?status.svg)](https://godocs.io/github.com/sbinet/go-python) Naive `go` bindings towards the C-API of CPython-2. @@ -48,9 +49,9 @@ If ``go get`` + ``pkg-config`` failed: Documentation ------------- -Is available on ``godoc``: +Is available on ``godocs``: - http://godoc.org/github.com/sbinet/go-python + https://godocs.io/github.com/sbinet/go-python Example: From 9a5a20a386a7281f0ef1f7af682c54c7f32a30de Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Mon, 24 Jul 2023 09:11:30 +0200 Subject: [PATCH 5/5] all: archiving sbinet/go-python --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 956edf6..2e82335 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ go-python ========= +**`sbinet/go-python` only supports CPython2. CPython2 isn't supported anymore by [python.org](https://python.org). Thus, `sbinet/go-python` is now archived.** +**A possible alternative may be to use and contribute to [go-python/cpy3](https://github.com/go-python/cpy3) instead.** + [![Build Status](https://travis-ci.org/sbinet/go-python.svg?branch=master)](https://travis-ci.org/sbinet/go-python) [![Build status](https://ci.appveyor.com/api/projects/status/n0ujg8no487a89vo/branch/master?svg=true)](https://ci.appveyor.com/project/sbinet/go-python/branch/master) [![GoDocs](https://godocs.io/github.com/sbinet/go-python?status.svg)](https://godocs.io/github.com/sbinet/go-python) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy