Commit 06d2360
committed
Delay imports of non-stdlib dependencies until time of use
This is a bit of a hack, but we do this to ensure that when setuptools
loads entrypoint based hooks it cannot (will not?) crash.
The issue is that setuptools plugins are autoloaded, whether any given
project uses them at all or not. So if setuptools-rust is installed,
setuptools always tries to use it, and crashes if setuptools-rust is
broken.
Of course, setuptools-rust can't be broken, because it's a wonderful
project.
BUT.
As it happens, third-party vendors providing setuptools-rust can get
into a situation where multiple packages need to be installed, including
setuptools-rust, and also build yet other packages from source. In the
middle of this, setuptools-rust itself could be installed but in
"half-configured" state, i.e. its dependencies were queued for
afterwards due to complicated dependency graph magic.
In such a scenario, it should be nominally all right to have an inert
package installed, since if nothing actually uses setuptools-rust it
doesn't need to *work* yet. And in fact, it is all right, as long as
setuptools can import the autoloaded plugin hooks (and do nothing with
them).
Bug: https://bugs.gentoo.org/9335531 parent d7868df commit 06d2360
2 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | | - | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments