Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled weekly dependency update for week 03 #465

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Collaborator

Update pyobjc from 10.3.2 to 11.0.

Changelog

11.0

-----------------------------------------------------------

The major change in this release is experimental support for free-threading
(`PEP 703 <https://peps.python.org/pep-0703/>`_) which was introduced
as an experimental feature in Python 3.13.

This required fairly significant changes in the core of PyObjC to change
C Python API use and PyObjC internal APIs (mostly related to the use of
borrowed references).

* Dropped support for Python 3.8. PyObjC 11 supports Python 3.9 and later.

* Updated metadata for the macOS 15.2 SDK, including bindings
for the following frameworks:

- MediaExtension
- DeviceDiscoveryExtension

* :issue:`249`: Added minimal bindings to the Carbon framework.

At this time only some functions and constants related to hotkeys
are available. Please file an issue if you have a usecase for other APIs.

* :issue:`615`: Struct wrappers now support a number of functions from
:mod:`copy`: :func:`copy.replace` (new in Python 3.13), :func:`copy.copy`
and :func:`copy.deepcopy`.

* The ``__pyobjc_copy__`` method has been removed from struct wrappers. This
was never a public API. Use :func:`copy.deepcopy` instead.

* :meth:`objc.FSRef.from_path`` now supports ``os.PathLike`` values as its
arguments (as well as strings).

* :issue:`608`: Experimental support for the free-threading mode
introduced in Python 3.13.

The core bridge and framework bindings claim compatibility with free-threading
as introduced as an experimental feature in Python 3.13.

The support in PyObjC is also an experimental feature: I've reviewed
code for free-threading issues and adjusted it where needed, but the
code has seen only light testing w.r.t. concurrency.

Some functionality that's explicitly not thread-safe:

- Defining an Objective-C class with the same name in multiple threads concurrently.

- Splitting calls to ``alloc`` and ``init`` and calling ``init`` multiple
 times concurrently. E.g.:

  .. sourcecode:: python

     import threading
     from Cocoa import NSObject

     v = NSObject.alloc()

     t_list = []
     for _ in range(2):
         t = threading.Thread(target=lambda: v.init())
         t_list.append(t)
         t.start()

     for t in t_list:
         t.join()

* The internal mapping from Python values to their active Objective-C
proxy value now uses weak references. This should not affect user code,
other than being a bit more efficient.

* The internal interfaces for updating this mapping, and the reverse mapping
from Objective-C values to their active Python proxy was changed to remove
a small race condition. This was required for free threading support, but
could in theory also bit hit when using the GIL.

* The data structure for mapping Python values to their Objective-C proxy
has been rewritten to support free threading. This also simplifies the
code, and should be small performance improvement for the regular build
of Python.

* The :exc:`TypeError` raised when passing a non-sequence value to
some APIs implemented in C now has a ``__cause__`` with more detailed
information.

This is a side effect of dropping the use of ``PySequence_Fast`` in the
implementation of PyObjC.

* Removed ``objc.options._nscoding_version``, a private option that is no
longer used.

* Changing the ``__block_signature__`` of a block value when the current
value of the signature is not ``None`` is no longer possible.

Please file an issue if you have a use case for changing the signature
of a block.

* Fix compatibility with Python 3.14 (alpha 3)

* Removed private function ``objc._sizeOfType`` because its unused.

* Fix memory leak when using Python callables as blocks.

The memory leak also resulted in leaking a reference to the callable
(and hence anything kept alive by that reference).

* The generic ``__new__`` implementation now works as intended when
registering methods that other than ``init...`` methods.

* Dropped '%n' support in handling printf-format strings for variadic
functions and methods.

Two reasons for that: 1) supporting this properly should return the
value writing to the %n location (requiring significant changes) and
2) Apple's libraries require using static strings for '%n' to work (at
least on some platforms and versions of the OS)

* :issue:`633`: Fix manual bindings for ``AVAudioPCMBuffer`` methods for
getting channel data (``floatChannelData``, ``int16ChannelData`` and
``int32ChannelData``)

* :issue:`632`: fix broken bindings for ``CGWindowListCreateImageFromArray``.

* The private ``__is_magic`` attribute on :class:`objc.objc_object` has
been renamed to ``__pyobjc_magic_coookie__``.

* Various fixes to edge case behaviour that were found while improving
test coverage.
Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant