Skip to content

Commit e2c13db

Browse files
nicholasjngdmah42
andauthored
Fix editable install by unsetting build_ext.copy_extensions_to_source (google#1710)
This method was the culprit for the recent editable install breakage, since it just tries to copy the generated extension file without checking its existence. Since the `BazelExtension` uses a non-standard location to store the build artifacts, calling the copy method fails the build since the extension is not found in the expected location. But, since we already copy the file into the source tree as part of the `BazelExtension.bazel_build` method, it's fine - the extension appears in the right place, and the egg info is generated correctly as well. This method also does not affect the general install, so it solves the editable problem without regressing the fixed install. Co-authored-by: dominic <[email protected]>
1 parent 5056098 commit e2c13db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setup.py

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ def run(self):
5757
# explicitly call `bazel shutdown` for graceful exit
5858
self.spawn(["bazel", "shutdown"])
5959

60+
def copy_extensions_to_source(self):
61+
"""
62+
Copy generated extensions into the source tree.
63+
This is done in the ``bazel_build`` method, so it's not necessary to
64+
do again in the `build_ext` base class.
65+
"""
66+
pass
67+
6068
def bazel_build(self, ext: BazelExtension) -> None:
6169
"""Runs the bazel build to create the package."""
6270
with temp_fill_include_path("WORKSPACE"):

0 commit comments

Comments
 (0)