1# Copyright 2024 gRPC authors. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14"""Buildgen python version plugin 15 16This parses the list of supported python versions from the yaml build file, and 17creates custom strings for the minimum and maximum supported python versions. 18 19""" 20 21 22def mako_plugin(dictionary): 23 """Expand version numbers: 24 - for each language, ensure there's a language_version tag in 25 settings (defaulting to the master version tag) 26 - expand version strings to major, minor, patch, and tag 27 """ 28 29 settings = dictionary["settings"] 30 31 supported_python_versions = settings["supported_python_versions"] 32 settings["min_python_version"] = supported_python_versions[0] 33 settings["max_python_version"] = supported_python_versions[-1] 34