Commit 85e50d2
authored
fix: py_proto_library: append to PYTHONPATH less (#1553)
Only append the `[proto_root]` to PYTHONPATH when it's actually
necessary, i.e. when the generated Python modules are under
_virtual_imports. Do no append it in the general case, when
`[proto_root]` is just the repository root.
This makes it much less likely that adding a transitive dep on a
`py_proto_library` will reorder the `PYTHONPATH`. Such reordering is
undesirable because it may lead to import errors.
Fixes #15511 parent 793e26b commit 85e50d2
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
0 commit comments