From 21ca0fbd09e522f18a636ad1bd4efd2e6174233c Mon Sep 17 00:00:00 2001 From: bsrdjan Date: Wed, 3 Jan 2024 13:02:15 +0100 Subject: [PATCH] fix: fix 2.8.3 version for python 3.7 closes #316 --- pyproject.toml | 6 ++-- src/pyrfc/__init__.py | 9 ++++-- src/pyrfc/_cyrfc.cpp | 73 ++++++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31366f5..fb64a0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" # https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ [project] name = "pyrfc" -version = "2.8.3" +version = "2.8.31" readme = "README.md" license = { file = "LICENSES/Apache-2.0.txt" } description = "Python bindings for SAP NetWeaver RFC SDK" @@ -30,7 +30,9 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only" ] -dependencies = [] +dependencies = [ + "importlib-metadata" +] [project.urls] homepage = "https://github.com/SAP/PyRFC" diff --git a/src/pyrfc/__init__.py b/src/pyrfc/__init__.py index e3104cb..de53a86 100755 --- a/src/pyrfc/__init__.py +++ b/src/pyrfc/__init__.py @@ -2,10 +2,15 @@ # # SPDX-License-Identifier: Apache-2.0 -import importlib.metadata import os +import sys -__version__ = importlib.metadata.version("pyrfc") +if sys.version_info < (3,8): + import importlib_metadata as mtd +else: + import importlib.metadata as mtd + +__version__ = mtd.version("pyrfc") __version_info__ = tuple(__version__.split(".")) if os.name == "nt": diff --git a/src/pyrfc/_cyrfc.cpp b/src/pyrfc/_cyrfc.cpp index 091e311..deafd8c 100644 --- a/src/pyrfc/_cyrfc.cpp +++ b/src/pyrfc/_cyrfc.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.34 */ +/* Generated by Cython 0.29.37 */ /* BEGIN: Cython Metadata { @@ -80,8 +80,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_34" -#define CYTHON_HEX_VERSION 0x001D22F0 +#define CYTHON_ABI "0_29_37" +#define CYTHON_HEX_VERSION 0x001D25F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -149,10 +149,14 @@ END: Cython Metadata */ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -450,9 +454,6 @@ class __Pyx_FakeReference { T *ptr; }; -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 @@ -530,6 +531,11 @@ class __Pyx_FakeReference { #endif #define __Pyx_DefaultClassType PyType_Type #endif +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -41152,7 +41158,7 @@ static PyObject *__pyx_tp_new_5pyrfc_6_cyrfc_ConnectionParameters(PyTypeObject * static void __pyx_tp_dealloc_5pyrfc_6_cyrfc_ConnectionParameters(PyObject *o) { #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41234,7 +41240,7 @@ static PyTypeObject __pyx_type_5pyrfc_6_cyrfc_ConnectionParameters = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -41259,7 +41265,7 @@ static PyObject *__pyx_tp_new_5pyrfc_6_cyrfc_Connection(PyTypeObject *t, CYTHON_ static void __pyx_tp_dealloc_5pyrfc_6_cyrfc_Connection(PyObject *o) { struct __pyx_obj_5pyrfc_6_cyrfc_Connection *p = (struct __pyx_obj_5pyrfc_6_cyrfc_Connection *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41498,7 +41504,7 @@ static PyTypeObject __pyx_type_5pyrfc_6_cyrfc_Connection = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -41522,7 +41528,7 @@ static PyObject *__pyx_tp_new_5pyrfc_6_cyrfc_ServerConnection(PyTypeObject *t, C static void __pyx_tp_dealloc_5pyrfc_6_cyrfc_ServerConnection(PyObject *o) { struct __pyx_obj_5pyrfc_6_cyrfc_ServerConnection *p = (struct __pyx_obj_5pyrfc_6_cyrfc_ServerConnection *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41731,7 +41737,7 @@ static PyTypeObject __pyx_type_5pyrfc_6_cyrfc_ServerConnection = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -41761,7 +41767,7 @@ static PyObject *__pyx_tp_new_5pyrfc_6_cyrfc_Server(PyTypeObject *t, PyObject *a static void __pyx_tp_dealloc_5pyrfc_6_cyrfc_Server(PyObject *o) { struct __pyx_obj_5pyrfc_6_cyrfc_Server *p = (struct __pyx_obj_5pyrfc_6_cyrfc_Server *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -41918,7 +41924,7 @@ static PyTypeObject __pyx_type_5pyrfc_6_cyrfc_Server = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -41942,7 +41948,7 @@ static PyObject *__pyx_tp_new_5pyrfc_6_cyrfc_Throughput(PyTypeObject *t, CYTHON_ static void __pyx_tp_dealloc_5pyrfc_6_cyrfc_Throughput(PyObject *o) { struct __pyx_obj_5pyrfc_6_cyrfc_Throughput *p = (struct __pyx_obj_5pyrfc_6_cyrfc_Throughput *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -42068,7 +42074,7 @@ static PyTypeObject __pyx_type_5pyrfc_6_cyrfc_Throughput = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -42164,7 +42170,7 @@ static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____object___to_py = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif - #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; @@ -49058,7 +49064,10 @@ static PyTypeObject __pyx_CyFunctionType_type = { #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; @@ -50046,7 +50055,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -50242,7 +50251,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -50438,7 +50447,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -50672,7 +50681,7 @@ static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -50906,7 +50915,7 @@ static CYTHON_INLINE RFC_RC __Pyx_PyInt_As_RFC_RC(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -51102,7 +51111,7 @@ static CYTHON_INLINE RFCTYPE __Pyx_PyInt_As_RFCTYPE(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -51298,7 +51307,7 @@ static CYTHON_INLINE RFC_DIRECTION __Pyx_PyInt_As_RFC_DIRECTION(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -51532,7 +51541,7 @@ static CYTHON_INLINE RFC_INT __Pyx_PyInt_As_RFC_INT(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -51728,7 +51737,7 @@ static CYTHON_INLINE RFC_INT8 __Pyx_PyInt_As_RFC_INT8(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -51962,7 +51971,7 @@ static CYTHON_INLINE RFC_ERROR_GROUP __Pyx_PyInt_As_RFC_ERROR_GROUP(PyObject *x) break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } @@ -52310,7 +52319,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { break; } #endif -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; }