IBM QRadar SOAR

IBM QRadar SOAR

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Upcoming changes in Python 3.12

By Mark Scherfling posted 7 days ago

  

Summer greetings,

Python continues to evolve with new releases coming out (3.14 will release in October, 2025) and older versions nearing their end-of-life (Python 3.9 also in October, 2025). This link shows the anticipated new releases and end-of-life schedules. For 3.9, this means security updates will no longer be produced. IBM written integration apps continue to be compatible with Python 3.9, but we develop our apps using Python 3.11 which is used in the containers hosted in the App Host environment. Future versions of apps will mostly likely move to use Python 3.12.

In addition to changes to Python versions, changes are occurring in frequently used packages, such as setuptools. Setuptools is used in apps to aid in packaging and app installation in the Python package framework. One anticipated change to setuptools will disrupt the use of existing apps. In setuptools version 81, expected in November 2025, a package dependency will be removed to `pkg_resources`. This library has been used by the IBM run-time tool `resilient-circuits` and has been used by all apps developed using the `resilient-sdk` tool. It's possible that you've already seen the run-time warning messages if you're running Python 3.12 or 3.13:

UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81

It's worth noting that this upcoming change will NOT affect SOAR apps running in the following environments:

  • App Host
  • Integration servers running Python < 3.12
  • Integration servers running Python 3.12 using setuptools <= 80.x

However, over time, running integration environments in Python 3.12 and beyond may be necessary, and preparing for app changes should be anticipated. Starting with the 51.0.7.0 release of the IBM development and run-time packages: resilient, resilient-lib, resilient-sdk and resilient-circuits, all references to the pkg-resources package have been removed. These SOAR packages are available now and can be downloaded using the `pip` command (ex. pip install --upgrade resilient-circuits). These tools do not rely on the 51.0.7.x release of IBM QRadar SOAR, and can be used with any relatively current version of SOAR. Developing new apps using `resilient-sdk codegen` will also provide future-proof changes which make an app compatible with older versions of Python (such as 3.6) as well as current Python environments.

For existing apps in an Integration server environment, it may be necessary to make code changes in the event running with setuptools >= 81 is unavoidable. The steps to follow are detailed below. Making this change will allow the app to run equally in older and newer Python environments.

For a given app, there's a file at the top level of the directory structure named __init__.py. The contents of that file will contain:

import pkg_resources
try:
  __version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
  pass

This file should be changed to:

import sys
if sys.version_info >= (3, 8):
  import importlib.metadata

  try:
    __version__ = importlib.metadata.version(__name__)
  except importlib.metadata.PackageNotFoundError:
    pass
else:
  import pkg_resources
  try:
    __version__ = pkg_resources.get_distribution(__name__).version
  except pkg_resources.DistributionNotFound:
    pass

There are other __init__.py files within an app's folder structure which are empty and will remain unchanged. 

IBM is already making these changes in existing apps and will roll out the changes over time on the AppExchange. If any issues are encountered with IBM supported apps, please open a support ticket for our attention. However, for customers-written apps, maintaining currency with the changing run-time environments will be necessary to ensure uninterrupted usage. 

0 comments
2 views

Permalink