Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python 3.12] Deprecate distutil #34186

Merged
merged 14 commits into from
Sep 6, 2023

Conversation

XuanWang-Amos
Copy link
Contributor

@XuanWang-Amos XuanWang-Amos commented Aug 28, 2023

Background

  • distutils is deprecated with removal planned for Python 3.12 (pep-0632), thus we're trying to replace all distutils usage with setuptools.
  • Please note that user still have access to distutils if setuptools is installed and SETUPTOOLS_USE_DISTUTILS is set to local (The default in setuptools, more details can be found in this discussion).

How we decide the replacement

Replacement not mentioned in the guide

  • Replaced distutils.utils.get_platform() with sysconfig.get_platform().
    • Based on the answer here, and also checked the document that sysconfig.get_platform() is good enough for our use cases.
  • Replaced DistutilsOptionError with OptionError.
    • setuptools.error is exporting it as OptionError in the code.
  • Upgrade setuptools in test_packages.sh and changed the version ping to 59.6.0 in build_artifact_python.bat.
    • distutils.errors.* is not fully re-exported until 59.0.0 (See this issue for more details).

Changes not included in this PR

  • We're patching some compiler related functions provided by distutils in our code (example), but since setuptools doesn't have similar interface (See this issue for more details), we don't have a clear path to replace them yet.

@XuanWang-Amos XuanWang-Amos added the release notes: yes Indicates if PR needs to be in release notes label Aug 28, 2023
@XuanWang-Amos XuanWang-Amos changed the title [Test] Deprecate distutil [Python 3.12] Deprecate distutil Aug 31, 2023
@XuanWang-Amos XuanWang-Amos marked this pull request as ready for review August 31, 2023 22:09
@XuanWang-Amos XuanWang-Amos merged commit c7a1336 into grpc:master Sep 6, 2023
67 of 69 checks passed
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Sep 7, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 9, 2024
https://build.opensuse.org/request/show/1145435
by user anag+factory
- update to 1.60.1:
  * Revert change to print backtrace in server
- Update to version 1.60.0:
  * No python specfic changes.
- Add patches for embeeded xxhash 0.8.1 from SLE's xxhash package.
- Add xxhash-ppc64le-gcc7.patch: fix build failure on ppc64le
  when using gcc 7 (boo#1208794).
- add patch xxhash-avoid-armv6-unaligned-access.patch
  do not expect unaligned accesses to work on armv6, it breaks
  in our build setup using aarch64 kernels
- Update to version 1.59.2:
  * No python specific changes.
- Update to version 1.59.0:
  * [Python 3.12] Support Python 3.12 (gh#grpc/grpc#34398).
  * [Python 3.12] Deprecate distutil (gh#grpc/grpc#34186).
- Add minimum required versions for Cython, wheel and abseil-cpp.
- Update to version 1.58.0:
  * [Bazel] Enable grpcio-reflection to be used via
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bloat/none imported Specifies if the PR has been imported to the internal repository lang/Python per-call-memory/neutral per-channel-memory/neutral release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants