-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvc: replace pkg concept with external repo #2160
Conversation
1951506
to
278b9f7
Compare
628b3e4
to
f675e72
Compare
Signed-off-by: Ruslan Kuprieiev <[email protected]>
return | ||
|
||
try: | ||
os.makedirs(self.repos_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not compat makedirs?
# | ||
# Note that tempfile.TemporaryDirectory is using symlinks to tmpfs, so | ||
# we won't be able to use move properly. | ||
tmp_dir = os.path.join(self.repos_dir, "." + str(uuid.uuid4())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to use pathlib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, our Repo and other stuff are not meant to be used with it.
cache_config.set_dir(cache_dir, level=Config.LEVEL_LOCAL) | ||
repo.scm.git.close() | ||
|
||
if self.installed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be probably part of the def install
formatter_class=argparse.RawDescriptionHelpFormatter, | ||
) | ||
get_parser.add_argument( | ||
"url", help="See `dvc import-url -h` for full list of supported URLs." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import-url -> get-url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it's intentional, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
src = os.path.abspath(url) | ||
out = os.path.abspath(out) | ||
|
||
dep, = dependency.loads_from(None, [src]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it support remote:// protocol? it needs to read a global config for that, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't, at least for now. get-url
doesn't care about Repo's at all. I would keep it this way untill someone asks for this feature.
out = out or os.path.basename(urlparse(url).path) | ||
|
||
if os.path.exists(url): | ||
src = os.path.abspath(url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src is undefined if not os.path.exists(url)
and is referenced below
Signed-off-by: Ruslan Kuprieiev <[email protected]>
what about backwards compatibility, @efiop ? |
@MrOutis We do let them know with a warning in dvc/command/imp.py. |
True, @efiop 👍 |
Hey guys, I just tripped all over this when running our tutorial at https://dagshub.com/docs/pipeline/ |
I would also consider people who may have written shell scripts with |
@guysmoilov Thanks for the feedback! We've decided to rename it so that a more powerful repo-import feature would have a better name(we've also introduced new As to docs, we are working on it right now. We've decided to do a release anyway, because there were a lot of important features/bugfixes stacked up already. Also we felt like we were ready to collect some feedback about new features. |
Agree, @guysmoilov ! @efiop , maybe writing something in the #announcements channel on Discord? |
@shcheklein just did it 😅 |
@MrOutis @efiop I have posted an announcement. @guysmoilov sorry for the confusion and inconvenience :( It was not an easy decision.I really hope that you will try the new set of commands that are in a preview mode - As for the documentation update - it's in progress. Import will be renamed in a few hours. |
Probably too late but I agree with Guy. Reusing a previous command name for a similar feature as before seems really confusing and unnecessary. There's an endless number of other words that could've been used. Anyway, probably not the end of the world and I'm sure there was a deep discussion about it and good reasons to do it so, moving on... Working on the full doc updates in PR iterative/dvc.org#464 |
dvc import
is now renamed todvc import-url
.dvc pkg import
renamed intodvc import
anddvc pkg get
intodvc get
. Also, for symmetry, introduceddvc get-url
. Along with some other minor modifications. The workflow now looks like:Signed-off-by: Ruslan Kuprieiev [email protected]
Have you followed the guidelines in our
Contributing document?
Does your PR affect documented changes or does it add new functionality
that should be documented? If yes, have you created a PR for
dvc.org documenting it or at
least opened an issue for it? If so, please add a link to it.