8000 fix: `util.move_file` shall not use `log.notice` (#1862) · pypa/cibuildwheel@c37e5a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c37e5a2

Browse files
authored
fix: util.move_file shall not use log.notice (#1862)
Using `log.notice` result in many unwanted annotations, at least in GitHub Actions. If we want to print some information about a specific file being moved, it shall be done by the caller - or adding an option to the function - and use `print`.
1 parent 130fdd2 commit c37e5a2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cibuildwheel/util.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,7 @@ def move_file(src_file: Path, dst_file: Path) -> Path:
375375
NotADirectoryError: If any part of the intermediate path to `dst_file` is an existing file
376376
IsADirectoryError: If `dst_file` points directly to an existing directory
377377
"""
378-
379-
# Importing here as logger needs various functions from util -> circular imports
380-
from .logger import log
381-
382-
src_file = src_file.resolve()
378+
src_file = src_file.resolve(strict=True)
383379
dst_file = dst_file.resolve()
384380

385381
if dst_file.is_dir():
@@ -391,9 +387,7 @@ def move_file(src_file: Path, dst_file: Path) -> Path:
391387
# using shutil.move() as Path.rename() is not guaranteed to work across filesystem boundaries
392388
# explicit str() needed for Python 3.8
393389
resulting_file = shutil.move(str(src_file), str(dst_file))
394-
resulting_file = Path(resulting_file).resolve()
395-
log.notice(f"Moved {src_file} to {resulting_file}")
396-
return Path(resulting_file)
390+
return Path(resulting_file).resolve(strict=True)
397391

398392

399393
class DependencyConstraints:

0 commit comments

Comments
 (0)
0