From 3105260ce5803783f8ef18b6d3ae87c065e6f8e4 Mon Sep 17 00:00:00 2001 From: Jack McCluskey <34928439+jrmccluskey@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:54:39 -0400 Subject: [PATCH] Warn when using Beam with Python 3.8 (#32484) * Warn when using Beam with Python 3.8 * Call out in CHANGES.md * formatting --- CHANGES.md | 2 ++ sdks/python/apache_beam/__init__.py | 6 ++++++ sdks/python/setup.py | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b936ba6dda302..d58ceffeb411a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -82,6 +82,8 @@ ## Deprecations * X behavior is deprecated and will be removed in X versions ([#X](https://github.com/apache/beam/issues/X)). +* Python 3.8 is reaching EOL and support is being removed in Beam 2.61.0. The 2.60.0 release will warn users +when running on 3.8. ([#31192](https://github.com/apache/beam/issues/31192)) ## Bugfixes diff --git a/sdks/python/apache_beam/__init__.py b/sdks/python/apache_beam/__init__.py index 27c2b293fbd02..6e08083bc0de8 100644 --- a/sdks/python/apache_beam/__init__.py +++ b/sdks/python/apache_beam/__init__.py @@ -75,6 +75,12 @@ 'This version of Apache Beam has not been sufficiently tested on ' 'Python %s.%s. You may encounter bugs or missing features.' % (sys.version_info.major, sys.version_info.minor)) + elif sys.version_info.minor == 8: + warnings.warn( + 'Python 3.8 reaches EOL in October 2024 and support will ' + 'be removed from Apache Beam in version 2.61.0. See ' + 'https://github.com/apache/beam/issues/31192 for more ' + 'information.') pass else: raise RuntimeError( diff --git a/sdks/python/setup.py b/sdks/python/setup.py index 216694168902c..ddd7bfea52c88 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -278,6 +278,11 @@ def get_portability_package_data(): 'This version of Apache Beam has not been sufficiently tested on ' 'Python %s.%s. You may encounter bugs or missing features.' % (sys.version_info.major, sys.version_info.minor)) +elif sys.version_info.major == 3 and sys.version_info.minor == 8: + warnings.warn('Python 3.8 reaches EOL in October 2024 and support will ' + 'be removed from Apache Beam in version 2.61.0. See ' + 'https://github.com/apache/beam/issues/31192 for more ' + 'information.') if __name__ == '__main__': # In order to find the tree of proto packages, the directory