From 2f5058635835a4c40e5cbf80a9e298df764607dd Mon Sep 17 00:00:00 2001 From: Ross Wolf <31489089+rw-access@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:25:07 -0700 Subject: [PATCH] Bump cpy3 to Python 3.10 --- .github/workflows/test.yml | 2 +- README.md | 8 ++++---- high_level_layer.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3331ed..8d6a0c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.9.13' + python-version: '3.10.10' - id: go-cache-paths run: | diff --git a/README.md b/README.md index f70a2da..8693066 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Go bindings for the CPython-3 C-API -**Currently supports python-3.9 only.** +**Currently supports python-3.10 only.** This package provides a ``go`` package named "python" under which most of the ``PyXYZ`` functions and macros of the public C-API of CPython have been @@ -24,13 +24,13 @@ This project was inspired by [`sbinet/go-python`](https://github.com/sbinet/go-p ### macOS * Install brew -* `brew install python@3.9` +* `brew install python@3.10` * `brew install pkg-config` ### Linux -We will need `pkg-config` and a working `python3.9` environment to build these +We will need `pkg-config` and a working `python3.10` environment to build these bindings. Make sure you have Python libraries and header files installed as -well (`python3.9-dev` on Debian, `brew install python@3.9` on macOS, or `python3-devel` on Centos for example).. +well (`python3.10-dev` on Debian, `brew install python@3.10` on macOS, or `python3-devel` on Centos for example).. By default `pkg-config` will look at the `python3` library so if you want to choose a specific version just symlink `python-X.Y.pc` to `python3.pc` or use diff --git a/high_level_layer.go b/high_level_layer.go index 7f64c2b..0054752 100644 --- a/high_level_layer.go +++ b/high_level_layer.go @@ -8,7 +8,7 @@ Copyright 2018 Datadog, Inc. package python3 /* -#cgo pkg-config: python-3.9-embed +#cgo pkg-config: python-3.10-embed #include "Python.h" */ import "C" @@ -17,7 +17,7 @@ import ( "unsafe" ) -//Py_Main : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.Py_Main +// Py_Main : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.Py_Main // "error" will be set if we fail to call "Py_DecodeLocale" on every "args". func Py_Main(args []string) (int, error) { argc := C.int(len(args)) @@ -38,7 +38,7 @@ func Py_Main(args []string) (int, error) { return int(C.Py_Main(argc, (**C.wchar_t)(unsafe.Pointer(&argv[0])))), nil } -//PyRun_AnyFile : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.PyRun_AnyFile +// PyRun_AnyFile : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.PyRun_AnyFile // "error" will be set if we fail to open "filename". func PyRun_AnyFile(filename string) (int, error) { cfilename := C.CString(filename) @@ -57,7 +57,7 @@ func PyRun_AnyFile(filename string) (int, error) { return int(C.PyRun_AnyFileFlags(cfile, cfilename, nil)), nil } -//PyRun_SimpleString : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.PyRun_SimpleString +// PyRun_SimpleString : https://docs.python.org/3/c-api/veryhigh.html?highlight=pycompilerflags#c.PyRun_SimpleString func PyRun_SimpleString(command string) int { ccommand := C.CString(command) defer C.free(unsafe.Pointer(ccommand))