Skip to content

Commit

Permalink
fix the --install arg doesn't work (keras-team#686)
Browse files Browse the repository at this point in the history
Co-authored-by: Haifeng Jin <[email protected]>
  • Loading branch information
2 people authored and fchollet committed Aug 9, 2023
1 parent 9345cba commit b14d0c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pip_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,29 @@ def build_and_save_output(root_path, __version__):
shutil.copy(fpath, dist_directory)

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


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

whl_path = None
try:
copy_source_to_build_directory(root_path)
run_namex_conversion()
create_legacy_directory()
from keras_core.src.version import __version__ # noqa: E402

export_version_string(__version__)
build_and_save_output(root_path, __version__)
return build_and_save_output(root_path, __version__)
finally:
# Clean up: remove the build directory (no longer needed)
shutil.rmtree(build_directory)
return whl_path


def install_whl(whl_fpath):
Expand Down

0 comments on commit b14d0c2

Please sign in to comment.