Skip to content

Commit 76c5ad2

Browse files
committed
exp: attempt to patch setuptools
1 parent f13c4e9 commit 76c5ad2

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

python/pip_install/repositories.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ def pip_install_dependencies():
138138
(However we call it from pip_install, making it optional for users to do so.)
139139
"""
140140

141+
_extra_args = {
142+
"pypi__setuptools": {
143+
"patch_args": ["-p1"],
144+
"patches": [
145+
Label("//python/private:setuptools.patch"),
146+
],
147+
},
148+
}
149+
141150
# We only support Bazel LTS and rolling releases.
142151
# Give the user an obvious error to upgrade rather than some obscure missing symbol later.
143152
# It's not guaranteed that users call this function, but it's used by all the pip fetch
@@ -152,4 +161,5 @@ def pip_install_dependencies():
152161
sha256 = sha256,
153162
type = "zip",
154163
build_file_content = _GENERIC_WHEEL,
164+
**_extra_args.get(name, {})
155165
)

python/private/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ bzl_library(
9696
exports_files(
9797
[
9898
"coverage.patch",
99+
"setuptools.patch",
99100
"py_package.bzl",
100101
"py_wheel.bzl",
101102
"reexports.bzl",

python/private/setuptools.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/setuptools/_distutils/dist.py b/setuptools/_distutils/dist.py
2+
index 7c0f0e5b..88ae7716 100644
3+
--- a/setuptools/_distutils/dist.py
4+
+++ b/setuptools/_distutils/dist.py
5+
@@ -270,7 +270,7 @@ Common commands: (see '--help-commands' for more)
6+
# If attrs['script_args'] wasn't passed, assume false.
7+
#
8+
# This also make sure we just look at the global options
9+
- self.want_user_cfg = True
10+
+ self.want_user_cfg = False
11+
12+
if self.script_args is not None:
13+
for arg in self.script_args:

0 commit comments

Comments
 (0)