Skip to content

[Python] Update setuptools min version to 77.0.1 #40931

Closed
sreenithi wants to merge 6 commits intogrpc:masterfrom
sreenithi:update_setuptools_version
Closed

[Python] Update setuptools min version to 77.0.1 #40931
sreenithi wants to merge 6 commits intogrpc:masterfrom
sreenithi:update_setuptools_version

Conversation

@sreenithi
Copy link
Contributor

@sreenithi sreenithi commented Oct 21, 2025

This PR updates the minimum version of setuptools package required across different Python setup files to v77.0.1. This version contains Python 3.14 support as well as deprecates a format for defining project license in pyproject.toml files (Reference) which is a prerequisite for #40833

@sergiitk sergiitk self-assigned this Oct 21, 2025
@sreenithi sreenithi linked an issue Oct 22, 2025 that may be closed by this pull request

def build_extensions(self):

use_short_temp = os.environ.get("GRPC_USE_SHORT_BUILD_TEMP", 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use something but more discrete

Suggested change
use_short_temp = os.environ.get("GRPC_USE_SHORT_BUILD_TEMP", 0)
use_short_temp = os.environ.get("GRPC_PYTHON_BUILD_USE_SHORT_TEMP_DIR_NAME", 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

def build_extensions(self):

use_short_temp = os.environ.get("GRPC_USE_SHORT_BUILD_TEMP", 0)
if use_short_temp:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that when the env var explicitly is set to 0, it'll be parsed as string "0", which means this condition is resolved to true. Instead, do

Suggested change
if use_short_temp:
if use_short_temp == "1":
In [2]: "0" or 123
Out[2]: '0'

In [3]: 0 or 123
Out[3]: 123

In [4]: bool("0")
Out[4]: True

In [5]: bool("")
Out[5]: False

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good catch, thanks. I had only considered setting to 1 and leaving it unset, but hadn't considered the case for setting the value to '0'. Changed now.

Copy link
Member

@sergiitk sergiitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for export, but please address the feedback

sreenithi added a commit to sreenithi/grpc that referenced this pull request Oct 24, 2025
This PR updates the minimum version of `setuptools` package required across different Python setup files to v77.0.1. This version contains Python 3.14 support as well as deprecates a format for defining project license in `pyproject.toml` files ([Reference](https://setuptools.pypa.io/en/stable/history.html#id71)) which is a prerequisite for grpc#40833

Closes grpc#40931

PiperOrigin-RevId: 823008815
@sreenithi sreenithi added the release notes: no Indicates if PR should not be in release notes label Oct 24, 2025
Copy link
Member

@sergiitk sergiitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job addressing my feedback, thank you!

@sergiitk sergiitk added release notes: yes Indicates if PR needs to be in release notes and removed release notes: no Indicates if PR should not be in release notes labels Oct 24, 2025
sergiitk pushed a commit that referenced this pull request Oct 27, 2025
…40953)

Backport of #40931 to v1.76.x.
---
This PR updates the minimum version of `setuptools` package required
across different Python setup files to v77.0.1. This version contains
Python 3.14 support as well as deprecates a format for defining project
license in `pyproject.toml` files
([Reference](https://setuptools.pypa.io/en/stable/history.html#id71))
which is a prerequisite for #40833
sreenithi added a commit to sreenithi/grpc that referenced this pull request Nov 26, 2025
This PR updates the minimum version of `setuptools` package required across different Python setup files to v77.0.1. This version contains Python 3.14 support as well as deprecates a format for defining project license in `pyproject.toml` files ([Reference](https://setuptools.pypa.io/en/stable/history.html#id71)) which is a prerequisite for grpc#40833

Closes grpc#40931

PiperOrigin-RevId: 823008815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants