-
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.api: doesn't work with repo with SSH URL #3111
Comments
p.s. If I try the HTTP URL it throws a different error: That it can't find the repo. |
Caused by Lines 64 to 71 in 8787ac0
An ugly patch would be to do: diff --git a/dvc/api.py b/dvc/api.py
index ffb044a0..ce9f3b44 100644
--- a/dvc/api.py
+++ b/dvc/api.py
@@ -87,7 +87,7 @@ def read(path, repo=None, rev=None, remote=None, mode="r", encoding=None):
@contextmanager
def _make_repo(repo_url, rev=None):
- if not repo_url or urlparse(repo_url).scheme == "":
+ if not repo_url or (urlparse(repo_url).scheme == "" and not urlparse(repo_url).path.startswith('git@')):
assert rev is None, "Custom revision is not supported for local repo"
yield Repo(repo_url)
else: |
Need to research the correct way to parse those Git URLs. |
https://github.com/coala/git-url-parse looks good 👌 EDIT: It doesn't work thaaat well, it has some issues parsing local URL's and |
We might want to always use |
This issue also affects public GH repo accessed through SSH URL, and not just So, the following throws import dvc.api
url = dvc.api.get_url("get-started/data.xml", repo="[email protected]:iterative/dataset-registry") |
@jorgeorpinel, I renamed the title, to reflect that it affects all public apis for all SSH urls. 🙂 |
This script
Throws
It looks like it's trying to use my cwd
.
as the repo (and I'm not working from a DVC repo).The text was updated successfully, but these errors were encountered: