Skip to content

Commit

Permalink
Update Python versions to reflect that we now support 3.8 through 3.11
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 569317472
  • Loading branch information
acozzette authored and copybara-github committed Sep 28, 2023
1 parent 0c3f579 commit 8f831e9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 60 deletions.
12 changes: 2 additions & 10 deletions protobuf_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
34 changes: 4 additions & 30 deletions python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
}
Expand All @@ -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(
Expand Down
17 changes: 7 additions & 10 deletions python/dist/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 = {
Expand All @@ -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",
Expand Down Expand Up @@ -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 = {
Expand All @@ -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/",
Expand Down Expand Up @@ -430,7 +428,6 @@ py_dist(
],
# Windows needs version-specific wheels until 3.10.
full_api_versions = [
"37",
"38",
"39",
],
Expand All @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions python/dist/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def GetVersion():
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(),
Expand All @@ -76,5 +76,5 @@ def GetVersion():
extra_link_args=extra_link_args,
)
],
python_requires='>=3.7',
python_requires='>=3.8',
)
8 changes: 3 additions & 5 deletions python/protobuf_distutils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
# 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 '
Expand Down
4 changes: 1 addition & 3 deletions python/py_extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 8f831e9

Please sign in to comment.