Skip to content

Commit 6ee9eb4

Browse files
Merge pull request #97 from bcgsc/task/DEVSU-2797-mlemieux
Task/devsu 2797 mlemieux
2 parents 1219643 + 01e64fa commit 6ee9eb4

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
3636
- name: Check with black
3737
run: |
38-
pip install black
38+
pip install black==25.11.0
3939
black --check -S -l 100 pori_python tests
4040
- name: Full Tests with pytest
4141
run: |

.github/workflows/quick-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
3333
- name: Check with black
3434
run: |
35-
pip install black
35+
pip install black==25.11.0
3636
black --check -S -l 100 pori_python tests
3737
- name: Short Tests with pytest
3838
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov ipr --cov-report term --cov-report xml

pori_python/graphkb/util.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ def __init__(
125125
if username and password:
126126
self.login(username=username, password=password)
127127

128+
# URL check
129+
if not self.url:
130+
raise ValueError("URL to a GraphKB API instance is required")
131+
128132
@property
129133
def load(self) -> Optional[float]:
130134
if self.first_request and self.last_request:
@@ -252,6 +256,7 @@ def login(self, username: str, password: str, pori_demo: bool = False) -> None:
252256

253257
# KBDEV-1328. Alt. GraphKB login for GSC's PORI online demo
254258
if pori_demo or "pori-demo" in self.url:
259+
logger.warning("login demo")
255260
self.login_demo()
256261

257262
# use requests package directly to avoid recursion loop on login failure

pori_python/ipr/main.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,13 @@ def ipr_report(
419419
)
420420

421421
# GKB CONNECTION
422-
if graphkb_url:
423-
logger.info(f"connecting to graphkb: {graphkb_url}")
424-
graphkb_conn = GraphKBConnection(graphkb_url)
425-
else:
426-
graphkb_conn = GraphKBConnection()
427-
428-
gkb_user = graphkb_username if graphkb_username else username
429-
gkb_pass = graphkb_password if graphkb_password else password
422+
graphkb_conn = GraphKBConnection(graphkb_url) if graphkb_url else GraphKBConnection()
423+
logger.info(f"connecting to graphkb: {graphkb_conn.url}")
430424

431-
graphkb_conn.login(gkb_user, gkb_pass)
425+
graphkb_conn.login(
426+
graphkb_username if graphkb_username else username,
427+
graphkb_password if graphkb_password else password,
428+
)
432429

433430
# DISEASE
434431
# Disease term from bioapps; expected OncoTree term
@@ -502,7 +499,7 @@ def ipr_report(
502499

503500
if include_ipr_variant_text:
504501
if not ipr_conn:
505-
raise ValueError("ipr_url required to to include ipr variant text")
502+
raise ValueError("ipr_url required to include ipr variant text")
506503
ipr_comments = get_ipr_analyst_comments(
507504
ipr_conn,
508505
gkb_matches,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dev =
5454
mkdocs-redirects
5555
markdown-refdocs
5656
flake8
57-
black
57+
black==25.11.0 # black >25.11 requires python >=3.10
5858
flake8-annotations
5959
isort
6060
mypy

0 commit comments

Comments
 (0)