Skip to content

Commit

Permalink
dev(narugo): okay
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed Dec 28, 2023
1 parent 3351dab commit 5a74e8f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions skpick/online.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def online_pick(src_repo: str, dst_repo: str):
dst_packages = [item['filename'] for item in dst_index]

for package in tqdm(natsorted(set(src_packages) - set(dst_packages))):
with TemporaryDirectory() as td_src, TemporaryDirectory() as td_dst, TemporaryDirectory() as td_doc:
zip_file = os.path.join(td_src, package)
o_td_src = TemporaryDirectory()
with TemporaryDirectory() as td_dst, TemporaryDirectory() as td_doc:
zip_file = os.path.join(o_td_src.name, package)
download_file_to_file(
local_file=zip_file,
repo_id=src_repo,
Expand All @@ -45,7 +46,7 @@ def online_pick(src_repo: str, dst_repo: str):
)

pick_from_package(zip_file, td_dst)
td_src.cleanup()
o_td_src.cleanup()
upload_directory_as_archive(
local_directory=td_dst,
repo_id=dst_repo,
Expand Down

0 comments on commit 5a74e8f

Please sign in to comment.