DeprecationWarnings in framework wrappers

Issue #114 new
Ronald Oussoren
repo owner created an issue
  • Add metadata about deprecated APIs (that is, metadata that says definition "foo" is deprecated in OSX 10.5), and add a function to "objc" to tell which deprecation warnings should be active (default: None). For example:
import objc
objc.options.deprecation_osx_release = "10.8"

The bridge would then warn about the use of a deprecated symbol using a new warning class.

  • Add a build option to not include deprecated symbols into binaries. Primarily for use in binaries that are targeting the AppStore

Comments (4)

  1. Ronald Oussoren reporter

    Implement the machinery for emitting API deprecation warnings

    With this patch it will be possible to add metadata for API deprecations, and use that at runtime. The patch only adds machinery for methods and functions, this will only be useful when metadata is updated.

    See #114

    → <<cset 1925cf88758a>>

  2. Ronald Oussoren reporter

    I've added the basic machinery in changeset 1925cf88758a

    I'm leaving this issue open because the actual metadata needs to be updated to make this actually useful.

    Also: the changeset only implements deprecation warnings for function and method calls, there should also be machinery for constants.

    Still todo:

    • Design and implement a way to have deprecation warnings for constants (at import time, but excluding '*' imports...)
    • Add metadata to all framework wrappers, most likely during the update to the next macOS release (10.13)
    • Add option to py2app that will set the deprecation warning option to an appropriate value
  3. Log in to comment