Files
grpc/tools/buildgen/plugins/expand_supported_python_versions.py
Ashesh Vidyut d312b25f71 [Python] Upgrade black (#39774)
### Description

* Upgrade Black to use the latest version. [Pypi-Black (25.1.0)](https://pypi.org/project/black/)
* Run `black` to reformat files to make the sanity tests pass in CI

**Note - all the file changes are by `black` command** except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

### Testing
CI

Closes #39774

PiperOrigin-RevId: 769640677
2025-06-10 08:24:10 -07:00

34 lines
1.2 KiB
Python

# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Buildgen python version plugin
This parses the list of supported python versions from the yaml build file, and
creates custom strings for the minimum and maximum supported python versions.
"""
def mako_plugin(dictionary):
"""Expand version numbers:
- for each language, ensure there's a language_version tag in
settings (defaulting to the master version tag)
- expand version strings to major, minor, patch, and tag
"""
settings = dictionary["settings"]
supported_python_versions = settings["supported_python_versions"]
settings["min_python_version"] = supported_python_versions[0]
settings["max_python_version"] = supported_python_versions[-1]