From a0e8850923ac432a224cb20b63c09bb8e0df41f7 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Fri, 26 Sep 2025 14:06:53 +0200 Subject: [PATCH 1/2] feat: Add script to determine lowest supported version --- scripts/populate_tox/populate_tox.py | 4 ++- scripts/update_integration_support.py | 52 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 scripts/update_integration_support.py diff --git a/scripts/populate_tox/populate_tox.py b/scripts/populate_tox/populate_tox.py index d625c1da72..c0bf7f1a9f 100644 --- a/scripts/populate_tox/populate_tox.py +++ b/scripts/populate_tox/populate_tox.py @@ -665,7 +665,7 @@ def _normalize_release(release: dict) -> dict: return normalized -def main(fail_on_changes: bool = False) -> None: +def main(fail_on_changes: bool = False) -> dict[str, list]: """ Generate tox.ini from the tox.jinja template. @@ -825,6 +825,8 @@ def main(fail_on_changes: bool = False) -> None: "files to reflect the new test targets." ) + return packages + if __name__ == "__main__": fail_on_changes = len(sys.argv) == 2 and sys.argv[1] == "--fail-on-changes" diff --git a/scripts/update_integration_support.py b/scripts/update_integration_support.py new file mode 100644 index 0000000000..7c6d9955fc --- /dev/null +++ b/scripts/update_integration_support.py @@ -0,0 +1,52 @@ +""" +Find out what the actual minimum supported version of each framework/library is. +""" + +import os +import sys + +populate_tox_dir = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "populate_tox" +) +sys.path.append(populate_tox_dir) + +from populate_tox import main + + +def update(): + print("Running populate_tox.py...") + packages = main() + + print("Figuring out the lowest supported version of integrations...") + min_versions = [] + + for _, integrations in packages.items(): + for integration in integrations: + min_versions.append( + (integration["integration_name"], str(integration["releases"][0])) + ) + + min_versions = sorted( + set( + [ + (integration, tuple([int(v) for v in min_version.split(".")])) + for integration, min_version in min_versions + ] + ) + ) + + print() + print("Effective minimal versions:") + print( + "(The format is the same as _MIN_VERSIONS in sentry_sdk/integrations/__init__.py for easy replacing.)" + ) + print( + "(When updating these, make sure to also update the docs page for the integration.)" + ) + print() + for integration, min_version in min_versions: + print(f'"{integration}": {min_version},') + + +if __name__ == "__main__": + update() From 817f592ed7c7de4b6379121e214f58fd81892a23 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Fri, 26 Sep 2025 15:07:24 +0200 Subject: [PATCH 2/2] . --- scripts/update_integration_support.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/update_integration_support.py b/scripts/update_integration_support.py index 7c6d9955fc..7e686b2729 100644 --- a/scripts/update_integration_support.py +++ b/scripts/update_integration_support.py @@ -1,9 +1,10 @@ """ -Find out what the actual minimum supported version of each framework/library is. +Small utility to determine the actual minimum supported version of each framework/library. """ import os import sys +from textwrap import dedent populate_tox_dir = os.path.join( os.path.dirname(os.path.abspath(__file__)), "populate_tox" @@ -38,10 +39,12 @@ def update(): print() print("Effective minimal versions:") print( - "(The format is the same as _MIN_VERSIONS in sentry_sdk/integrations/__init__.py for easy replacing.)" - ) - print( - "(When updating these, make sure to also update the docs page for the integration.)" + dedent(""" + - The format is the same as _MIN_VERSIONS in sentry_sdk/integrations/__init__.py for easy replacing. + - When updating these, make sure to also update: + - The docs page for the integration + - The lower bounds in extras_require in setup.py + """) ) print() for integration, min_version in min_versions: