Update Python versions to reflect that we now support 3.8 through 3.11

PiperOrigin-RevId: 569317472
pull/14217/head
Adam Cozzette 1 year ago committed by Copybara-Service
parent 0c3f579e45
commit 8f831e973a
  1. 12
      protobuf_deps.bzl
  2. 34
      python/BUILD
  3. 17
      python/dist/BUILD.bazel
  4. 4
      python/dist/setup.py
  5. 8
      python/protobuf_distutils/setup.py
  6. 4
      python/py_extension.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",

@ -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(

@ -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"],

@ -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',
)

@ -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 '

@ -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"],

Loading…
Cancel
Save