SHA256
1
0
forked from pool/python-cffi

105 Commits

Author SHA256 Message Date
1bf7f7cdbe Accepting request 1304687 from devel:languages:python
- update to 2.0.0:
  * Added support for free threaded CPython (3.14t+ only)
  * Added support for Python 3.14.
  * Dropped support for Python 3.8.

OBS-URL: https://build.opensuse.org/request/show/1304687
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=47
2025-09-15 17:50:30 +00:00
d9dabdfcdb - update to 2.0.0:
* Added support for free threaded CPython (3.14t+ only)
  * Added support for Python 3.14.
  * Dropped support for Python 3.8.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=103
2025-09-14 20:40:02 +00:00
be119cc960 Accepting request 1206446 from devel:languages:python
- update to 1.17.1:
  * Fix failing distutils.msvc9compiler imports under Windows (#118).
  * ffibuilder.emit_python_code() and ffibuiler.emit_c_code()
    accept file-like objects (#115).
  * ffiplatform calls are bypassed by ffibuilder.emit_python_code()
    and ffibuilder.emit_c_code() (#81).

OBS-URL: https://build.opensuse.org/request/show/1206446
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=46
2024-10-09 20:03:26 +00:00
b041f8ba52 - update to 1.17.1:
* Fix failing distutils.msvc9compiler imports under Windows (#118).
  * ffibuilder.emit_python_code() and ffibuiler.emit_c_code()
    accept file-like objects (#115).
  * ffiplatform calls are bypassed by ffibuilder.emit_python_code()
    and ffibuilder.emit_c_code() (#81).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=101
2024-10-09 06:37:53 +00:00
107ff06d43 Accepting request 1198079 from devel:languages:python
- 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/request/show/1198079
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=45
2024-09-03 11:37:08 +00:00
0396f22d84 Accepting request 1184154 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1184154
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=44
2024-07-02 16:14:40 +00:00
fec30ea192 - add py313-compat.patch
py313-use-format-unraisable.patch
  py313-use-hashpointer.patch: add upstream patches for py3.13
  support

  testsuite failures with Python 3.11
  * Revert "grovel: detect :float and :double in the :auto type"
  * no upstream changelog provided
  * no upstream changelog provided
 * CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default
- Update pytest in spec to add c directory tests in addition to
    messages.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=97
2024-06-30 21:27:50 +00:00
ef741a1106 Accepting request 1153153 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1153153
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=43
2024-03-01 22:34:22 +00:00
0e2b8d68d1 Accepting request 1153143 from devel:BCI:SLCS:next
drop unnecessary buildrequire python-py

OBS-URL: https://build.opensuse.org/request/show/1153143
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=95
2024-02-29 09:58:21 +00:00
7e5801911c Accepting request 1117701 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1117701
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=42
2023-10-15 17:25:59 +00:00
514cff8146 Fix tests
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=93
2023-10-06 17:02:57 +00:00
b5d4b45b53 - 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

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=92
2023-10-06 16:35:58 +00:00
ce4a4ca5a2 - Clean up the SPEC file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=91
2023-10-06 07:10:19 +00:00
e4acf57640 Accepting request 1081967 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1081967
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=41
2023-04-22 20:01:37 +00:00
0b00352207 Accepting request 1081360 from home:dirkmueller:acdc:as_python3_module
SR for python stack proposal

OBS-URL: https://build.opensuse.org/request/show/1081360
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=89
2023-04-21 14:49:53 +00:00
4a9639536f Accepting request 1056350 from devel:languages:python
- add 8a3c2c816d789639b49d3ae867213393ed7abdff.patch to resolve
  testsuite failures with Python 3.11

OBS-URL: https://build.opensuse.org/request/show/1056350
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=40
2023-01-07 16:16:03 +00:00
1037cbd86e - add 8a3c2c816d789639b49d3ae867213393ed7abdff.patch to resolve
testsuite failures with Python 3.11

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=87
2023-01-06 09:01:16 +00:00
072f53f549 Accepting request 1040369 from devel:languages:python
- Add python-py as test dependency

OBS-URL: https://build.opensuse.org/request/show/1040369
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=39
2022-12-07 16:34:04 +00:00
a4de79fb62 - Add python-py as test dependency
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=85
2022-12-05 12:44:00 +00:00
285a437c24 Accepting request 990222 from devel:languages:python
- 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!)

OBS-URL: https://build.opensuse.org/request/show/990222
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=38
2022-08-04 11:23:13 +00:00
26eddf2eda - 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!)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=83
2022-07-19 11:32:29 +00:00
82e3b471f2 Accepting request 929906 from devel:languages:python
- 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

OBS-URL: https://build.opensuse.org/request/show/929906
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=37
2021-11-09 22:54:05 +00:00
feb781c81e - 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

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=82
2021-11-06 17:58:11 +00:00
16029b3723 Accepting request 906722 from devel:languages:python
- update to 1.14.6:
  * Revert "grovel: detect :float and :double in the :auto type"

OBS-URL: https://build.opensuse.org/request/show/906722
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=36
2021-07-21 17:05:26 +00:00
f72f78178c - update to 1.14.6:
* Revert "grovel: detect :float and :double in the :auto type"

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=81
2021-07-16 19:47:29 +00:00
7a0d0e6d16 Accepting request 871527 from devel:languages:python
- update to 1.14.5:
  * Source fix for old gcc versions

OBS-URL: https://build.opensuse.org/request/show/871527
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=35
2021-02-16 21:33:57 +00:00
ccfa3a1bcb - update to 1.14.5:
* Source fix for old gcc versions

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=79
2021-02-12 20:15:24 +00:00
ce5aa36b5c Accepting request 856979 from devel:languages:python
- update to 1.14.4:
  * no upstream changelog provided

OBS-URL: https://build.opensuse.org/request/show/856979
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=34
2020-12-23 13:18:55 +00:00
8a27de44e4 - update to 1.14.4:
* no upstream changelog provided

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=77
2020-12-19 10:53:46 +00:00
91d610b04a Accepting request 838259 from devel:languages:python
- update to 1.14.3:
  * no upstream changelog provided

OBS-URL: https://build.opensuse.org/request/show/838259
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=33
2020-10-29 08:46:10 +00:00
e70ee5ff18 - update to 1.14.3:
* no upstream changelog provided

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=75
2020-09-28 11:39:21 +00:00
43e1d596b5 Accepting request 828166 from devel:languages:python
- update to 1.14.2
 * CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default

OBS-URL: https://build.opensuse.org/request/show/828166
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=32
2020-08-25 10:38:49 +00:00
b0ac7a1285 - update to 1.14.2
* CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=73
2020-08-20 12:14:15 +00:00
bf449840dd Accepting request 825281 from devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/825281
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=31
2020-08-13 08:12:20 +00:00
efd9de8edf - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=71
2020-08-10 08:15:41 +00:00
8aa45123ea Accepting request 778788 from devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/778788
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=30
2020-02-26 14:01:21 +00:00
5620af39cd - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=69
2020-02-24 14:59:21 +00:00
90e2083099 Accepting request 749648 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/749648
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=29
2019-11-22 09:26:09 +00:00
Todd R
c4413bb1dd Accepting request 749647 from home:TheBlackCat:branches:devel:languages:python
Update to 1.13.2

OBS-URL: https://build.opensuse.org/request/show/749647
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=67
2019-11-19 14:50:55 +00:00
0b989e8962 Accepting request 738589 from devel:languages:python
- Update to 1.13.0:
  * No changelog provided upstream

OBS-URL: https://build.opensuse.org/request/show/738589
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=28
2019-11-04 16:05:57 +00:00
Tomáš Chvátal
eec0f391f1 - Update to 1.13.0:
* No changelog provided upstream

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=65
2019-10-15 10:55:03 +00:00
9bbd9d0217 Accepting request 700339 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/700339
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=27
2019-05-05 19:19:35 +00:00
Tomáš Chvátal
5c4df23a24 Accepting request 699759 from home:TheBlackCat:branches:devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/699759
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=63
2019-05-03 08:32:37 +00:00
70ddc1805b Accepting request 682590 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/682590
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=26
2019-03-12 08:44:57 +00:00
Tomáš Chvátal
9495981e5a Accepting request 682487 from home:jayvdb:py-check-failures
- Remove test suite exception which was fixed by 7a76a38153*.patch
- Add doc/*/*.rst to %doc

OBS-URL: https://build.opensuse.org/request/show/682487
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=61
2019-03-07 16:39:07 +00:00
97877dc493 Accepting request 680758 from devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/680758
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=25
2019-03-04 08:11:58 +00:00
3bca1778c0 - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=59
2019-03-02 10:48:08 +00:00
891b6e2475 Accepting request 645316 from devel:languages:python
- Add 7a76a381534012af4790e815140d1538510b7d93.patch to fix
  bsc#1111657 (we need use to proper void returning function not
  to corrupt memory in tests). (forwarded request 645313 from mcepl)

OBS-URL: https://build.opensuse.org/request/show/645316
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=24
2018-11-08 08:42:02 +00:00
0c76d6df2a Accepting request 645313 from home:mcepl:work
- Add 7a76a381534012af4790e815140d1538510b7d93.patch to fix
  bsc#1111657 (we need use to proper void returning function not
  to corrupt memory in tests).

OBS-URL: https://build.opensuse.org/request/show/645313
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=57
2018-10-29 15:31:03 +00:00
2067bc3cda Accepting request 642726 from devel:languages:python
- Fix calling of py.test executor.

OBS-URL: https://build.opensuse.org/request/show/642726
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=23
2018-10-25 06:09:14 +00:00
e2182e7d2a Fix *.changes file
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=55
2018-10-17 16:53:51 +00:00
5b720e63b6 Fix py.test calling
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=54
2018-10-17 16:45:01 +00:00
b8ddb5dcdb Test again
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=53
2018-10-17 15:28:45 +00:00
2135b5caf7 Testing upstream bug# 390
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=52
2018-10-17 15:11:53 +00:00
5060e23178 Accepting request 636994 from devel:languages:python
- Add 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch as
  a workardond against
  https://bitbucket.org/cffi/cffi/issues/378/ (possible bug in
  GCC, see https://bugzilla.redhat.com/1552724).
- Add e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch from
  upstream to remove some warnings.
  https://bitbucket.org/cffi/cffi/issues/384/

OBS-URL: https://build.opensuse.org/request/show/636994
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=22
2018-09-26 12:53:50 +00:00
85c14cfd92 - Add 3184b0a675fc425b821b528d7fdf744b2f08dadf.patch as
a workardond against
  https://bitbucket.org/cffi/cffi/issues/378/ (possible bug in
  GCC, see https://bugzilla.redhat.com/1552724).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=50
2018-09-21 05:26:36 +00:00
78a65200ea - Remove ignore-tests.patch -- testing what will happen
- Add e2e324a2f13e3a646de6f6ff03e90ed7d37e2636.patch from
  upstream to remove some warnings.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=49
2018-09-19 18:44:24 +00:00
492f71faeb - Switch off falling tests with new patch
ignore-tests.patch instead of -k parameter for py.test.
  https://bitbucket.org/cffi/cffi/issues/384/

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=48
2018-09-18 16:00:36 +00:00
26df968826 Accepting request 582163 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/582163
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=21
2018-03-05 12:35:18 +00:00
Tomáš Chvátal
ba986255d1 Accepting request 582117 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/582117
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=46
2018-03-03 06:21:59 +00:00
1e61e379fa Accepting request 578275 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/578275
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=20
2018-02-25 10:35:31 +00:00
Tomáš Chvátal
b3cb3e6812 Accepting request 578239 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/578239
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=44
2018-02-20 08:20:54 +00:00
09058d2a56 Accepting request 567429 from devel:languages:python
- Add patch cffi-loader.patch to fix bsc#1070737
- Sort out with spec-cleaner

OBS-URL: https://build.opensuse.org/request/show/567429
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=19
2018-01-20 10:20:12 +00:00
Tomáš Chvátal
60ed614164 - Add patch cffi-loader.patch to fix bsc#1070737
- Sort out with spec-cleaner

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=42
2018-01-18 13:44:02 +00:00
Tomáš Chvátal
57d6534f59 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=41 2018-01-18 13:30:58 +00:00
9bd87525f3 Accepting request 540607 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/540607
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=18
2017-11-12 17:00:48 +00:00
Jan Matejek
2fe88e35b4 Accepting request 538866 from home:apersaud:branches:devel:languages:python
update to latest version

OBS-URL: https://build.opensuse.org/request/show/538866
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=39
2017-11-06 15:39:18 +00:00
77a3285120 Accepting request 531228 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/531228
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=17
2017-10-10 09:34:16 +00:00
Jan Matejek
4ecbbe5c86 Accepting request 531217 from home:seanmarlow:branches:devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/531217
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=37
2017-10-04 13:07:40 +00:00
155189a65f Accepting request 507344 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/507344
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=16
2017-07-04 09:56:44 +00:00
546c5651a6 Accepting request 507126 from home:tbechtold:branches:devel:languages:python
- 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.

OBS-URL: https://build.opensuse.org/request/show/507126
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=35
2017-06-30 12:06:28 +00:00
52e136363c Accepting request 482892 from devel:languages:python
- do not generate HTML documentation for packages that are indirect
  dependencies of Sphinx
  (see docs at https://cffi.readthedocs.org/ )
- update to 1.9.1
- singlespec

OBS-URL: https://build.opensuse.org/request/show/482892
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=15
2017-04-19 16:03:54 +00:00
Jan Matejek
d3eb64c85d - do not generate HTML documentation for packages that are indirect
dependencies of Sphinx
  (see docs at https://cffi.readthedocs.org/ )

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=33
2017-03-27 13:52:00 +00:00
Jan Matejek
4eb897a99c - split off -doc subpackage, to prevent build cycle with Sphinx
- separate cffi-doc subpackage to break build loop leading to Sphinx

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=32
2017-03-27 11:51:35 +00:00
Jan Matejek
3fb594641e Accepting request 480703 from devel:languages:python:singlespec
singlespec + version update

OBS-URL: https://build.opensuse.org/request/show/480703
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=31
2017-03-16 18:03:17 +00:00
1d06b49b21 Accepting request 398818 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/398818
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=14
2016-05-31 10:11:58 +00:00
68f8dd10a1 Accepting request 398809 from home:badshah400:branches:openSUSE:Factory:Rings:2-TestDVD
Add upstream patch to actually fix problem with gcc >= 6; drop previous patch used to workaround issue.

OBS-URL: https://build.opensuse.org/request/show/398809
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=29
2016-05-30 07:26:32 +00:00
Jan Matejek
01151b11a5 Accepting request 398372 from home:matejcik:branches:devel:languages:python
- 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)

OBS-URL: https://build.opensuse.org/request/show/398372
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=28
2016-05-27 13:52:37 +00:00
3edd6bed23 Accepting request 398109 from home:badshah400:branches:openSUSE:Factory:Rings:2-TestDVD
Update to v1.6.0; update fixes building against gcc >= 6

OBS-URL: https://build.opensuse.org/request/show/398109
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=27
2016-05-27 09:26:18 +00:00
1179e41ef2 Accepting request 396746 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/396746
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=13
2016-05-23 14:38:03 +00:00
9a5dc9f790 Accepting request 396298 from home:matejcik:branches:devel:languages:python
- update to 1.5.2
  * support for cffi-based embedding
  * more robustness for shutdown logic

OBS-URL: https://build.opensuse.org/request/show/396298
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=25
2016-05-19 09:44:00 +00:00
da1172e6eb Accepting request 352988 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/352988
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=12
2016-01-15 09:39:04 +00:00
Todd R
6a1a88ab62 Accepting request 352713 from home:stroeder:branches:devel:languages:python
update to upstream release 1.4.2 (needed for new python-cryptography 1.2.1)

OBS-URL: https://build.opensuse.org/request/show/352713
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=23
2016-01-11 08:06:05 +00:00
Stephan Kulow
1c3765c28b Accepting request 331672 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/331672
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=11
2015-09-24 05:16:07 +00:00
Denisart Benjamin
0011c2876b Accepting request 331671 from home:posophe:branches:devel:languages:python
update

OBS-URL: https://build.opensuse.org/request/show/331671
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=21
2015-09-17 11:31:05 +00:00
Stephan Kulow
eaecf00935 Accepting request 327584 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/327584
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=10
2015-08-29 18:02:17 +00:00
67b053d1e3 Accepting request 327558 from Cloud:OpenStack:Master
- update to version 1.1.0 (fate#318838):

OBS-URL: https://build.opensuse.org/request/show/327558
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=19
2015-08-27 14:38:33 +00:00
ddf56f58d6 Accepting request 309865 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/309865
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=9
2015-06-12 18:26:37 +00:00
Denisart Benjamin
3d13a415a1 Accepting request 309689 from home:benoit_monin:branches:devel:languages:python
- update to version 1.1.0
- 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

OBS-URL: https://build.opensuse.org/request/show/309689
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=17
2015-06-02 17:47:58 +00:00
Stephan Kulow
1439a44c09 Accepting request 298718 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/298718
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=8
2015-04-25 07:52:37 +00:00
Michal Čihař
f619bc917c Accepting request 298714 from home:Nijel:branches:devel:languages:python
- Update to 0.9.2
  * No upstream changelog
    See https://bitbucket.org/cffi/cffi/commits/all for a list of
    commits

OBS-URL: https://build.opensuse.org/request/show/298714
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=15
2015-04-23 06:53:38 +00:00
Stephan Kulow
9bec7a1771 Accepting request 246511 from devel:languages:python
1

OBS-URL: https://build.opensuse.org/request/show/246511
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=6
2014-08-27 05:46:49 +00:00
Todd R
a9b03d166b Accepting request 246510 from home:TheBlackCat:branches:devel:languages:python
Update to 0.8.6

OBS-URL: https://build.opensuse.org/request/show/246510
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=13
2014-08-26 12:50:37 +00:00
Stephan Kulow
43b767ce66 Accepting request 235633 from devel:languages:python
- update to 0.8.2
  * minor bugfixes
- remove cffi-pytest-integration.patch as it is no longer necessary (forwarded request 234745 from matejcik)

OBS-URL: https://build.opensuse.org/request/show/235633
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=5
2014-06-24 20:45:49 +00:00
Tomáš Chvátal
6dc6094763 Accepting request 234745 from home:matejcik:branches:devel:languages:python
- update to 0.8.2
  * minor bugfixes
- remove cffi-pytest-integration.patch as it is no longer necessary

OBS-URL: https://build.opensuse.org/request/show/234745
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=11
2014-05-28 08:38:49 +00:00
Sascha Peilicke
15e4c2a51e OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=10 2014-04-02 08:15:41 +00:00
Sascha Peilicke
627dbee2e8 - Require libffi43-devel on SLE_11_SP2 instead of using pkg-config to fix build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=9
2014-03-31 14:19:07 +00:00
Denisart Benjamin
18c7692885 Accepting request 223704 from home:mvyskocil:branches:devel:languages:python
- 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

- update to 0.8
  * integrated support for C99 variable-sized structures
  * multi-thread safety
  * ffi.getwinerror()
  * a number of small fixes

OBS-URL: https://build.opensuse.org/request/show/223704
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=8
2014-02-24 15:15:49 +00:00
Tomáš Chvátal
7b6c9e9797 Accepting request 204531 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/204531
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=4
2013-10-25 09:12:17 +00:00
Sascha Peilicke
c16ecb5be2 - Require python-setuptools instead of distribute (upstreams merged)
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=6
2013-10-24 10:59:46 +00:00
Stephan Kulow
6602b6f86b Accepting request 201444 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/201444
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=3
2013-10-01 06:26:27 +00:00
Denisart Benjamin
e112c7832a Accepting request 201429 from home:mvyskocil
- use pkgconfig(libffi) to get the most recent ffi

OBS-URL: https://build.opensuse.org/request/show/201429
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=4
2013-09-30 08:50:15 +00:00
Stephan Kulow
a6f1f8812f Accepting request 196675 from devel:languages:python
superseeding

OBS-URL: https://build.opensuse.org/request/show/196675
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cffi?expand=0&rev=1
2013-09-03 20:02:47 +00:00
Todd R
2bb73276b1 Accepting request 195613 from home:mvyskocil
- 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

OBS-URL: https://build.opensuse.org/request/show/195613
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=2
2013-08-22 14:39:36 +00:00
Sascha Peilicke
5621aee855 - Initial version
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=1
2013-02-10 10:02:31 +00:00
8 changed files with 23 additions and 372 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0
size 512873

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3157624b7558b914cb039fd1af735e5e8049a87c817cc215109ad1c8779df76
size 516073

3
cffi-2.0.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529
size 523588

View File

@@ -1,302 +0,0 @@
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",

View File

@@ -1,30 +0,0 @@
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

View File

@@ -1,32 +0,0 @@
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

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Sun Sep 14 20:34:00 UTC 2025 - Dirk Müller <dmueller@suse.com>
- update to 2.0.0:
* Added support for free threaded CPython (3.14t+ only)
* Added support for Python 3.14.
* Dropped support for Python 3.8.
-------------------------------------------------------------------
Wed Oct 9 06:36:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 1.17.1:
* Fix failing distutils.msvc9compiler imports under Windows (#118).
* ffibuilder.emit_python_code() and ffibuiler.emit_c_code()
accept file-like objects (#115).
* ffiplatform calls are bypassed by ffibuilder.emit_python_code()
and ffibuilder.emit_c_code() (#81).
-------------------------------------------------------------------
Sat Aug 31 12:39:52 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-cffi
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-cffi
Version: 1.17.0
Version: 2.0.0
Release: 0
Summary: Foreign Function Interface for Python calling C code
License: MIT