-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
good first issuep3-nice-to-haveIt should be done this or next sprintIt should be done this or next sprintrefactoringFactoring and re-factoringFactoring and re-factoring
Description
Some file utilities live in dvc.utils.fs while some other in dvc.utils.__init__. I suggest grouping them in a single place.
Also, some of them accept Path-like objects, i.e. Path, PurePath, PathInfo, etc and some do not. This makes people guess at the call site whether they need to wrap arguments into fspath(), fspath_py35() or none. So I propose that our file utilities will always accept that, this way we will concentrate those wrapper call in one place and remove the guessing part, at least for our own functions, calling os.path.*() will still need wrapping as long as we use Python 3.5-.
- move to
dvc.utils.fs(Fixed by Move fs utilities to fs.py from __init__.py #3093 ) - make Path-like objects aware (Fixed by Write test for
get_inode#2673 Verify ifget_mtime_and_sizecan take both Path objects and strings #2698 Ensurecontains_symlink_up_toaccept both str and Path-like objects #2740 Ensurefile_md5accept str and Path-like objects #2746 Ensurecopyfileaccepts str and Path-like objects #2752 Ensuremakedirsaccepts str and Path-like objects #2757 Ensuremoveaccepts str and Path-like objects #2769 Ensureremoveaccepts str and Path-like objects #2795 Write test fortmp_fnameto check if it accepts Path-like and str objects #2808 Write test forwalk_filesto check if it accepts Path-like and str objects #3035 Ensurerelpathaccepts str and Path-like objects #3037 )
efiop and algomaster99
Metadata
Metadata
Assignees
Labels
good first issuep3-nice-to-haveIt should be done this or next sprintIt should be done this or next sprintrefactoringFactoring and re-factoringFactoring and re-factoring