Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Sep 6, 2023
1 parent a823885 commit abfc781
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ jobs:
run: |
make flake8
continue-on-error: true
- name: black
run: |
make black
continue-on-error: true
- name: mypy
run: |
make mypy
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FILES=*.py

.PHONY: all
all: flake8 pylint mypy black
all: flake8 pylint mypy

.PHONY: flake8
flake8:
Expand All @@ -14,7 +14,3 @@ pylint:
.PHONY: mypy
mypy:
@mypy $(FILES)

.PHONY: black
black:
@black $(FILES)
27 changes: 14 additions & 13 deletions bugme.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
from dateutil import parser
from pytz import utc

from github import Github, Auth
from github import Github, Auth, GithubException
from bugzilla import Bugzilla # type: ignore
from bugzilla.exceptions import BugzillaError # type: ignore

CREDENTIALS_FILE = os.path.expanduser("./creds.json")

Expand Down Expand Up @@ -56,23 +57,23 @@ def main() -> None:
creds = json.load(file)

# Bugzilla
mybsc = Bugzilla(
"https://bugzilla.suse.com", force_rest=True, **creds["bugzilla.suse.com"]
)
for bsc in mybsc.getbugs(bsc_list):
print(
f"bsc#{bsc.id}\t{bsc.status}\t{dateit(bsc.last_change_time)}\t{bsc.summary}"
)
mybsc.disconnect()
try:
mybsc = Bugzilla("https://bugzilla.suse.com", force_rest=True, **creds["bugzilla.suse.com"])
for bsc in mybsc.getbugs(bsc_list):
print(f"bsc#{bsc.id}\t{bsc.status}\t{dateit(bsc.last_change_time)}\t{bsc.summary}")
mybsc.disconnect()
except BugzillaError as exc:
print(f"bsc#{bsc.id}: {exc}")

# Github
auth = Auth.Token(**creds["github.com"])
mygh = Github(auth=auth)
for issue in gh_list:
info = mygh.get_repo(issue.repo).get_issue(issue.number)
print(
f"gh#{info.number}\t{info.state}\t{dateit(info.last_modified)}\t{info.title}"
)
try:
info = mygh.get_repo(issue.repo).get_issue(issue.number)
print(f"gh#{info.number}\t{info.state}\t{dateit(info.last_modified)}\t{info.title}")
except GithubException as exc:
print(f"gh#{issue.repo}#{issue.number}: {exc}", file=sys.stderr)


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r requirements.txt

black
flake8
pylint
mypy
Expand Down

0 comments on commit abfc781

Please sign in to comment.