Update python_tag select to include python limited_api

This is needed after python/dist:dist's limited_api_wheels was updated from 3.7->3.8 and was causing us to mislabel the python_tag for our 3.8 limited api wheels as the system python version of 3.7.

Also:
* Add LINT to prevent next time
* Clean up some documentation
PiperOrigin-RevId: 621915013
pull/16414/head
Sandy Zhang 8 months ago committed by Copybara-Service
parent b0c4dfc5ee
commit ed965bd140
  1. 13
      python/dist/BUILD.bazel

@ -333,12 +333,17 @@ py_wheel(
"//conditions:default": "any",
}),
python_requires = ">=3.8",
# LINT.IfChange(python_tag)
python_tag = selects.with_or({
"//python:full_api_3.8": "cp38",
("//python:limited_api_3.8", "//python:full_api_3.8"): "cp38",
"//python:full_api_3.9": "cp39",
"//python:limited_api_3.10": "cp310",
"//conditions:default": "cp" + SYSTEM_PYTHON_VERSION,
}),
# LINT.ThenChange(
# :full_api_version,
# :limited_api_wheels,
# )
strip_path_prefixes = [
"python/dist/",
"python/",
@ -432,16 +437,19 @@ py_dist(
"win64",
],
# Windows needs version-specific wheels until 3.10.
# LINT.IfChange(full_api_version)
full_api_versions = [
"38",
"39",
],
# LINT.ThenChange(:python_tag)
# Limited API: these wheels will satisfy any Python version >= the
# given version.
#
# Technically the limited API doesn't have the functions we need until
# 3.10, but on Linux we can get away with using 3.7 (see ../python_api.h for
# 3.10, but on Linux we can get away with using 3.1+ (see ../python_api.h for
# details).
# LINT.IfChange(limited_api_wheels)
limited_api_wheels = {
"win32": "310",
"win64": "310",
@ -449,6 +457,7 @@ py_dist(
"linux-aarch_64": "38",
"osx-universal2": "38",
},
# LINT.ThenChange(:python_tag)
pure_python_wheel = ":pure_python_wheel",
tags = ["manual"],
)

Loading…
Cancel
Save