- update to 1.17.0:
* Add support for Python 3.13. * In API mode, when you get a function from a C library by writing `fn = lib.myfunc`, you get an object of a special type for performance reasons, instead of a `<cdata 'C-function-type'>`. Before version 1.17 you could only call such objects. You could write `ffi.addressof(lib, "myfunc")` in order to get a real `<cdata>` object, based on the idea that in these cases in C you'd usually write `&myfunc` instead of `myfunc`. In version 1.17, the special object `lib.myfunc` can now be passed in many places where CFFI expects a regular `<cdata>` object. For example, you can now pass it as a callback to a C function call, or write it inside a C structure field of the correct pointer-to-function type, or use `ffi.cast()` or `ffi.typeof()` on it. - drop py313-compat.patch, py313-use-format-unraisable.patch, py313-use-hashpointer.patch (upstream) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=99
This commit is contained in:
commit
a4f2bc8ce4
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
cffi-1.16.0.tar.gz
Normal file
3
cffi-1.16.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0
|
||||
size 512873
|
3
cffi-1.17.0.tar.gz
Normal file
3
cffi-1.17.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3157624b7558b914cb039fd1af735e5e8049a87c817cc215109ad1c8779df76
|
||||
size 516073
|
302
py313-compat.patch
Normal file
302
py313-compat.patch
Normal file
@ -0,0 +1,302 @@
|
||||
From 14723b0bbd127790c450945099db31018d80fa83 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
|
||||
Date: Thu, 30 Nov 2023 18:27:52 -0800
|
||||
Subject: [PATCH] Python 3.13 compatibility (#24)
|
||||
|
||||
* fix obsolete private API aliases for 3.13 compat
|
||||
|
||||
* update unraisable tests to use sys.unraisablehook
|
||||
|
||||
* assert shape of calls to unraisablehook and sanity check traceback contents instead of (varying) stderr output from default unraisablehook impl
|
||||
---
|
||||
src/c/_cffi_backend.c | 4 +-
|
||||
src/c/misc_thread_common.h | 4 +-
|
||||
src/c/test_c.py | 217 ++++++++++++-------------------------
|
||||
3 files changed, 74 insertions(+), 151 deletions(-)
|
||||
|
||||
diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c
|
||||
index 5e284e00..7c72ffe0 100644
|
||||
--- a/src/c/_cffi_backend.c
|
||||
+++ b/src/c/_cffi_backend.c
|
||||
@@ -134,8 +134,8 @@
|
||||
# define PyText_Check PyUnicode_Check
|
||||
# define PyTextAny_Check PyUnicode_Check
|
||||
# define PyText_FromFormat PyUnicode_FromFormat
|
||||
-# define PyText_AsUTF8 _PyUnicode_AsString /* PyUnicode_AsUTF8 in Py3.3 */
|
||||
-# define PyText_AS_UTF8 _PyUnicode_AsString
|
||||
+# define PyText_AsUTF8 PyUnicode_AsUTF8
|
||||
+# define PyText_AS_UTF8 PyUnicode_AsUTF8
|
||||
# if PY_VERSION_HEX >= 0x03030000
|
||||
# define PyText_GetSize PyUnicode_GetLength
|
||||
# else
|
||||
diff --git a/src/c/misc_thread_common.h b/src/c/misc_thread_common.h
|
||||
index ead9c83c..7d29634b 100644
|
||||
--- a/src/c/misc_thread_common.h
|
||||
+++ b/src/c/misc_thread_common.h
|
||||
@@ -331,7 +331,9 @@ PyAPI_DATA(void *volatile) _PyThreadState_Current;
|
||||
|
||||
static PyThreadState *get_current_ts(void)
|
||||
{
|
||||
-#if PY_VERSION_HEX >= 0x03060000
|
||||
+#if PY_VERSION_HEX >= 0x030D0000
|
||||
+ return PyThreadState_GetUnchecked();
|
||||
+#elif PY_VERSION_HEX >= 0x03060000
|
||||
return _PyThreadState_UncheckedGet();
|
||||
#elif defined(_Py_atomic_load_relaxed)
|
||||
return (PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current);
|
||||
diff --git a/src/c/test_c.py b/src/c/test_c.py
|
||||
index 1cdab10f..10cc35cf 100644
|
||||
--- a/src/c/test_c.py
|
||||
+++ b/src/c/test_c.py
|
||||
@@ -1,5 +1,12 @@
|
||||
+from __future__ import annotations
|
||||
+
|
||||
+import contextlib
|
||||
+import traceback
|
||||
+import unittest.mock
|
||||
+
|
||||
import pytest
|
||||
import sys
|
||||
+import typing as t
|
||||
|
||||
is_musl = False
|
||||
if sys.platform == 'linux':
|
||||
@@ -1337,27 +1344,37 @@ def cb(n):
|
||||
e = pytest.raises(TypeError, f)
|
||||
assert str(e.value) == "'int(*)(int)' expects 1 arguments, got 0"
|
||||
|
||||
+@contextlib.contextmanager
|
||||
+def _assert_unraisable(error_type: type[Exception] | None, message: str = '', traceback_tokens: list[str] | None = None):
|
||||
+ """Assert that a given sys.unraisablehook interaction occurred (or did not occur, if error_type is None) while this context was active"""
|
||||
+ raised_errors: list[Exception] = []
|
||||
+ raised_traceback: str = ''
|
||||
+
|
||||
+ # sys.unraisablehook is called more than once for chained exceptions; accumulate the errors and tracebacks for inspection
|
||||
+ def _capture_unraisable_hook(ur_args):
|
||||
+ nonlocal raised_traceback
|
||||
+ raised_errors.append(ur_args.exc_value)
|
||||
+
|
||||
+ # NB: need to use the old etype/value/tb form until 3.10 is the minimum
|
||||
+ raised_traceback += (ur_args.err_msg or '' + '\n') + ''.join(traceback.format_exception(None, ur_args.exc_value, ur_args.exc_traceback))
|
||||
+
|
||||
+
|
||||
+ with pytest.MonkeyPatch.context() as mp:
|
||||
+ mp.setattr(sys, 'unraisablehook', _capture_unraisable_hook)
|
||||
+ yield
|
||||
+
|
||||
+ if error_type is None:
|
||||
+ assert not raised_errors
|
||||
+ assert not raised_traceback
|
||||
+ return
|
||||
+
|
||||
+ assert any(type(raised_error) is error_type for raised_error in raised_errors)
|
||||
+ assert any(message in str(raised_error) for raised_error in raised_errors)
|
||||
+ for t in traceback_tokens or []:
|
||||
+ assert t in raised_traceback
|
||||
+
|
||||
+
|
||||
def test_callback_exception():
|
||||
- try:
|
||||
- import cStringIO
|
||||
- except ImportError:
|
||||
- import io as cStringIO # Python 3
|
||||
- import linecache
|
||||
- def matches(istr, ipattern, ipattern38, ipattern311=None):
|
||||
- if sys.version_info >= (3, 8):
|
||||
- ipattern = ipattern38
|
||||
- if sys.version_info >= (3, 11):
|
||||
- ipattern = ipattern311 or ipattern38
|
||||
- str, pattern = istr, ipattern
|
||||
- while '$' in pattern:
|
||||
- i = pattern.index('$')
|
||||
- assert str[:i] == pattern[:i]
|
||||
- j = str.find(pattern[i+1], i)
|
||||
- assert i + 1 <= j <= str.find('\n', i)
|
||||
- str = str[j:]
|
||||
- pattern = pattern[i+1:]
|
||||
- assert str == pattern
|
||||
- return True
|
||||
def check_value(x):
|
||||
if x == 10000:
|
||||
raise ValueError(42)
|
||||
@@ -1366,148 +1383,52 @@ def Zcb1(x):
|
||||
return x * 3
|
||||
BShort = new_primitive_type("short")
|
||||
BFunc = new_function_type((BShort,), BShort, False)
|
||||
+
|
||||
f = callback(BFunc, Zcb1, -42)
|
||||
- #
|
||||
seen = []
|
||||
oops_result = None
|
||||
def oops(*args):
|
||||
seen.append(args)
|
||||
return oops_result
|
||||
ff = callback(BFunc, Zcb1, -42, oops)
|
||||
- #
|
||||
- orig_stderr = sys.stderr
|
||||
- orig_getline = linecache.getline
|
||||
- try:
|
||||
- linecache.getline = lambda *args: 'LINE' # hack: speed up PyPy tests
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- if hasattr(sys, '__unraisablehook__'): # work around pytest
|
||||
- sys.unraisablehook = sys.__unraisablehook__ # on recent CPythons
|
||||
+ with _assert_unraisable(None):
|
||||
assert f(100) == 300
|
||||
- assert sys.stderr.getvalue() == ''
|
||||
+ with _assert_unraisable(ValueError, '42', ['in Zcb1', 'in check_value']):
|
||||
assert f(10000) == -42
|
||||
- assert matches(sys.stderr.getvalue(), """\
|
||||
-From cffi callback <function$Zcb1 at 0x$>:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in Zcb1
|
||||
- $
|
||||
- File "$", line $, in check_value
|
||||
- $
|
||||
-ValueError: 42
|
||||
-""", """\
|
||||
-Exception ignored from cffi callback <function$Zcb1 at 0x$>:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in Zcb1
|
||||
- $
|
||||
- File "$", line $, in check_value
|
||||
- $
|
||||
-ValueError: 42
|
||||
-""")
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- bigvalue = 20000
|
||||
+
|
||||
+ bigvalue = 20000
|
||||
+ with _assert_unraisable(OverflowError, "integer 60000 does not fit 'short'", ['callback', 'Zcb1']):
|
||||
assert f(bigvalue) == -42
|
||||
- assert matches(sys.stderr.getvalue(), """\
|
||||
-From cffi callback <function$Zcb1 at 0x$>:
|
||||
-Trying to convert the result back to C:
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-""", """\
|
||||
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in test_callback_exception
|
||||
- $
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-""")
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- bigvalue = 20000
|
||||
- assert len(seen) == 0
|
||||
+ assert len(seen) == 0
|
||||
+
|
||||
+ with _assert_unraisable(None):
|
||||
assert ff(bigvalue) == -42
|
||||
- assert sys.stderr.getvalue() == ""
|
||||
- assert len(seen) == 1
|
||||
- exc, val, tb = seen[0]
|
||||
- assert exc is OverflowError
|
||||
- assert str(val) == "integer 60000 does not fit 'short'"
|
||||
- #
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- bigvalue = 20000
|
||||
- del seen[:]
|
||||
- oops_result = 81
|
||||
+ assert len(seen) == 1
|
||||
+ exc, val, tb = seen[0]
|
||||
+ assert exc is OverflowError
|
||||
+ assert str(val) == "integer 60000 does not fit 'short'"
|
||||
+
|
||||
+ del seen[:]
|
||||
+ oops_result = 81
|
||||
+ with _assert_unraisable(None):
|
||||
assert ff(bigvalue) == 81
|
||||
- oops_result = None
|
||||
- assert sys.stderr.getvalue() == ""
|
||||
- assert len(seen) == 1
|
||||
- exc, val, tb = seen[0]
|
||||
- assert exc is OverflowError
|
||||
- assert str(val) == "integer 60000 does not fit 'short'"
|
||||
- #
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- bigvalue = 20000
|
||||
- del seen[:]
|
||||
- oops_result = "xy" # not None and not an int!
|
||||
+
|
||||
+ assert len(seen) == 1
|
||||
+ exc, val, tb = seen[0]
|
||||
+ assert exc is OverflowError
|
||||
+ assert str(val) == "integer 60000 does not fit 'short'"
|
||||
+
|
||||
+ del seen[:]
|
||||
+ oops_result = "xy" # not None and not an int!
|
||||
+
|
||||
+ with _assert_unraisable(TypeError, "an integer is required", ["integer 60000 does not fit 'short'"]):
|
||||
assert ff(bigvalue) == -42
|
||||
- oops_result = None
|
||||
- assert matches(sys.stderr.getvalue(), """\
|
||||
-From cffi callback <function$Zcb1 at 0x$>:
|
||||
-Trying to convert the result back to C:
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-
|
||||
-During the call to 'onerror', another exception occurred:
|
||||
-
|
||||
-TypeError: $integer$
|
||||
-""", """\
|
||||
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in test_callback_exception
|
||||
- $
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-Exception ignored during handling of the above exception by 'onerror':
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in test_callback_exception
|
||||
- $
|
||||
-TypeError: $integer$
|
||||
-""")
|
||||
- #
|
||||
- sys.stderr = cStringIO.StringIO()
|
||||
- seen = "not a list" # this makes the oops() function crash
|
||||
+
|
||||
+ seen = "not a list" # this makes the oops() function crash
|
||||
+ oops_result = None
|
||||
+ with _assert_unraisable(AttributeError, "'str' object has no attribute 'append", ['Zcb1', 'ff', 'oops']):
|
||||
assert ff(bigvalue) == -42
|
||||
- # the $ after the AttributeError message are for the suggestions that
|
||||
- # will be added in Python 3.10
|
||||
- assert matches(sys.stderr.getvalue(), """\
|
||||
-From cffi callback <function$Zcb1 at 0x$>:
|
||||
-Trying to convert the result back to C:
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-
|
||||
-During the call to 'onerror', another exception occurred:
|
||||
-
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in oops
|
||||
- $
|
||||
-AttributeError: 'str' object has no attribute 'append$
|
||||
-""", """\
|
||||
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in test_callback_exception
|
||||
- $
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-Exception ignored during handling of the above exception by 'onerror':
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in oops
|
||||
- $
|
||||
-AttributeError: 'str' object has no attribute 'append$
|
||||
-""", """\
|
||||
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in test_callback_exception
|
||||
- $
|
||||
-OverflowError: integer 60000 does not fit 'short'
|
||||
-Exception ignored during handling of the above exception by 'onerror':
|
||||
-Traceback (most recent call last):
|
||||
- File "$", line $, in oops
|
||||
- $
|
||||
- $
|
||||
-AttributeError: 'str' object has no attribute 'append$
|
||||
-""")
|
||||
- finally:
|
||||
- sys.stderr = orig_stderr
|
||||
- linecache.getline = orig_getline
|
||||
+
|
||||
|
||||
def test_callback_return_type():
|
||||
for rettype in ["signed char", "short", "int", "long", "long long",
|
30
py313-use-format-unraisable.patch
Normal file
30
py313-use-format-unraisable.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 49127c6929bfc7186fbfd3819dd5e058ad888de4 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Stinner <vstinner@python.org>
|
||||
Date: Thu, 16 Nov 2023 17:26:12 +0100
|
||||
Subject: [PATCH] Use PyErr_FormatUnraisable() on Python 3.13 (#34)
|
||||
|
||||
Use the new public PyErr_FormatUnraisable() on Python 3.13.
|
||||
|
||||
The private _PyErr_WriteUnraisableMsg() function was removed in
|
||||
Python 3.13:
|
||||
https://github.com/python/cpython/pull/111643
|
||||
---
|
||||
src/c/_cffi_backend.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c
|
||||
index 76ed8f09..5e284e00 100644
|
||||
--- a/src/c/_cffi_backend.c
|
||||
+++ b/src/c/_cffi_backend.c
|
||||
@@ -6118,7 +6118,11 @@ static void _my_PyErr_WriteUnraisable(PyObject *t, PyObject *v, PyObject *tb,
|
||||
|
||||
PyErr_Restore(t, v, tb);
|
||||
if (s != NULL) {
|
||||
+#if PY_VERSION_HEX >= 0x030D0000
|
||||
+ PyErr_FormatUnraisable("Exception ignored %S", s);
|
||||
+#else
|
||||
_PyErr_WriteUnraisableMsg(PyText_AS_UTF8(s), NULL);
|
||||
+#endif
|
||||
Py_DECREF(s);
|
||||
}
|
||||
else
|
32
py313-use-hashpointer.patch
Normal file
32
py313-use-hashpointer.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From c27335f0f8e1e4436082236e92ddabe1b8324d22 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
|
||||
Date: Wed, 7 Feb 2024 09:12:08 -0800
|
||||
Subject: [PATCH] use public Py_HashPointer API on 3.13+ (#52)
|
||||
|
||||
* use public Py_HashPointer API on 3.13+
|
||||
|
||||
* Wrong direction in the conditional
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: Armin Rigo <armin.rigo@gmail.com>
|
||||
---
|
||||
src/c/_cffi_backend.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c
|
||||
index cb82e16d..14fe9106 100644
|
||||
--- a/src/c/_cffi_backend.c
|
||||
+++ b/src/c/_cffi_backend.c
|
||||
@@ -2466,7 +2466,11 @@ static Py_hash_t cdata_hash(PyObject *v)
|
||||
}
|
||||
Py_DECREF(vv);
|
||||
}
|
||||
+#if PY_VERSION_HEX < 0x030D0000
|
||||
return _Py_HashPointer(((CDataObject *)v)->c_data);
|
||||
+#else
|
||||
+ return Py_HashPointer(((CDataObject *)v)->c_data);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static Py_ssize_t
|
4
python-cffi-rpmlintrc
Normal file
4
python-cffi-rpmlintrc
Normal file
@ -0,0 +1,4 @@
|
||||
# cffi specifically installs C headers in site-packages, so :
|
||||
addFilter("devel-file-in-non-devel-package .*/site-packages/cffi/parse_c_type.h")
|
||||
addFilter("devel-file-in-non-devel-package .*/site-packages/cffi/_cffi_(include|errors).h")
|
||||
addFilter("devel-file-in-non-devel-package .*/site-packages/cffi/_embedding.h")
|
775
python-cffi.changes
Normal file
775
python-cffi.changes
Normal file
@ -0,0 +1,775 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 31 12:39:52 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.17.0:
|
||||
* Add support for Python 3.13.
|
||||
* In API mode, when you get a function from a C library by writing
|
||||
`fn = lib.myfunc`, you get an object of a special type for
|
||||
performance reasons, instead of a `<cdata 'C-function-type'>`.
|
||||
Before version 1.17 you could only call such objects.
|
||||
You could write `ffi.addressof(lib, "myfunc")` in order to get
|
||||
a real `<cdata>` object, based on the idea that in these cases
|
||||
in C you'd usually write `&myfunc` instead of `myfunc`. In
|
||||
version 1.17, the special object `lib.myfunc` can now be passed
|
||||
in many places where CFFI expects
|
||||
a regular `<cdata>` object. For example, you can now pass
|
||||
it as a callback to a C function call, or write it inside a C
|
||||
structure field of the correct pointer-to-function type, or use
|
||||
`ffi.cast()` or `ffi.typeof()` on it.
|
||||
- drop py313-compat.patch, py313-use-format-unraisable.patch,
|
||||
py313-use-hashpointer.patch (upstream)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jun 30 21:26:53 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add py313-compat.patch
|
||||
py313-use-format-unraisable.patch
|
||||
py313-use-hashpointer.patch: add upstream patches for py3.13
|
||||
support
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 29 09:46:12 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
||||
|
||||
- drop unnecessary buildrequire python-py
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 6 16:25:24 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Upgrade to 1.16.0:
|
||||
- Add support for Python 3.12. With the removal of distutils
|
||||
from Python 3.12, projects using CFFI features that depend on
|
||||
distutils at runtime must add a dependency on setuptools to
|
||||
function under Python 3.12+. CFFI does not declare a runtime
|
||||
setuptools requirement to avoid an unnecessary dependency for
|
||||
projects that do not require it.
|
||||
- Drop support for end-of-life Python versions (2.7, 3.6, 3.7).
|
||||
- Move project source under src/; a more standard layout that
|
||||
also enables CI to more easily catch packaging errors.
|
||||
- Move project home to python-cffi/cffi on GitHub.
|
||||
- Add support for PEP517 builds; setuptools is now a required
|
||||
build dependency.
|
||||
- Declare python_requires metadata for Python 3.8+. This allows
|
||||
unsupported Pythons to continue using previously released
|
||||
sdists and wheels.
|
||||
- Add missing calls to PyObject_GC_UnTrack to avoid
|
||||
ResourceWarning 15c4b71
|
||||
- Remove upstreamed patch
|
||||
8a3c2c816d789639b49d3ae867213393ed7abdff.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 6 07:10:11 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Clean up the SPEC file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 21 12:23:11 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add sle15_python_module_pythons (jsc#PED-68)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 13 22:40:28 UTC 2023 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Make calling of %{sle15modernpython} optional.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 6 08:59:54 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- add 8a3c2c816d789639b49d3ae867213393ed7abdff.patch to resolve
|
||||
testsuite failures with Python 3.11
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 5 12:22:40 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add python-py as test dependency
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 19 11:31:46 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.15.1:
|
||||
* If you call ffi.embedding_api() but don’t write any extern “Python” function
|
||||
there, then the resulting C code would fail an assert. Fixed.
|
||||
* Updated Windows/arm64 embedded libffi static lib to v3.4.2, and scripted to
|
||||
ease future updates (thanks Niyas Sait!)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Nov 6 17:37:42 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.15.0:
|
||||
* Fixed MANIFEST.in to include missing file for Windows arm64 support
|
||||
* Fixed Linux wheel build to use gcc default ISA for libffi
|
||||
* Updated setup.py Python trove specifiers to currently-tested Python versions
|
||||
* CPython 3.10 support (including wheels)
|
||||
* MacOS arm64 support (including wheels)
|
||||
* Initial Windows arm64 support
|
||||
* Misc. doc and test updates
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 16 19:47:06 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.14.6:
|
||||
* Revert "grovel: detect :float and :double in the :auto type"
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 12 20:15:07 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.14.5:
|
||||
* Source fix for old gcc versions
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Dec 19 10:46:36 UTC 2020 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 1.14.4:
|
||||
* no upstream changelog provided
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 28 11:23:13 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- update to 1.14.3:
|
||||
* no upstream changelog provided
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 20 12:13:23 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||
|
||||
- update to 1.14.2
|
||||
* CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 10 08:10:36 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- update to 1.14.1:
|
||||
* CFFI source code is now hosted on Heptapod.
|
||||
* Improved support for typedef int my_array_t[...]; with an explicit dot-dot-dot in API mode (issue #453)
|
||||
* Windows (32 and 64 bits): multiple fixes for ABI-mode call to functions that return a structure.
|
||||
* Experimental support for MacOS 11 on aarch64.
|
||||
* and a few other minor changes and bug fixes.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 14:58:25 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||
|
||||
- Update to 1.14.0
|
||||
* ffi.dlopen() can now be called with a handle (as a void *) to an already-opened C library.
|
||||
* fixed a stack overflow issue for calls like lib.myfunc([large list]).
|
||||
* fixed a memory leak inside ffi.getwinerror() on CPython 3.x.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 18 20:21:04 UTC 2019 - Todd R <toddrme2178@gmail.com>
|
||||
|
||||
- Update to 1.13.2:
|
||||
* re-release because the Linux wheels came with an attached version of libffi that was very old and buggy
|
||||
- Update to 1.13.1:
|
||||
* deprecate the way to declare in cdef() a global variable with only void *foo;. You should always use a storage class, like extern void *foo; or maybe static void *foo;. These are all equivalent for the purposes of cdef(), but the reason for deprecating the bare version is that (as far as I know) it would always be mistake in a real C header.
|
||||
* fix the regression RuntimeError: found a situation in which we try to build a type recursively.
|
||||
* fixed issue #427 where a multithreading mistake in the embedding logic initialization code would cause deadlocks on CPython 3.7.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 15 10:39:50 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Update to 1.13.0:
|
||||
* No changelog provided upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 30 19:42:59 UTC 2019 - Todd R <toddrme2178@gmail.com>
|
||||
|
||||
- Update to 1.12.3
|
||||
* Fix for nested struct types that end in a var-sized array (#405).
|
||||
* Add support for using U and L characters at the end of integer constants in ffi.cdef() (thanks Guillaume).
|
||||
* More 3.8 fixes.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 7 14:10:49 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Remove test suite exception which was fixed by 7a76a38153*.patch
|
||||
- Add doc/*/*.rst to %doc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 2 10:39:31 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||
|
||||
- update to 1.12.3
|
||||
- drop patches: 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch
|
||||
7a76a381534012af4790e815140d1538510b7d93.patch
|
||||
e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch
|
||||
* Direct support for pkg-config.
|
||||
* ffi.from_buffer() takes a new optional first argument that gives the array
|
||||
type of the result. It also takes an optional keyword argument require_writable
|
||||
to refuse read-only Python buffers.
|
||||
* ffi.new(), ffi.gc() or ffi.from_buffer() cdata objects can now be released
|
||||
at known times, either by using the with keyword or by calling the new ffi.release().
|
||||
* Accept an expression like ffi.new("int[4]", p) if p is itself another cdata int[4].
|
||||
* CPython 2.x: ffi.dlopen() failed with non-ascii file names on Posix
|
||||
* CPython: if a thread is started from C and then runs Python code
|
||||
(with callbacks or with the embedding solution), then previous versions of cffi
|
||||
would contain possible crashes and/or memory leaks.
|
||||
* Support for ffi.cdef(..., pack=N) where N is a power of two.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 29 16:10:03 CET 2018 - mcepl@suse.com
|
||||
|
||||
- Add 7a76a381534012af4790e815140d1538510b7d93.patch to fix
|
||||
bsc#1111657 (we need use to proper void returning function not
|
||||
to corrupt memory in tests).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 17 18:53:19 CEST 2018 - mcepl@suse.com
|
||||
|
||||
- Fix calling of py.test executor.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 21 07:24:58 CEST 2018 - mcepl@suse.com
|
||||
|
||||
- Add 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch as
|
||||
a workaround against
|
||||
https://bitbucket.org/cffi/cffi/issues/378/ (possible bug in
|
||||
GCC, see https://bugzilla.redhat.com/1552724).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 19 20:43:08 CEST 2018 - mcepl@suse.com
|
||||
|
||||
- Remove ignore-tests.patch -- testing what will happen
|
||||
- Add e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch from
|
||||
upstream to remove some warnings.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 18 15:51:02 UTC 2018 - Matěj Cepl <mcepl@suse.com>
|
||||
|
||||
- Switch off falling tests with new patch
|
||||
ignore-tests.patch instead of -k parameter for py.test.
|
||||
https://bitbucket.org/cffi/cffi/issues/384/
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 2 23:14:41 UTC 2018 - arun@gmx.de
|
||||
|
||||
- update to version 1.11.5:
|
||||
* Issue #357: fix ffi.emit_python_code() which generated a buggy
|
||||
Python file if you are using a struct with an anonymous union
|
||||
field or vice-versa.
|
||||
* Windows: ffi.dlopen() should now handle unicode filenames.
|
||||
* ABI mode: implemented ffi.dlclose() for the in-line case (it used
|
||||
to be present only in the out-of-line case).
|
||||
* Fixed a corner case for setup.py install --record=xx --root=yy
|
||||
with an out-of-line ABI module. Also fixed Issue #345.
|
||||
* More hacks on Windows for running CFFI’s own setup.py.
|
||||
* Issue #358: in embedding, to protect against (the rare case of)
|
||||
Python initialization from several threads in parallel, we have to
|
||||
use a spin-lock. On CPython 3 it is worse because it might
|
||||
spin-lock for a long time (execution of Py_InitializeEx()). Sadly,
|
||||
recent changes to CPython make that solution needed on CPython 2
|
||||
too.
|
||||
* CPython 3 on Windows: we no longer compile with Py_LIMITED_API by
|
||||
default because such modules cannot be used with virtualenv. Issue
|
||||
#350 mentions a workaround if you still want that and are not
|
||||
concerned about virtualenv: pass a
|
||||
define_macros=[("Py_LIMITED_API", None)] to the
|
||||
ffibuilder.set_source() call.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 00:23:55 UTC 2018 - arun@gmx.de
|
||||
|
||||
- specfile:
|
||||
* delete patch cffi-loader.patch; included upstream
|
||||
|
||||
- update to version 1.11.4:
|
||||
* Windows: reverted linking with python3.dll, because virtualenv
|
||||
does not make this DLL available to virtual environments for
|
||||
now. See Issue #355. On Windows only, the C extension modules
|
||||
created by cffi follow for now the standard naming scheme
|
||||
foo.cp36-win32.pyd, to make it clear that they are regular CPython
|
||||
modules depending on python36.dll.
|
||||
|
||||
- changes from version 1.11.3:
|
||||
* Fix on CPython 3.x: reading the attributes __loader__ or __spec__
|
||||
from the cffi-generated lib modules gave a buggy
|
||||
SystemError. (These attributes are always None, and provided only
|
||||
to help compatibility with tools that expect them in all modules.)
|
||||
* More Windows fixes: workaround for MSVC not supporting large
|
||||
literal strings in C code (from
|
||||
ffi.embedding_init_code(large_string)); and an issue with
|
||||
Py_LIMITED_API linking with python35.dll/python36.dll instead of
|
||||
python3.dll.
|
||||
* Small documentation improvements.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 18 13:35:08 UTC 2018 - tchvatal@suse.com
|
||||
|
||||
- Add patch cffi-loader.patch to fix bsc#1070737
|
||||
- Sort out with spec-cleaner
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 3 15:56:32 UTC 2017 - arun@gmx.de
|
||||
|
||||
- update to version 1.11.2:
|
||||
* Fix Windows issue with managing the thread-state on CPython 3.0 to
|
||||
3.5
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 4 11:36:56 UTC 2017 - sean.marlow@suse.com
|
||||
|
||||
- Update pytest in spec to add c directory tests in addition to
|
||||
testing directory.
|
||||
- Omit test_init_once_multithread tests as they rely on multiple
|
||||
threads finishing in a given time. Returns sporadic pass/fail
|
||||
within build.
|
||||
- Update to 1.11.1:
|
||||
* Fix tests, remove deprecated C API usage
|
||||
* Fix (hack) for 3.6.0/3.6.1/3.6.2 giving incompatible binary
|
||||
extensions (cpython issue #29943)
|
||||
* Fix for 3.7.0a1+
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 28 15:00:46 UTC 2017 - sean.marlow@suse.com
|
||||
|
||||
- Update to 1.11.0:
|
||||
* Support the modern standard types char16_t and char32_t. These
|
||||
work like wchar_t: they represent one unicode character, or when
|
||||
used as charN_t * or charN_t[] they represent a unicode string.
|
||||
The difference with wchar_t is that they have a known, fixed
|
||||
size. They should work at all places that used to work with
|
||||
wchar_t (please report an issue if I missed something). Note
|
||||
that with set_source(), you need to make sure that these types
|
||||
are actually defined by the C source you provide (if used in
|
||||
cdef()).
|
||||
* Support the C99 types float _Complex and double _Complex. Note
|
||||
that libffi doesn’t support them, which means that in the ABI
|
||||
mode you still cannot call C functions that take complex
|
||||
numbers directly as arguments or return type.
|
||||
* Fixed a rare race condition when creating multiple FFI instances
|
||||
from multiple threads. (Note that you aren’t meant to create
|
||||
many FFI instances: in inline mode, you should write
|
||||
ffi = cffi.FFI() at module level just after import cffi; and in
|
||||
out-of-line mode you don’t instantiate FFI explicitly at all.)
|
||||
* Windows: using callbacks can be messy because the CFFI internal
|
||||
error messages show up to stderr—but stderr goes nowhere in many
|
||||
applications. This makes it particularly hard to get started
|
||||
with the embedding mode. (Once you get started, you can at least
|
||||
use @ffi.def_extern(onerror=...) and send the error logs where
|
||||
it makes sense for your application, or record them in log
|
||||
files, and so on.) So what is new in CFFI is that now, on
|
||||
Windows CFFI will try to open a non-modal MessageBox (in addition
|
||||
to sending raw messages to stderr). The MessageBox is only
|
||||
visible if the process stays alive: typically, console
|
||||
applications that crash close immediately, but that is also the
|
||||
situation where stderr should be visible anyway.
|
||||
* Progress on support for callbacks in NetBSD.
|
||||
* Functions returning booleans would in some case still return 0
|
||||
or 1 instead of False or True. Fixed.
|
||||
* ffi.gc() now takes an optional third parameter, which gives an
|
||||
estimate of the size (in bytes) of the object. So far, this is
|
||||
only used by PyPy, to make the next GC occur more quickly
|
||||
(issue #320). In the future, this might have an effect on
|
||||
CPython too (provided the CPython issue 31105 is addressed).
|
||||
* Add a note to the documentation: the ABI mode gives function
|
||||
objects that are slower to call than the API mode does. For
|
||||
some reason it is often thought to be faster. It is not!
|
||||
- Update to 1.10.1:
|
||||
* Fixed the line numbers reported in case of cdef() errors. Also,
|
||||
I just noticed, but pycparser always supported the preprocessor
|
||||
directive # 42 "foo.h" to mean “from the next line, we’re in
|
||||
file foo.h starting from line 42”, which it puts in the error
|
||||
messages.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 29 16:03:46 UTC 2017 - tbechtold@suse.com
|
||||
|
||||
- update to 1.10.0:
|
||||
* Issue #295: use calloc() directly instead of PyObject_Malloc()+memset()
|
||||
to handle ffi.new() with a default allocator. Speeds up ffi.new(large-array)
|
||||
where most of the time you never touch most of the array.
|
||||
* Some OS/X build fixes (“only with Xcode but without CLT”).
|
||||
* Improve a couple of error messages: when getting mismatched versions of
|
||||
cffi and its backend; and when calling functions which cannot be called with
|
||||
libffi because an argument is a struct that is “too complicated” (and not
|
||||
a struct pointer, which always works).
|
||||
* Add support for some unusual compilers (non-msvc, non-gcc, non-icc, non-clang)
|
||||
* Implemented the remaining cases for ffi.from_buffer. Now all
|
||||
buffer/memoryview objects can be passed. The one remaining check is against
|
||||
passing unicode strings in Python 2. (They support the buffer interface, but
|
||||
that gives the raw bytes behind the UTF16/UCS4 storage, which is most of the
|
||||
times not what you expect. In Python 3 this has been fixed and the unicode
|
||||
strings don’t support the memoryview interface any more.)
|
||||
* The C type _Bool or bool now converts to a Python boolean when reading,
|
||||
instead of the content of the byte as an integer. The potential
|
||||
incompatibility here is what occurs if the byte contains a value different
|
||||
from 0 and 1. Previously, it would just return it; with this change, CFFI
|
||||
raises an exception in this case. But this case means “undefined behavior”
|
||||
in C; if you really have to interface with a library relying on this,
|
||||
don’t use bool in the CFFI side. Also, it is still valid to use a byte
|
||||
string as initializer for a bool[], but now it must only contain \x00 or
|
||||
\x01. As an aside, ffi.string() no longer works on bool[] (but it never made
|
||||
much sense, as this function stops at the first zero).
|
||||
* ffi.buffer is now the name of cffi’s buffer type, and ffi.buffer() works
|
||||
like before but is the constructor of that type.
|
||||
* ffi.addressof(lib, "name") now works also in in-line mode, not only in
|
||||
out-of-line mode. This is useful for taking the address of global variables.
|
||||
* Issue #255: cdata objects of a primitive type (integers, floats, char) are
|
||||
now compared and ordered by value. For example, <cdata 'int' 42> compares
|
||||
equal to 42 and <cdata 'char' b'A'> compares equal to b'A'. Unlike C,
|
||||
<cdata 'int' -1> does not compare equal to ffi.cast("unsigned int", -1): it
|
||||
compares smaller, because -1 < 4294967295.
|
||||
* PyPy: ffi.new() and ffi.new_allocator()() did not record “memory pressure”,
|
||||
causing the GC to run too infrequently if you call ffi.new() very often
|
||||
and/or with large arrays. Fixed in PyPy 5.7.
|
||||
* Support in ffi.cdef() for numeric expressions with + or -. Assumes that
|
||||
there is no overflow; it should be fixed first before we add more general
|
||||
support for arbitrary arithmetic on constants.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 27 11:50:31 UTC 2017 - jmatejek@suse.com
|
||||
|
||||
- do not generate HTML documentation for packages that are indirect
|
||||
dependencies of Sphinx
|
||||
(see docs at https://cffi.readthedocs.org/ )
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 16 17:33:16 UTC 2017 - jmatejek@suse.com
|
||||
|
||||
- update to 1.9.1
|
||||
- Structs with variable-sized arrays as their last field: now we track the
|
||||
length of the array after ffi.new() is called, just like we always tracked
|
||||
the length of ffi.new("int[]", 42). This lets us detect out-of-range
|
||||
accesses to array items. This also lets us display a better repr(), and
|
||||
have the total size returned by ffi.sizeof() and ffi.buffer(). Previously
|
||||
both functions would return a result based on the size of the declared
|
||||
structure type, with an assumed empty array. (Thanks andrew for starting
|
||||
this refactoring.)
|
||||
- Add support in cdef()/set_source() for unspecified-length arrays in
|
||||
typedefs: typedef int foo_t[...];. It was already supported for global
|
||||
variables or structure fields.
|
||||
- I turned in v1.8 a warning from cffi/model.py into an error: 'enum xxx' has
|
||||
no values explicitly defined: refusing to guess which integer type it is
|
||||
meant to be (unsigned/signed, int/long). Now I’m turning it back to a
|
||||
warning again; it seems that guessing that the enum has size int is a
|
||||
99%-safe bet. (But not 100%, so it stays as a warning.)
|
||||
- Fix leaks in the code handling FILE * arguments. In CPython 3 there is a
|
||||
remaining issue that is hard to fix: if you pass a Python file object to a
|
||||
FILE * argument, then os.dup() is used and the new file descriptor is only
|
||||
closed when the GC reclaims the Python file object—and not at the earlier
|
||||
time when you call close(), which only closes the original file descriptor.
|
||||
If this is an issue, you should avoid this automatic convertion of Python
|
||||
file objects: instead, explicitly manipulate file descriptors and call
|
||||
fdopen() from C (...via cffi).
|
||||
- When passing a void * argument to a function with a different pointer type,
|
||||
or vice-versa, the cast occurs automatically, like in C. The same occurs
|
||||
for initialization with ffi.new() and a few other places. However, I
|
||||
thought that char * had the same property—but I was mistaken. In C you get
|
||||
the usual warning if you try to give a char * to a char ** argument, for
|
||||
example. Sorry about the confusion. This has been fixed in CFFI by giving
|
||||
for now a warning, too. It will turn into an error in a future version.
|
||||
- Issue #283: fixed ffi.new() on structures/unions with nested anonymous
|
||||
structures/unions, when there is at least one union in the mix. When
|
||||
initialized with a list or a dict, it should now behave more closely like
|
||||
the { } syntax does in GCC.
|
||||
- CPython 3.x: experimental: the generated C extension modules now use the
|
||||
“limited API”, which means that, as a compiled .so/.dll, it should work
|
||||
directly on any version of CPython >= 3.2. The name produced by distutils
|
||||
is still version-specific. To get the version-independent name, you can
|
||||
rename it manually to NAME.abi3.so, or use the very recent setuptools 26.
|
||||
- Added ffi.compile(debug=...), similar to python setup.py build --debug but
|
||||
defaulting to True if we are running a debugging version of Python itself.
|
||||
- Removed the restriction that ffi.from_buffer() cannot be used on byte
|
||||
strings. Now you can get a char * out of a byte string, which is valid as
|
||||
long as the string object is kept alive. (But don’t use it to modify the
|
||||
string object! If you need this, use bytearray or other official
|
||||
techniques.)
|
||||
- PyPy 5.4 can now pass a byte string directly to a char * argument (in older
|
||||
versions, a copy would be made). This used to be a CPython-only
|
||||
optimization.
|
||||
- ffi.gc(p, None) removes the destructor on an object previously created by
|
||||
another call to ffi.gc()
|
||||
- bool(ffi.cast("primitive type", x)) now returns False if the value is zero
|
||||
(including -0.0), and True otherwise. Previously this would only return
|
||||
False for cdata objects of a pointer type when the pointer is NULL.
|
||||
- bytearrays: ffi.from_buffer(bytearray-object) is now supported. (The reason
|
||||
it was not supported was that it was hard to do in PyPy, but it works since
|
||||
PyPy 5.3.) To call a C function with a char * argument from a buffer
|
||||
object—now including bytearrays—you write lib.foo(ffi.from_buffer(x)).
|
||||
Additionally, this is now supported: p[0:length] = bytearray-object. The
|
||||
problem with this was that a iterating over bytearrays gives numbers
|
||||
instead of characters. (Now it is implemented with just a memcpy, of
|
||||
course, not actually iterating over the characters.)
|
||||
- C++: compiling the generated C code with C++ was supposed to work, but
|
||||
failed if you make use the bool type (because that is rendered as the C
|
||||
_Bool type, which doesn’t exist in C++).
|
||||
- help(lib) and help(lib.myfunc) now give useful information, as well as
|
||||
dir(p) where p is a struct or pointer-to-struct.
|
||||
- drop upstreamed python-cffi-avoid-bitshifting-negative-int.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 6 14:39:52 UTC 2016 - jmatejek@suse.com
|
||||
|
||||
- update for multipython build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun May 29 05:23:27 UTC 2016 - badshah400@gmail.com
|
||||
|
||||
- Add python-cffi-avoid-bitshifting-negative-int.patch to actually
|
||||
fix the "negative left shift" warning by replacing bitshifting
|
||||
in appropriate places by bitwise and comparison to self; patch
|
||||
taken from upstream git. Drop cffi-1.5.2-wnoerror.patch: no
|
||||
longer required.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 27 13:00:22 UTC 2016 - jmatejek@suse.com
|
||||
|
||||
- disable "negative left shift" warning in test suite to prevent
|
||||
failures with gcc6, until upstream fixes the undefined code
|
||||
in question (boo#981848, cffi-1.5.2-wnoerror.patch)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 26 02:33:02 UTC 2016 - badshah400@gmail.com
|
||||
|
||||
- Update to version 1.6.0:
|
||||
* ffi.list_types()
|
||||
* ffi.unpack()
|
||||
* extern “Python+C”
|
||||
* in API mode, lib.foo.__doc__ contains the C signature now.
|
||||
* Yet another attempt at robustness of ffi.def_extern() against
|
||||
CPython’s interpreter shutdown logic.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 11 14:45:11 UTC 2016 - jmatejek@suse.com
|
||||
|
||||
- update to 1.5.2
|
||||
* support for cffi-based embedding
|
||||
* more robustness for shutdown logic
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 9 17:18:52 UTC 2016 - michael@stroeder.com
|
||||
|
||||
- update to version 1.4.2:
|
||||
* Nothing changed from v1.4.1.
|
||||
- changes from version 1.4.1:
|
||||
* Fix the compilation failure of cffi on CPython 3.5.0. (3.5.1
|
||||
works; some detail changed that makes some underscore-starting
|
||||
macros disappear from view of extension modules, and I worked
|
||||
around it, thinking it changed in all 3.5 versions—but no: it was
|
||||
only in 3.5.1.)
|
||||
- changes from version 1.4.0:
|
||||
* A better way to do callbacks has been added (faster and more
|
||||
portable, and usually cleaner). It is a mechanism for the
|
||||
out-of-line API mode that replaces the dynamic creation of
|
||||
callback objects (i.e. C functions that invoke Python) with the
|
||||
static declaration in cdef() of which callbacks are needed. This
|
||||
is more C-like, in that you have to structure your code around the
|
||||
idea that you get a fixed number of function pointers, instead of
|
||||
creating them on-the-fly.
|
||||
* ffi.compile() now takes an optional verbose argument. When True,
|
||||
distutils prints the calls to the compiler.
|
||||
* ffi.compile() used to fail if given sources with a path that
|
||||
includes "..". Fixed.
|
||||
* ffi.init_once() added. See docs.
|
||||
* dir(lib) now works on libs returned by ffi.dlopen() too.
|
||||
* Cleaned up and modernized the content of the demo subdirectory in
|
||||
the sources (thanks matti!).
|
||||
* ffi.new_handle() is now guaranteed to return unique void * values,
|
||||
even if called twice on the same object. Previously, in that case,
|
||||
CPython would return two cdata objects with the same void *
|
||||
value. This change is useful to add and remove handles from a
|
||||
global dict (or set) without worrying about duplicates. It already
|
||||
used to work like that on PyPy. This change can break code that
|
||||
used to work on CPython by relying on the object to be kept alive
|
||||
by other means than keeping the result of ffi.new_handle()
|
||||
alive. (The corresponding warning in the docs of ffi.new_handle()
|
||||
has been here since v0.8!)
|
||||
- changes from version 1.3.1:
|
||||
* The optional typedefs (bool, FILE and all Windows types) were not
|
||||
always available from out-of-line FFI objects.
|
||||
* Opaque enums are phased out from the cdefs: they now give a
|
||||
warning, instead of (possibly wrongly) being assumed equal to
|
||||
unsigned int. Please report if you get a reasonable use case for
|
||||
them.
|
||||
* Some parsing details, notably volatile is passed along like const
|
||||
and restrict. Also, older versions of pycparser mis-parse some
|
||||
pointer-to-pointer types like char * const *: the “const” ends up
|
||||
at the wrong place. Added a workaround.
|
||||
- changes from version 1.3.0:
|
||||
* Added ffi.memmove().
|
||||
* Pull request #64: out-of-line API mode: we can now declare
|
||||
floating-point types with typedef float... foo_t;. This only works
|
||||
if foo_t is a float or a double, not long double.
|
||||
* Issue #217: fix possible unaligned pointer manipulation, which
|
||||
crashes on some architectures (64-bit, non-x86).
|
||||
* Issues #64 and #126: when using set_source() or verify(), the
|
||||
const and restrict keywords are copied from the cdef to the
|
||||
generated C code; this fixes warnings by the C compiler. It also
|
||||
fixes corner cases like typedef const int T; T a; which would
|
||||
previously not consider a as a constant. (The cdata objects
|
||||
themselves are never const.)
|
||||
* Win32: support for __stdcall. For callbacks and function pointers;
|
||||
regular C functions still don’t need to have their calling
|
||||
convention declared.
|
||||
* Windows: CPython 2.7 distutils doesn’t work with Microsoft’s
|
||||
official Visual Studio for Python, and I’m told this is not a
|
||||
bug. For ffi.compile(), we removed a workaround that was inside
|
||||
cffi but which had unwanted side-effects. Try saying import
|
||||
setuptools first, which patches distutils...
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 17 11:28:00 UTC 2015 - p.drouand@gmail.com
|
||||
|
||||
- Update to version 1.2.1
|
||||
* No changes entry for this version
|
||||
- Changes from version 1.2.0
|
||||
* Out-of-line mode: ``int a[][...];`` can be used to declare a structure
|
||||
field or global variable which is, simultaneously, of total length
|
||||
unknown to the C compiler (the ``a[]`` part) and each element is
|
||||
itself an array of N integers, where the value of N *is * known to the
|
||||
C compiler (the ``int`` and ``[...]`` parts around it). Similarly,
|
||||
``int a[5][...];`` is supported (but probably less useful: remember
|
||||
that in C it means ``int (a[5])[...];``).
|
||||
* PyPy: the ``lib.some_function`` objects were missing the attributes
|
||||
``__name__``, ``__module__`` and ``__doc__`` that are expected e.g. by
|
||||
some decorators-management functions from ``functools``.
|
||||
* Out-of-line API mode: you can now do ``from _example.lib import x``
|
||||
to import the name ``x`` from ``_example.lib``, even though the
|
||||
``lib`` object is not a standard module object. (Also works in ``from
|
||||
_example.lib import *``, but this is even more of a hack and will fail
|
||||
if ``lib`` happens to declare a name called ``__all__``. Note that
|
||||
`` *`` excludes the global variables; only the functions and constants
|
||||
make sense to import like this.)
|
||||
* ``lib.__dict__`` works again and gives you a copy of the
|
||||
dict---assuming that ``lib`` has got no symbol called precisely
|
||||
``__dict__``. (In general, it is safer to use ``dir(lib)``.)
|
||||
* Out-of-line API mode: global variables are now fetched on demand at
|
||||
every access. It fixes issue #212 (Windows DLL variables), and also
|
||||
allows variables that are defined as dynamic macros (like ``errno``)
|
||||
or ``__thread`` -local variables. (This change might also tighten
|
||||
the C compiler's check on the variables' type.)
|
||||
* Issue #209: dereferencing NULL pointers now raises RuntimeError
|
||||
instead of segfaulting. Meant as a debugging aid. The check is
|
||||
only for NULL: if you dereference random or dead pointers you might
|
||||
still get segfaults.
|
||||
* Issue #152: callbacks__: added an argument ``ffi.callback(...,
|
||||
onerror=...)``. If the main callback function raises an exception
|
||||
and ``onerror`` is provided, then ``onerror(exception, exc_value,
|
||||
traceback)`` is called. This is similar to writing a ``try:
|
||||
except:`` in the main callback function, but in some cases (e.g. a
|
||||
signal) an exception can occur at the very start of the callback
|
||||
function---before it had time to enter the ``try: except:`` block.
|
||||
* Issue #115: added ``ffi.new_allocator()``, which officializes
|
||||
support for `alternative allocators`__.
|
||||
.. __: using.html#callbacks
|
||||
.. __: using.html#alternative-allocators
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 1 18:13:10 UTC 2015 - benoit.monin@gmx.fr
|
||||
|
||||
- update to version 1.1.0 (fate#318838):
|
||||
* Out-of-line API mode: we can now declare integer types with
|
||||
typedef int... foo_t;. The exact size and signedness of foo_t
|
||||
is figured out by the compiler.
|
||||
* Out-of-line API mode: we can now declare multidimensional
|
||||
arrays (as fields or as globals) with int n[...][...]. Before,
|
||||
only the outermost dimension would support the ... syntax.
|
||||
* Out-of-line ABI mode: we now support any constant declaration,
|
||||
instead of only integers whose value is given in the cdef. Such
|
||||
“new” constants, i.e. either non-integers or without a value
|
||||
given in the cdef, must correspond to actual symbols in the
|
||||
lib. At runtime they are looked up the first time we access
|
||||
them. This is useful if the library defines extern const
|
||||
sometype somename;.
|
||||
* ffi.addressof(lib, "func_name") now returns a regular cdata
|
||||
object of type “pointer to function”. You can use it on any
|
||||
function from a library in API mode (in ABI mode, all functions
|
||||
are already regular cdata objects). To support this, you need
|
||||
to recompile your cffi modules.
|
||||
* Issue #198: in API mode, if you declare constants of a struct
|
||||
type, what you saw from lib.CONSTANT was corrupted.
|
||||
* Issue #196: ffi.set_source("package._ffi", None) would
|
||||
incorrectly generate the Python source to package._ffi.py
|
||||
instead of package/_ffi.py. Also fixed: in some cases, if the C
|
||||
file was in build/foo.c, the .o file would be put in
|
||||
build/build/foo.o.
|
||||
- additional changes from version 1.0.3:
|
||||
* Same as 1.0.2, apart from doc and test fixes on some platforms
|
||||
- additional changes from version 1.0.2:
|
||||
* Variadic C functions (ending in a ”...” argument) were not
|
||||
supported in the out-of-line ABI mode. This was a bug—there was
|
||||
even a (non-working) example doing exactly that!
|
||||
- additional changes from version 1.0.1:
|
||||
* ffi.set_source() crashed if passed a sources=[..] argument.
|
||||
Fixed by chrippa on pull request #60.
|
||||
* Issue #193: if we use a struct between the first cdef() where
|
||||
it is declared and another cdef() where its fields are defined,
|
||||
then this definition was ignored.
|
||||
* Enums were buggy if you used too many ”...” in their definition
|
||||
- additional changes from version 1.0.0:
|
||||
* The main news item is out-of-line module generation:
|
||||
+ for ABI level, with ffi.dlopen()
|
||||
+ for API level, which used to be with ffi.verify(), now
|
||||
deprecated
|
||||
- add python-cffi-rpmlintrc: cffi specifically installs C headers
|
||||
in site-packages
|
||||
- add new test dependency gcc-c++
|
||||
- skip the tests on SLE11 since they fail on i586
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 23 06:33:12 UTC 2015 - mcihar@suse.cz
|
||||
|
||||
- Update to 0.9.2
|
||||
* No upstream changelog
|
||||
See https://bitbucket.org/cffi/cffi/commits/all for a list of
|
||||
commits
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 26 12:40:34 UTC 2014 - toddrme2178@gmail.com
|
||||
|
||||
- Update to 0.8.6
|
||||
* No upstream changelog
|
||||
See https://bitbucket.org/cffi/cffi/commits/all for a list of
|
||||
commits
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 19 16:35:30 UTC 2014 - jmatejek@suse.com
|
||||
|
||||
- update to 0.8.2
|
||||
* minor bugfixes
|
||||
- remove cffi-pytest-integration.patch as it is no longer necessary
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 31 14:18:44 UTC 2014 - speilicke@suse.com
|
||||
|
||||
- Require libffi43-devel on SLE_11_SP2 instead of using pkg-config to fix build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 24 12:09:15 UTC 2014 - mvyskocil@suse.com
|
||||
|
||||
- update to 0.8.1
|
||||
* fixes on Python 3 on OS/X, and some FreeBSD fixes (thanks Tobias)
|
||||
- added a note wrt disabled tests
|
||||
- add cffi-pytest-integration.patch: allowinf call pytest from setup.py
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 18 14:33:39 UTC 2013 - mvyskocil@suse.com
|
||||
|
||||
- update to 0.8
|
||||
* integrated support for C99 variable-sized structures
|
||||
* multi-thread safety
|
||||
* ffi.getwinerror()
|
||||
* a number of small fixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 24 10:59:45 UTC 2013 - speilicke@suse.com
|
||||
|
||||
- Require python-setuptools instead of distribute (upstreams merged)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 30 07:51:11 UTC 2013 - mvyskocil@suse.com
|
||||
|
||||
- use pkgconfig(libffi) to get the most recent ffi
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 19 13:27:16 UTC 2013 - mvyskocil@suse.com
|
||||
|
||||
- Update to 0.7.2
|
||||
* add implicit bool
|
||||
* standard names are handled as defaults in cdef declarations
|
||||
* enum types follow GCC rules and not just int
|
||||
* supports simple slices x[start:stop]
|
||||
* enums are handled like ints
|
||||
* new ffi.new_handle(python_object)
|
||||
* and various bugfixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 10 09:28:56 UTC 2013 - saschpe@suse.de
|
||||
|
||||
- Initial version
|
||||
|
66
python-cffi.spec
Normal file
66
python-cffi.spec
Normal file
@ -0,0 +1,66 @@
|
||||
#
|
||||
# spec file for package python-cffi
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-cffi
|
||||
Version: 1.17.0
|
||||
Release: 0
|
||||
Summary: Foreign Function Interface for Python calling C code
|
||||
License: MIT
|
||||
URL: https://cffi.readthedocs.org
|
||||
Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
|
||||
Source1: python-cffi-rpmlintrc
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pycparser}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: pkgconfig(libffi)
|
||||
Requires: python-pycparser
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Foreign Function Interface for Python calling C code. The aim of this project
|
||||
is to provide a convenient and reliable way of calling C code from Python.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n cffi-%{version}
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
%pytest_arch -W ignore::UserWarning src/c/ testing/
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc README.md doc/source/*.rst doc/misc/*.rst
|
||||
%{python_sitearch}/cffi
|
||||
%{python_sitearch}/_cffi_backend.*.so
|
||||
%{python_sitearch}/cffi-%{version}*-info
|
||||
|
||||
%changelog
|
Loading…
x
Reference in New Issue
Block a user