Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check with black
run: |
pip install black
pip install black==25.11.0
black --check -S -l 100 pori_python tests
- name: Full Tests with pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quick-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check with black
run: |
pip install black
pip install black==25.11.0
black --check -S -l 100 pori_python tests
- name: Short Tests with pytest
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov ipr --cov-report term --cov-report xml
Expand Down
5 changes: 5 additions & 0 deletions pori_python/graphkb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def __init__(
if username and password:
self.login(username=username, password=password)

# URL check
if not self.url:
raise ValueError("URL to a GraphKB API instance is required")

@property
def load(self) -> Optional[float]:
if self.first_request and self.last_request:
Expand Down Expand Up @@ -252,6 +256,7 @@ def login(self, username: str, password: str, pori_demo: bool = False) -> None:

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

# use requests package directly to avoid recursion loop on login failure
Expand Down
17 changes: 7 additions & 10 deletions pori_python/ipr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,13 @@ def ipr_report(
)

# GKB CONNECTION
if graphkb_url:
logger.info(f"connecting to graphkb: {graphkb_url}")
graphkb_conn = GraphKBConnection(graphkb_url)
else:
graphkb_conn = GraphKBConnection()

gkb_user = graphkb_username if graphkb_username else username
gkb_pass = graphkb_password if graphkb_password else password
graphkb_conn = GraphKBConnection(graphkb_url) if graphkb_url else GraphKBConnection()
logger.info(f"connecting to graphkb: {graphkb_conn.url}")

graphkb_conn.login(gkb_user, gkb_pass)
graphkb_conn.login(
graphkb_username if graphkb_username else username,
graphkb_password if graphkb_password else password,
)

# DISEASE
# Disease term from bioapps; expected OncoTree term
Expand Down Expand Up @@ -502,7 +499,7 @@ def ipr_report(

if include_ipr_variant_text:
if not ipr_conn:
raise ValueError("ipr_url required to to include ipr variant text")
raise ValueError("ipr_url required to include ipr variant text")
ipr_comments = get_ipr_analyst_comments(
ipr_conn,
gkb_matches,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dev =
mkdocs-redirects
markdown-refdocs
flake8
black
black==25.11.0 # black >25.11 requires python >=3.10
flake8-annotations
isort
mypy
Expand Down