Skip to content

Commit ece7c67

Browse files
authored
fix the --install arg doesn't work (#686)
Co-authored-by: Haifeng Jin <[email protected]>
1 parent 34a0388 commit ece7c67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pip_build.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -156,29 +156,29 @@ def build_and_save_output(root_path, __version__):
156156
shutil.copy(fpath, dist_directory)
157157

158158
# Find the .whl file path
159+
whl_path = None
159160
for fname in os.listdir(dist_directory):
160161
if __version__ in fname and fname.endswith(".whl"):
161162
whl_path = os.path.abspath(os.path.join(dist_directory, fname))
162163
print(f"Build successful. Wheel file available at {whl_path}")
164+
return whl_path
163165

164166

165167
def build(root_path):
166168
if os.path.exists(build_directory):
167169
raise ValueError(f"Directory already exists: {build_directory}")
168170

169-
whl_path = None
170171
try:
171172
copy_source_to_build_directory(root_path)
172173
run_namex_conversion()
173174
create_legacy_directory()
174175
from keras_core.src.version import __version__ # noqa: E402
175176

176177
export_version_string(__version__)
177-
build_and_save_output(root_path, __version__)
178+
return build_and_save_output(root_path, __version__)
178179
finally:
179180
# Clean up: remove the build directory (no longer needed)
180181
shutil.rmtree(build_directory)
181-
return whl_path
182182

183183

184184
def install_whl(whl_fpath):

0 commit comments

Comments
 (0)