Skip to content

Commit

Permalink
fix new mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Nov 10, 2019
1 parent c20b1dd commit 6faa57e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nur/prefetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def prefetch_git(repo: Repo) -> Tuple[LockedVersion, Path]:
cmd += [repo.url.geturl()]
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode != 0:
stderr = result.stderr.decode("utf-8")
raise NurError(
f"Failed to prefetch git repository {repo.url.geturl()}: {result.stderr}"
f"Failed to prefetch git repository {repo.url.geturl()}: {stderr}"
)

metadata = json.loads(result.stdout)
Expand Down Expand Up @@ -104,7 +105,9 @@ def prefetch_github(repo: Repo) -> Tuple[LockedVersion, Optional[Path]]:

def prefetch_gitlab(repo: Repo) -> Tuple[LockedVersion, Optional[Path]]:
gitlab_path = Path(repo.url.path)
gl_repo = GitlabRepo(repo.url.hostname, list(gitlab_path.parts[1:]))
hostname = repo.url.hostname
assert hostname is not None, f"Expect a hostname for Gitlab repo: {repo.name}"
gl_repo = GitlabRepo(hostname, list(gitlab_path.parts[1:]))
commit = gl_repo.latest_commit()
locked_version = repo.locked_version
if locked_version is not None:
Expand Down

0 comments on commit 6faa57e

Please sign in to comment.