Debian Codegraph @

debian/patches/setup.py-no-pkg_resources.patch

raw
1 Description: setup.py: do not use pkg_resources
2 The pkg_resources API was dropped in setuptools v82.
3 It was only used in grpc when building for Mac OS, so it
4 is safe to drop the import and call for Debian.
5 Author: Theodore Tucker <[email protected]>
6 Bug-Debian: https://bugs.debian.org/1147772
7 Forwarded: not-needed
8 Last-Update: 2026-09-28
9 ---
10
11
12 --- ./setup.py
13 +++ ./setup.py
14 @@ -40,7 +40,6 @@ import sys
15 import sysconfig
16
17 import _metadata
18 -import pkg_resources
19 from setuptools.command import egg_info
20
21 # Redirect the manifest template from MANIFEST.in to PYTHON-MANIFEST.in.
22 @@ -419,20 +418,6 @@ if "linux" in sys.platform or "darwin" i
23 DEFINE_MACROS += (('PyMODINIT_FUNC', pymodinit),)
24 DEFINE_MACROS += (('GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK', 1),)
25
26 -# By default, Python3 distutils enforces compatibility of
27 -# c plugins (.so files) with the OSX version Python was built with.
28 -# We need OSX 10.10, the oldest which supports C++ thread_local.
29 -# Python 3.9: Mac OS Big Sur sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') returns int (11)
30 -if 'darwin' in sys.platform:
31 - mac_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
32 - if mac_target:
33 - mac_target = pkg_resources.parse_version(str(mac_target))
34 - if mac_target < pkg_resources.parse_version('10.10.0'):
35 - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.10'
36 - os.environ['_PYTHON_HOST_PLATFORM'] = re.sub(
37 - r'macosx-[0-9]+\.[0-9]+-(.+)', r'macosx-10.10-\1',
38 - util.get_platform())
39 -
40
41 def cython_extensions_and_necessity():
42 cython_module_files = [