Skip to content

Commit

Permalink
[BugFix] Fix modification of sky/__init__.py when building sky whee…
Browse files Browse the repository at this point in the history
…ls (#2733)

* fix

* copy __init__ and simlink others

* Update sky/backends/wheel_utils.py

Co-authored-by: Zhanghao Wu <[email protected]>

* Update sky/backends/wheel_utils.py

Co-authored-by: Zhanghao Wu <[email protected]>

---------

Co-authored-by: Zhanghao Wu <[email protected]>
  • Loading branch information
cblmemo and Michaelvll authored Oct 23, 2023
1 parent a6c1375 commit 048f45a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sky/backends/wheel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ def _build_sky_wheel():
with tempfile.TemporaryDirectory() as tmp_dir:
# prepare files
tmp_dir = pathlib.Path(tmp_dir)
(tmp_dir / 'sky').symlink_to(SKY_PACKAGE_PATH, target_is_directory=True)
sky_tmp_dir = tmp_dir / 'sky'
sky_tmp_dir.mkdir()
for item in SKY_PACKAGE_PATH.iterdir():
target = sky_tmp_dir / item.name
if item.name != '__init__.py':
# We do not symlink `sky/__init__.py` as we need to
# modify the commit hash in the file later.
# Symlink other files/folders.
target.symlink_to(item, target_is_directory=item.is_dir())
setup_files_dir = SKY_PACKAGE_PATH / 'setup_files'

setup_content = (setup_files_dir / 'setup.py').read_text()
Expand Down

0 comments on commit 048f45a

Please sign in to comment.