From 8f831e973a93a1c204abd27b545622ae1d82cae0 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 28 Sep 2023 16:10:31 -0700 Subject: [PATCH] Update Python versions to reflect that we now support 3.8 through 3.11 PiperOrigin-RevId: 569317472 --- protobuf_deps.bzl | 12 ++--------- python/BUILD | 34 ++++-------------------------- python/dist/BUILD.bazel | 17 ++++++--------- python/dist/setup.py | 4 ++-- python/protobuf_distutils/setup.py | 8 +++---- python/py_extension.bzl | 4 +--- 6 files changed, 19 insertions(+), 60 deletions(-) diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 0c2919c15b..d055eed8c6 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -151,16 +151,8 @@ def protobuf_deps(): # Python Downloads python_source_archive( - name = "python-3.7.0", - sha256 = "85bb9feb6863e04fb1700b018d9d42d1caac178559ffa453d7e6a436e259fd0d", - ) - python_nuget_package( - name = "nuget_python_i686_3.7.0", - sha256 = "a8bb49fa1ca62ad55430fcafaca1b58015e22943e66b1a87d5e7cef2556c6a54", - ) - python_nuget_package( - name = "nuget_python_x86-64_3.7.0", - sha256 = "66eb796a5bdb1e6787b8f655a1237a6b6964af2115b7627cf4f0032cf068b4b2", + name = "python-3.8.0", + sha256 = "f1069ad3cae8e7ec467aa98a6565a62a48ef196cb8f1455a245a08db5e1792df", ) python_nuget_package( name = "nuget_python_i686_3.8.0", diff --git a/python/BUILD b/python/BUILD index c1e044c013..6d8ba1c575 100644 --- a/python/BUILD +++ b/python/BUILD @@ -26,7 +26,7 @@ package( ) LIMITED_API_FLAG_SELECT = { - ":limited_api_3.7": ["-DPy_LIMITED_API=0x03070000"], + ":limited_api_3.8": ["-DPy_LIMITED_API=0x03080000"], ":limited_api_3.10": ["-DPy_LIMITED_API=0x030a0000"], "//conditions:default": [], } @@ -41,45 +41,19 @@ string_flag( build_setting_default = "system", values = [ "system", - "37", "38", "39", "310", + "311", ], ) config_setting( - name = "limited_api_3.7", + name = "limited_api_3.8", flag_values = { ":limited_api": "True", - ":python_version": "37", - }, -) - -config_setting( - name = "full_api_3.7_win32", - flag_values = { - ":limited_api": "False", - ":python_version": "37", - }, - values = {"cpu": "win32"}, -) - -config_setting( - name = "full_api_3.7_win64", - flag_values = { - ":limited_api": "False", - ":python_version": "37", + ":python_version": "38", }, - values = {"cpu": "win64"}, -) - -selects.config_setting_group( - name = "full_api_3.7", - match_any = [ - ":full_api_3.7_win32", - ":full_api_3.7_win64", - ], ) config_setting( diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index aa03fbe8ce..4330fe1c4f 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -296,7 +296,6 @@ genrule( py_wheel( name = "binary_wheel", abi = select({ - "//python:full_api_3.7": "cp37m", "//python:full_api_3.8": "cp38", "//python:full_api_3.9": "cp39", "//conditions:default": "abi3", @@ -306,10 +305,10 @@ py_wheel( classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], distribution = "protobuf", extra_distinfo_files = { @@ -328,9 +327,8 @@ py_wheel( ":windows_x86_64": "win_amd64", "//conditions:default": "any", }), - python_requires = ">=3.7", + python_requires = ">=3.8", python_tag = selects.with_or({ - ("//python:limited_api_3.7", "//python:full_api_3.7"): "cp37", "//python:full_api_3.8": "cp38", "//python:full_api_3.9": "cp39", "//python:limited_api_3.10": "cp310", @@ -362,10 +360,10 @@ py_wheel( classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], distribution = "protobuf", extra_distinfo_files = { @@ -374,7 +372,7 @@ py_wheel( homepage = "https://developers.google.com/protocol-buffers/", license = "3-Clause BSD License", platform = "any", - python_requires = ">=3.7", + python_requires = ">=3.8", python_tag = "py3", strip_path_prefixes = [ "python/", @@ -430,7 +428,6 @@ py_dist( ], # Windows needs version-specific wheels until 3.10. full_api_versions = [ - "37", "38", "39", ], @@ -444,9 +441,9 @@ py_dist( # TODO: fix win32 build "win32": "310", "win64": "310", - "linux-x86_64": "37", - "linux-aarch_64": "37", - "osx-universal2": "37", + "linux-x86_64": "38", + "linux-aarch_64": "38", + "osx-universal2": "38", }, pure_python_wheel = ":pure_python_wheel", tags = ["manual"], diff --git a/python/dist/setup.py b/python/dist/setup.py index b4fc21a55a..fc9095343a 100755 --- a/python/dist/setup.py +++ b/python/dist/setup.py @@ -56,10 +56,10 @@ setup( classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], namespace_packages=['google'], packages=find_packages(), @@ -76,5 +76,5 @@ setup( extra_link_args=extra_link_args, ) ], - python_requires='>=3.7', + python_requires='>=3.8', ) diff --git a/python/protobuf_distutils/setup.py b/python/protobuf_distutils/setup.py index f6a0d485df..52238aae5e 100644 --- a/python/protobuf_distutils/setup.py +++ b/python/protobuf_distutils/setup.py @@ -30,12 +30,10 @@ setup( # These Python versions should match the protobuf package: "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Software Development :: Code Generators", ], description=('This is a distutils extension to generate Python code for ' diff --git a/python/py_extension.bzl b/python/py_extension.bzl index 7b918bc78e..1de830fb20 100644 --- a/python/py_extension.bzl +++ b/python/py_extension.bzl @@ -27,9 +27,7 @@ def py_extension(name, srcs, copts, deps = [], **kwargs): linkshared = True, linkstatic = True, deps = deps + select({ - "//python:limited_api_3.7": ["@python-3.7.0//:python_headers"], - "//python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"], - "//python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"], + "//python:limited_api_3.8": ["@python-3.8.0//:python_headers"], "//python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"], "//python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"], "//python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"],