| 1 |
+++++++++++++++++++++++ |
| 2 |
pythoncapi-compat users |
| 3 |
+++++++++++++++++++++++ |
| 4 |
|
| 5 |
Examples of projects using pythoncapi_compat.h |
| 6 |
============================================== |
| 7 |
|
| 8 |
* `bitarray <https://github.com/ilanschnell/bitarray/>`_: |
| 9 |
``bitarray/_bitarray.c`` uses ``Py_SET_SIZE()`` |
| 10 |
(`pythoncapi_compat.h copy |
| 11 |
<https://github.com/ilanschnell/bitarray/blob/master/bitarray/pythoncapi_compat.h>`__) |
| 12 |
* `datatable <https://github.com/h2oai/datatable>`_ |
| 13 |
(`commit <https://github.com/h2oai/datatable/commit/02f13114828ed4567e4410f5bac579895e20355a>`__) |
| 14 |
* `guppy3 <https://github.com/zhuyifei1999/guppy3/>`_ |
| 15 |
(`commit |
| 16 |
<https://github.com/zhuyifei1999/guppy3/commit/4cb9fcb5d75327544a6875b6caabfdffb70a7e29>`__) |
| 17 |
* `immutables <https://github.com/MagicStack/immutables/>`_: |
| 18 |
``immutables/_map.c`` uses ``Py_SET_SIZE()`` |
| 19 |
(`pythoncapi_compat.h copy |
| 20 |
<https://github.com/MagicStack/immutables/blob/master/immutables/pythoncapi_compat.h>`__) |
| 21 |
* `Mercurial (hg) <https://www.mercurial-scm.org/>`_ uses ``Py_SET_TYPE()`` |
| 22 |
(`commit |
| 23 |
<https://www.mercurial-scm.org/repo/hg/rev/e92ca942ddca>`__, |
| 24 |
`pythoncapi_compat.h copy |
| 25 |
<https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/pythoncapi_compat.h>`__) |
| 26 |
* `mypy <https://github.com/python/mypy>`_ |
| 27 |
(mypyc, |
| 28 |
`commit <https://github.com/python/mypy/commit/2b7e2df923f7e4a3a199915b3c8563f45bc69dfa>`__) |
| 29 |
* `numpy <https://numpy.org/>`_: |
| 30 |
`pythoncapi-compat Git submodule |
| 31 |
<https://github.com/numpy/numpy/blob/main/.gitmodules>`_ |
| 32 |
* `pybluez <https://github.com/pybluez/pybluez>`_ |
| 33 |
(`commit <https://github.com/pybluez/pybluez/commit/5096047f90a1f6a74ceb250aef6243e144170f92>`__) |
| 34 |
* `python-snappy <https://github.com/andrix/python-snappy/>`_ |
| 35 |
(`commit <https://github.com/andrix/python-snappy/commit/1a539d71d5b1ceaf9a2291f21f686cf53a46d707>`__) |
| 36 |
* `python-zstandard <https://github.com/indygreg/python-zstandard/>`_ |
| 37 |
uses ``Py_SET_TYPE()`` and ``Py_SET_SIZE()`` |
| 38 |
(`commit <https://github.com/indygreg/python-zstandard/commit/e5a3baf61b65f3075f250f504ddad9f8612bfedf>`__): |
| 39 |
Mercurial extension. |
| 40 |
* `python-zstd <https://github.com/sergey-dryabzhinsky/python-zstd/>`_ |
| 41 |
(`commit <https://github.com/sergey-dryabzhinsky/python-zstd/commit/8aa6d7a4b250e1f0a4e27b4107c39dc516c87f96>`__) |
| 42 |
* `hollerith <https://github.com/pyansys/hollerith/>`_ |
| 43 |
``src/writer.c`` uses ``PyObject_CallOneArg() and other Python 3.9 apis`` |
| 44 |
(`pythoncapi_compat.h copy |
| 45 |
<https://github.com/pyansys/hollerith/blob/main/src/pythoncapi_compat.h>`__) |
| 46 |
* `PyTorch <https://github.com/pytorch/pytorch/>`_ (`pythoncapi_compat.h copy |
| 47 |
<https://github.com/pytorch/pytorch/blob/main/torch/csrc/utils/pythoncapi_compat.h>`__) |
| 48 |
* `PyGObject <https://gitlab.gnome.org/GNOME/pygobject/>`_ |
| 49 |
(`commit <https://gitlab.gnome.org/GNOME/pygobject/-/commit/074c0348417b87d3003dbb409e6fc26b61121de3>`__, |
| 50 |
`pythoncapi-compat Meson subproject |
| 51 |
<https://gitlab.gnome.org/GNOME/pygobject/-/blob/main/subprojects/pythoncapi-compat.wrap?ref_type=heads>`__) |
| 52 |
|
| 53 |
Projects not using pythoncapi_compat.h |
| 54 |
====================================== |
| 55 |
|
| 56 |
Projects not using ``pythoncapi_compat.h``: |
| 57 |
|
| 58 |
* numpy has its own compatibility layer, ``npy_pycompat.h`` and |
| 59 |
``npy_3kcompat.h`` header files. It supports more C compilers than |
| 60 |
pythoncapi_compat.h: it supports ``__STRICT_ANSI__`` (ISO C90) for example. |
| 61 |
Rejected `PR 18713: MAINT: Use pythoncapi_compat.h in npy_3kcompat.h |
| 62 |
<https://github.com/numpy/numpy/pull/18713>`_ (when it was rejected, numpy |
| 63 |
still had code for compatibility with Python 2.7). |
| 64 |
* Cython doesn't use pythoncapi_compat.h: |
| 65 |
`see Cython issue #3934 |
| 66 |
<https://github.com/cython/cython/issues/3934>`_. |
| 67 |
For example, `ModuleSetupCode.c |
| 68 |
<https://github.com/cython/cython/blob/0.29.x/Cython/Utility/ModuleSetupCode.c>`_ |
| 69 |
provides functions like ``__Pyx_SET_REFCNT()``. |
| 70 |
|
| 71 |
Project with a strict contributor agreement: |
| 72 |
|
| 73 |
* `zodbpickle |
| 74 |
<https://github.com/zopefoundation/zodbpickle/pull/64>`_ |