From ed965bd14089404369fbd3091d17be1c250c12b1 Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Thu, 4 Apr 2024 11:12:29 -0700 Subject: [PATCH] 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 --- python/dist/BUILD.bazel | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index 1abe0bf4ae..265d9b8851 100644 --- a/python/dist/BUILD.bazel +++ b/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"], )