Skip to content

Commit

Permalink
1.1.3 Tentative fix for errors with github remote failing
Browse files Browse the repository at this point in the history
  • Loading branch information
PonteIneptique committed Nov 19, 2023
1 parent a810487 commit 41ed093
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion htruc/repos/_github.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional, Dict, Any, Iterable
import re

import github
from ruamel.yaml import YAML, parser
from github import Github
from github.GithubException import UnknownObjectException
Expand All @@ -22,12 +24,15 @@ def get_github_repo_yaml(
if repo_name.endswith(".git"):
repo_name = repo_name[:-4]
g = Github(access_token)
repo = g.get_repo(f"{user}/{repo_name}")
try:
repo = g.get_repo(f"{user}/{repo_name}")
text = repo.get_contents("htr-united.yml").decoded_content.decode()
print("--- Found htr-united.yml")
except UnknownObjectException as e:
return None
except github.GithubException as e:
return None

try:
return parse_yaml(text)
except parser.ParserError:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
URL = 'https://github.com/htr-united/htrvc'
AUTHOR = 'Thibault Clérice'
REQUIRES_PYTHON = '>=3.8.0'
VERSION = "1.1.2"
VERSION = "1.1.3"

# What packages are required for this module to be executed?

Expand Down

0 comments on commit 41ed093

Please # to comment.