pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-cython



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Aug 23 08:03:49 UTC 2026

Modified Files:
        pkgsrc/devel/py-cython: Makefile PLIST distinfo
Added Files:
        pkgsrc/devel/py-cython/patches: patch-tests_run_test__patma.py

Log Message:
py-cython: update to 3.3.0.

3.3.0 (2026-08-22)
==================

Features added
--------------

* PEP-634 Pattern Matching is implemented.
  (Github issue :issue:`4029`)

* ``except *`` (PEP-654 exception groups) is implemented for Python 3.11 and later.
  (Github issue :issue:`4993`)

* Unpacking in comprehensions (PEP-798) is implemented for list/set/dict comprehensions.
  It is not yet available for generator expressions.
  Original patch by Morax.  (Github issue :issue:`7898`)

* Changes were made to adapt to Python 3.15 and its Limited API.
  This does not yet cover ``abi3t``.
  (Github issues :issue:`6405`, :issue:`7190`, :issue:`7347`, :issue:`7348`, :issue:`7358`)

* Cython now uses a new export/import naming scheme for fused C functions that
  increases the resilience against seemingly compatible user code changes.
  The original names are kept for backwards compatibility.
  (Github issue :issue:`7656`)

* Declared container item types (e.g. ``list[float]`` or ``tuple[atype, ...]``)
  are now used by the type system.
  (Github issues :issue:`7288`, :issue:`7798`)

* Type inference was improved for builtin Python types and their methods.
  (Github issues :issue:`7536`, :issue:`7644`, :issue:`7887`, :issue:`7888`)

* Exception base types are inferred for the target variable of multi-exception ``except``
  clauses and for collections of exceptions.  Properties like ``.args`` and ``.context``
  use direct C access in CPython.
  (Github issue :issue:`7783`)

* Annotations on global variables are now used by type inference.
  (Github issue :issue:`7877`)

* The feature set of the shared module can be selected at build time
  by listing named features to include or exclude.
  This is an experimental configuration, subject to further improvements.
  Failures to include used features will currently result in import failures.
  (Github issue :issue:`7759`)

* To control the generation of the shared module, the ``cython`` command gained
  a sub-command ``cython generate-shared pkg/modulename.c`` with additional options
  ``--only`` and ``--exclude``.
  Patch by Raza Khan.  (Github issue :issue:`7842`)

* Conditions in strongly predictable if-clauses or if-else expressions can be wrapped in
  ``cython.likely(condition)`` or ``cython.unlikely(condition)`` to help the C compiler
  optimise the branch.  Note that Cython automatically detects ``raise`` and ``assert``
  statements as terminators already and marks if-clauses that directly lead to them as
  ``unlikely()``, without user interaction.
  (Github issue :issue:`7667`)

* Extension types can declare themselves explicitly as sequence or mapping with
  ``@cython.collection_type("sequence")`` or ``@cython.collection_type("mapping")``.
  This has an effect on their behaviour in pattern matching and subscripting.
  (Github issue :issue:`5027`)

* Sequence types marked as ``@cython.collection_type("sequence")`` that use C integers
  in the subscript special methods now implement only the sequence and not the mapping protocol.
  This allows subscripting code to avoid creating Python index objects when the index
  is already available as C integer.
  (Github issue :issue:`7435`)

* Sequence types that have their ``Py_TPFLAGS_SEQUENCE`` type flag set can benefit from
  faster subscripting via the sequence protocol as Cython now bypasses the mapping protocol
  for them if both protocols are implemented.
  (Github issue :issue:`7432`)

* The Py3.15 ``frozendict`` builtin type is supported and has been backported as an alias
  for ``dict`` in older Python versions.
  Patches to adapt existing ``dict`` optimisations were contributed by Omkar Kabde.
  (Github issues :issue:`7545`, :issue:`7647`)

* The Py3.15 ``sentinel`` builtin is supported and its C-API declarations are available in
  ``cpython.sentinel``.

* ``cython.py_int`` (and the same for ``py_float``, ``py_complex`` and ``py_bool``)
  can be used to refer to Python's builtin types in a C type context, e.g. after ``cdef``,
  where they are normally shadowed by the C types of the same name.
  (Github issue :issue:`7844`)

* The builtin Python types ``int``, ``float``, ``str``, ``bytes`` and ``bytearray``
  are special cased in comparisons to speed them up.
  (Github issues :issue:`7452`, :issue:`7474`)

* The builtin Python types ``int`` and ``float`` are special cased in ``+``, ``-`` and ``*``
  operations with (compile-time) unknown Python types in order to speed them up.
  The bit operations ``^``, ``|`` and ``&`` are additionally special cased for ``int``.
  (Github issues :issue:`7485`, :issue:`7541`)

* ``<bool>`` casts can be used to convert C values to Python ``True`` / ``False``.
  (Github issue :issue:`7513`)

* ``cdef`` property methods support setters.
  (Github issues :issue:`7505`, :issue:`7791`)

* The C ``restrict`` modifier can be used in declarations.
  (Github issue :issue:`7617`)

* C arrays may now be declared with (``extern`` or internal) enum values as their size.
  (Github issues :issue:`7401`, :issue:`7406`)

* ``prange(num_threads=0)`` automatically selects the maximum number of OpenMP threads.
  (Github issue :issue:`7586`)

* ``prange()`` and ``parallel()`` sections can be used without releasing the GIL, which
  helps in freethreading builds.  When releasing the GIL as part of the section declaration,
  re-acquiring it immediately inside is now faster, e.g. to do per-thread Python initialisations.
  (Github issue :issue:`6562`)

* ``cython.pymutex`` and ``cython.pythread_type_lock`` now support a ``.locked()`` method
  to check if the lock is currently held without blocking. The method works on all Python
  versions using atomic reads on Python 3.13+ and a try-acquire approach on older versions.
  (Github issue :issue:`7275`)

* A simpler mechanism was added for implementing C++ exception handlers in Cython code.
  (Github issues :issue:`7388`, :issue:`7390`)

* Repeated memoryview slicing inside of loops now avoids redundant reference counting,
  making it substantially faster.
  (Github issue :issue:`5507`)

* Indexing into Cython memoryview objects from Python is faster.
  (Github issue :issue:`7529`)

* Some internal call overhead in the memoryview code was removed.
  (Github issue :issue:`7609`)

* Extension types use the vectorcall interface for their instantiation in many cases.
  This can be configured with a new C feature macro ``CYTHON_VECTORCALL_TPNEW``.
  (Github issue :issue:`7698`)

* Coroutine methods use the faster vectorcall interface.
  (Github issue :issue:`7678`)

* Vectorcalls with literal keyword arguments use cached constant keyword name tuples.
  (Github issue :issue:`7713`)

* List comprehensions that generate new objects avoid refcounting overhead for appending.
  (Github issue :issue:`7748`)

* Method calls in older Limited API versions are slightly faster.
  (Github issue :issue:`7707`)

* Constant ``frozenset`` objects are deduplicated and cached at module init time
  (similar to constant tuple and slice objects).
  Original Patch by Zhenbo Li. (Github issue :issue:`2741`)

* C arrays are substituted for sequence iteration in more cases, also inside of generators.
  Ad-hoc C array storage on the stack and in closures was reworked along the way.
  (Github issues :issue:`7323`, :issue:`7339`)

* Single character `in`-tests on ``str``, ``bytes`` and ``bytearray`` are optimised.
  (Github issue :issue:`3888`)

* Unicode string comparisons to single character literals are faster.
  (Github issue :issue:`7418`)

* F-strings are a little faster in some cases.
  (Github issues :issue:`7495`, :issue:`7526`)

* Formatting C floating point values in f-strings avoids creating Python floats in some cases.
  Patch by Vladimir Saraikin.  (Github issue :issue:`7797`)

* ``bytearray.extend(bytes)`` is faster.
  (Github issue :issue:`7797`)

* ``assert`` conditions are constant-folded.
  (Github issue :issue:`7809`)

* PyPy and GraalPython use the vectorcall protocol to enable faster Python calls in future releases.
  (Github issue :issue:`7614`)

* The runtime conversion from a Python mapping to a C struct/union uses less code.
  (Github issue :issue:`7343`)

* The error handling of memoryviews uses less code.
  (Github issue :issue:`7525`)

* The runtime dispatch code of fused types uses less code.
  (Github issue :issue:`7501`)

* More code is extracted to the shared utility code module.
  (Github issues :issue:`7556`, :issue:`7570`)

* Async generator objects are slightly smaller.
  (Github issue :issue:`7776`)

* Cython compiled functions have a more efficient memory layout in the Limited API.
  (Github issue :issue:`7519`)

* Module string content is now compressed with LZSS by default, which reduces the footprint of the
  decompressor code compared to the 3.2.x default ``zlib``.  This also avoids a runtime dependency
  on the ``zlib`` module since the tiny LZSS decompressor can be embedded in the module.
  (Github issue :issue:`7577`)

* The Py2 ``print`` statement is now implemented in Cython instead of C to make it
  thread-safe and uses a vectorcall into Python.
  (Github issue :issue:`7642`)

* Several C++ exception declarations were added to ``libcpp.exceptions``.
  (Github issue :issue:`7389`)

* Missing Python type flag declarations were added to ``cpython.object``.
  (Github issue :issue:`7441`)

* Declarations for ``PyType_GetSlot()`` and the corresponding type slot IDs were added
  to ``cpython.type``.

* Declarations for specialised byte-conversion functions were added to ``cpython.long`` and ``cpython.float``.
  Patch by Valentin Valls.  (Github issue :issue:`7738`)

* Error detection when assigning to ``const`` variables was improved.
  (Github issue :issue:`7359`)

* Some cases of likely misuse of ``critical_section`` now generate warnings.
  (Github issue :issue:`6766`)

* Programmatic use of Cython has become easier by avoiding the need to manually set up
  the error reporting.
  (Github issue :issue:`7235`)

* Autoscaling in ``cymeit`` is a little faster.

* ``TreeFragment.parse_from_strings()`` now supports full modules and ``.pxd`` files.
  Patch by Itamar Turner-Trauring.  (Github issue :issue:`7827`)

* Unicode 17.0.0 is used to parse identifiers.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 pkgsrc/devel/py-cython/Makefile
cvs rdiff -u -r1.37 -r1.38 pkgsrc/devel/py-cython/PLIST
cvs rdiff -u -r1.100 -r1.101 pkgsrc/devel/py-cython/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/py-cython/patches/patch-tests_run_test__patma.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/py-cython/Makefile
diff -u pkgsrc/devel/py-cython/Makefile:1.120 pkgsrc/devel/py-cython/Makefile:1.121
--- pkgsrc/devel/py-cython/Makefile:1.120       Fri Jul 24 12:45:21 2026
+++ pkgsrc/devel/py-cython/Makefile     Sun Aug 23 08:03:49 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.120 2026/07/24 12:45:21 adam Exp $
+# $NetBSD: Makefile,v 1.121 2026/08/23 08:03:49 wiz Exp $
 
-DISTNAME=      cython-3.2.9
+DISTNAME=      cython-3.3.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=C/Cython/}
@@ -25,8 +25,8 @@ USE_CC_FEATURES=      c99
 # error: 'for' loop initial declarations are only allowed in C99 mode
 FORCE_C_STD+=          c99
 
-# as of 3.2.2
-# 13 failed, 757 passed, 12 skipped, 2 warnings
+# as of 3.3.0
+# 13 failed, 859 passed, 13 skipped, 3 warnings
 
 # remove tests that are so broken they break collecting the other tests
 pre-test:

Index: pkgsrc/devel/py-cython/PLIST
diff -u pkgsrc/devel/py-cython/PLIST:1.37 pkgsrc/devel/py-cython/PLIST:1.38
--- pkgsrc/devel/py-cython/PLIST:1.37   Mon Nov 10 09:30:14 2025
+++ pkgsrc/devel/py-cython/PLIST        Sun Aug 23 08:03:49 2026
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.37 2025/11/10 09:30:14 wiz Exp $
+@comment $NetBSD: PLIST,v 1.38 2026/08/23 08:03:49 wiz Exp $
 bin/cygdb-${PYVERSSUFFIX}
 bin/cython-${PYVERSSUFFIX}
 bin/cythonize-${PYVERSSUFFIX}
@@ -169,6 +169,7 @@ ${PYSITELIB}/Cython/Compiler/Scanning.so
 ${PYSITELIB}/Cython/Compiler/StringEncoding.py
 ${PYSITELIB}/Cython/Compiler/StringEncoding.pyc
 ${PYSITELIB}/Cython/Compiler/StringEncoding.pyo
+${PYSITELIB}/Cython/Compiler/StringEncoding.so
 ${PYSITELIB}/Cython/Compiler/Symtab.py
 ${PYSITELIB}/Cython/Compiler/Symtab.pyc
 ${PYSITELIB}/Cython/Compiler/Symtab.pyo
@@ -323,6 +324,7 @@ ${PYSITELIB}/Cython/Includes/cpython/dic
 ${PYSITELIB}/Cython/Includes/cpython/exc.pxd
 ${PYSITELIB}/Cython/Includes/cpython/fileobject.pxd
 ${PYSITELIB}/Cython/Includes/cpython/float.pxd
+${PYSITELIB}/Cython/Includes/cpython/frozendict.pxd
 ${PYSITELIB}/Cython/Includes/cpython/function.pxd
 ${PYSITELIB}/Cython/Includes/cpython/genobject.pxd
 ${PYSITELIB}/Cython/Includes/cpython/getargs.pxd
@@ -346,6 +348,7 @@ ${PYSITELIB}/Cython/Includes/cpython/pyp
 ${PYSITELIB}/Cython/Includes/cpython/pystate.pxd
 ${PYSITELIB}/Cython/Includes/cpython/pythread.pxd
 ${PYSITELIB}/Cython/Includes/cpython/ref.pxd
+${PYSITELIB}/Cython/Includes/cpython/sentinel.pxd
 ${PYSITELIB}/Cython/Includes/cpython/sequence.pxd
 ${PYSITELIB}/Cython/Includes/cpython/set.pxd
 ${PYSITELIB}/Cython/Includes/cpython/slice.pxd
@@ -433,6 +436,10 @@ ${PYSITELIB}/Cython/Includes/posix/types
 ${PYSITELIB}/Cython/Includes/posix/uio.pxd
 ${PYSITELIB}/Cython/Includes/posix/unistd.pxd
 ${PYSITELIB}/Cython/Includes/posix/wait.pxd
+${PYSITELIB}/Cython/LZSS.py
+${PYSITELIB}/Cython/LZSS.pyc
+${PYSITELIB}/Cython/LZSS.pyo
+${PYSITELIB}/Cython/LZSS.so
 ${PYSITELIB}/Cython/Plex/Actions.pxd
 ${PYSITELIB}/Cython/Plex/Actions.py
 ${PYSITELIB}/Cython/Plex/Actions.pyc
@@ -477,7 +484,6 @@ ${PYSITELIB}/Cython/Runtime/refnanny.pyx
 ${PYSITELIB}/Cython/Runtime/refnanny.so
 ${PYSITELIB}/Cython/Shadow.py
 ${PYSITELIB}/Cython/Shadow.pyc
-${PYSITELIB}/Cython/Shadow.pyi
 ${PYSITELIB}/Cython/Shadow.pyo
 ${PYSITELIB}/Cython/StringIOTree.py
 ${PYSITELIB}/Cython/StringIOTree.pyc
@@ -536,10 +542,13 @@ ${PYSITELIB}/Cython/Utility/CythonFuncti
 ${PYSITELIB}/Cython/Utility/Dataclasses.c
 ${PYSITELIB}/Cython/Utility/Embed.c
 ${PYSITELIB}/Cython/Utility/Exceptions.c
+${PYSITELIB}/Cython/Utility/Exceptions_Cy.pyx
 ${PYSITELIB}/Cython/Utility/ExtensionTypes.c
 ${PYSITELIB}/Cython/Utility/FunctionArguments.c
 ${PYSITELIB}/Cython/Utility/FusedFunction.pyx
 ${PYSITELIB}/Cython/Utility/ImportExport.c
+${PYSITELIB}/Cython/Utility/MatchCase.c
+${PYSITELIB}/Cython/Utility/MatchCase_Cy.pyx
 ${PYSITELIB}/Cython/Utility/MemoryView.pxd
 ${PYSITELIB}/Cython/Utility/MemoryView.pyx
 ${PYSITELIB}/Cython/Utility/MemoryView_C.c
@@ -548,7 +557,6 @@ ${PYSITELIB}/Cython/Utility/NumpyImportA
 ${PYSITELIB}/Cython/Utility/ObjectHandling.c
 ${PYSITELIB}/Cython/Utility/Optimize.c
 ${PYSITELIB}/Cython/Utility/Overflow.c
-${PYSITELIB}/Cython/Utility/Printing.c
 ${PYSITELIB}/Cython/Utility/Profile.c
 ${PYSITELIB}/Cython/Utility/StringTools.c
 ${PYSITELIB}/Cython/Utility/Synchronization.c
@@ -569,8 +577,8 @@ ${PYSITELIB}/Cython/Utils.pyo
 ${PYSITELIB}/Cython/Utils.so
 ${PYSITELIB}/Cython/__init__.py
 ${PYSITELIB}/Cython/__init__.pyc
-${PYSITELIB}/Cython/__init__.pyi
 ${PYSITELIB}/Cython/__init__.pyo
+${PYSITELIB}/Cython/_shared.so
 ${PYSITELIB}/Cython/py.typed
 ${PYSITELIB}/${WHEEL_INFODIR}/METADATA
 ${PYSITELIB}/${WHEEL_INFODIR}/RECORD

Index: pkgsrc/devel/py-cython/distinfo
diff -u pkgsrc/devel/py-cython/distinfo:1.100 pkgsrc/devel/py-cython/distinfo:1.101
--- pkgsrc/devel/py-cython/distinfo:1.100       Fri Jul 24 12:45:21 2026
+++ pkgsrc/devel/py-cython/distinfo     Sun Aug 23 08:03:49 2026
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.100 2026/07/24 12:45:21 adam Exp $
+$NetBSD: distinfo,v 1.101 2026/08/23 08:03:49 wiz Exp $
 
-BLAKE2s (cython-3.2.9.tar.gz) = 21f9f7e545087bc91e4946c622d6367d39c62ee01e700efc7589fc10fd468ada
-SHA512 (cython-3.2.9.tar.gz) = 5592d4eca3c522628082a695c514627e12b933cb761be77c97da9dda0dafdc44b16ea6ceb18a773ac32173c96e6150d06fa1d61b99d8f85d0fdc367e105b6bb1
-Size (cython-3.2.9.tar.gz) = 3293493 bytes
+BLAKE2s (cython-3.3.0.tar.gz) = d316b29046a86d4efc236f5f7b5e77a53303cdafcd2dd62706a516a195b37948
+SHA512 (cython-3.3.0.tar.gz) = 733892dcdb8a12f5914e46e8d7c83e2429573f292c1ff9817bce83fb18c9183d34956e5b061dbe790d822ca62c85f3e2bfe7b1e7ee38ab9302fcd09351a161be
+Size (cython-3.3.0.tar.gz) = 3727515 bytes
 SHA1 (patch-Demos_embed_Makefile) = 67c4f662a8d79d39cbf8808d2e87d91a26ef28b9
 SHA1 (patch-runtests.py) = b955b089d284f638eb5de85878204c084c550ef5
+SHA1 (patch-tests_run_test__patma.py) = 9dddc271d45f48f46e1c818a1140df709726a266

Added files:

Index: pkgsrc/devel/py-cython/patches/patch-tests_run_test__patma.py
diff -u /dev/null pkgsrc/devel/py-cython/patches/patch-tests_run_test__patma.py:1.1
--- /dev/null   Sun Aug 23 08:03:49 2026
+++ pkgsrc/devel/py-cython/patches/patch-tests_run_test__patma.py       Sun Aug 23 08:03:49 2026
@@ -0,0 +1,105 @@
+$NetBSD: patch-tests_run_test__patma.py,v 1.1 2026/08/23 08:03:49 wiz Exp $
+
+Avoid construct only allowed by Python 3.15 for now.
+
+--- tests/run/test_patma.py.orig       2026-08-23 07:58:25.174800123 +0000
++++ tests/run/test_patma.py
+@@ -2933,7 +2933,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_256(self):
+         x = 0
+         match x:
+-            case +0:
++            case 0:
+                 y = 0
+         self.assertEqual(x, 0)
+         self.assertEqual(y, 0)
+@@ -2941,7 +2941,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_257(self):
+         x = 0
+         match x:
+-            case +0.0:
++            case 0.0:
+                 y = 0
+         self.assertEqual(x, 0)
+         self.assertEqual(y, 0)
+@@ -2949,7 +2949,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_258(self):
+         x = 0
+         match x:
+-            case +0j:
++            case 0j:
+                 y = 0
+         self.assertEqual(x, 0)
+         self.assertEqual(y, 0)
+@@ -2957,7 +2957,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_259(self):
+         x = 0
+         match x:
+-            case +0.0j:
++            case 0.0j:
+                 y = 0
+         self.assertEqual(x, 0)
+         self.assertEqual(y, 0)
+@@ -2965,7 +2965,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_260(self):
+         x = 1
+         match x:
+-            case +1:
++            case 1:
+                 y = 0
+         self.assertEqual(x, 1)
+         self.assertEqual(y, 0)
+@@ -2973,7 +2973,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_261(self):
+         x = 1.5
+         match x:
+-            case +1.5:
++            case 1.5:
+                 y = 0
+         self.assertEqual(x, 1.5)
+         self.assertEqual(y, 0)
+@@ -2981,7 +2981,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_262(self):
+         x = 1j
+         match x:
+-            case +1j:
++            case 1j:
+                 y = 0
+         self.assertEqual(x, 1j)
+         self.assertEqual(y, 0)
+@@ -2989,7 +2989,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_263(self):
+         x = 1.5j
+         match x:
+-            case +1.5j:
++            case 1.5j:
+                 y = 0
+         self.assertEqual(x, 1.5j)
+         self.assertEqual(y, 0)
+@@ -2997,7 +2997,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_264(self):
+         x = 0.25 + 1.75j
+         match x:
+-            case +0.25 + 1.75j:
++            case 0.25 + 1.75j:
+                 y = 0
+         self.assertEqual(x, 0.25 + 1.75j)
+         self.assertEqual(y, 0)
+@@ -3005,7 +3005,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_265(self):
+         x = 0.25 - 1.75j
+         match x:
+-            case 0.25 - +1.75j:
++            case 0.25 - 1.75j:
+                 y = 0
+         self.assertEqual(x, 0.25 - 1.75j)
+         self.assertEqual(y, 0)
+@@ -3013,7 +3013,7 @@ class TestPatma(unittest.TestCase):
+     def test_patma_266(self):
+         x = 0
+         match x:
+-            case +1e1000:
++            case 1e1000:
+                 y = 0
+             case 0:
+                 y = 1



Home | Main Index | Thread Index | Old Index