PyObjC 5.0 is out

The release of macOS 10.14 is near, it is therefore time to release a new major version of PyObjC. I’ve uploaded PyObjC to PyPI, it can be installed using “python3 -m pip install -U pyobjc”.

What is PyObjC

The PyObjC project provides bindings to most of Apple’s higher-level APIs (frameworks). More information about these bindings and how to use PyObjC can be found on the PyObjC website.

What is new

The main feature of this release is the addition of support for APIs introduced in macOS 10.14 (Mojave).

In particular:

  • Adds support for macOS 10.14 (Mojave)

This release updates the framework wrappers with support for new APIs in macOS 10.14 and adds bindings for the following new frameworks:

  • AdSupport
  • CoreAudio (new in macOS 10.0)
  • CoreAudioKit (new in macOS 10.4)
  • CoreMedia (new in macOS 10.7)
  • CoreMediaIO (new in macOS 10.7)
  • DiscRecording (new in macOS 10.2)
  • DiscRecordingUI (new in macOS 10.2)
  • DVDPlayback (new in macOS 10.3)
  • MediaToolbox
  • NaturalLanguage
  • Network
  • OSAKit (new in macOS 10.4)
  • UserNotifications
  • VideoSubscriberAccount
  • VideoToolbox (new in macOS 10.8)

    • Added two features that can help with gating code on the version of macos:

1) The constants “objc.MAC_OS_X_VERSION_CURRENT” can be compared with one of the “objc.MAC_OS_X_VERSION_…” contants.

2) The function “objc.macos_avaiable(major, minor[, patch])” returns true if the current macOS version is at least the specified version, comparable with “@available” in Swift.

  • PR19: Fix deprecation warning in bridgesupport support module

Patch by: Mickaël Schoentgen

  • Creating objc.ObjCPointer instances now results in a Python warning, instead of an unconditional message on stdout.

  • System bridgesupport XML files (normally not used by PyObjC) can contain constant numbers with value “inf”, PyObjC now knows how to handle those.

  • Added bindings for the “Metadata” subframework of the “CoreServices” framework.

  • Added bindings for the “CarbonCore” subframework of the “CoreServices” framework.

Most APIs in this subframework are not available to Python, only those APIs that are not deprecated and seem interesting are exposed.

  • The separate framework wrappers DictionaryServices, LaunchServices and SearchKit are deprecated, use the CoreServices bindings instead.

These framework wrappers still exists, but are effectively aliases for CoreServices with this release. Because of this these bindings can expose more symbols than previously.

  • Fix unexpected exception when trying to call getattr on a framework wrapped with a name that isn’t a valid identifier.

  • Issue 244: Bad metadata for CGPDFOperatorTableSetCallback

  • Issue 247: Fix crash in regression test case

One specific test in pyobjc-core crashed the interpreter when run separately. Because of this I’ve disabled an optimization that uses alloca instead of PyMem_Malloc to allocate memory for now.

Supporting development

I do all development on PyObjC in my spare time. Please consider donating if you use PyObjC professionally. This will help me to improve PyObjC and related projects. See my website for more information.

Ronald Oussoren @ronaldoussoren