diff --git a/pori_python/__init__.py b/pori_python/__init__.py index 71a12b1..d0e29c9 100644 --- a/pori_python/__init__.py +++ b/pori_python/__init__.py @@ -1 +1 @@ -from . import graphkb, ipr +from . import graphkb, ipr # noqa: F401 diff --git a/pori_python/graphkb/genes.py b/pori_python/graphkb/genes.py index cc71ce6..c65c9c7 100644 --- a/pori_python/graphkb/genes.py +++ b/pori_python/graphkb/genes.py @@ -226,11 +226,9 @@ def get_preferred_gene_name( def get_cancer_predisposition_info( conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE ) -> Tuple[List[str], Dict[str, str]]: - newval = get_gene_linked_cancer_predisposition_info(conn, source) - genes = newval[0] - allvardata = newval[1] + genes, allvardata = get_gene_linked_cancer_predisposition_info(conn, source) variants = {key: allvardata[key][0] for key in allvardata.keys()} - return newval[0], variants + return genes, variants def get_gene_linked_cancer_predisposition_info( @@ -322,11 +320,9 @@ def get_gene_linked_cancer_predisposition_info( def get_pharmacogenomic_info( conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE ) -> Tuple[List[str], Dict[str, str]]: - newval = get_gene_linked_pharmacogenomic_info(conn, source) - genes = newval[0] - allvardata = newval[1] + genes, allvardata = get_gene_linked_pharmacogenomic_info(conn, source) variants = {key: allvardata[key][0] for key in allvardata.keys()} - return newval[0], variants + return genes, variants def get_gene_linked_pharmacogenomic_info( diff --git a/pori_python/graphkb/util.py b/pori_python/graphkb/util.py index 5e46a7a..e7e6123 100644 --- a/pori_python/graphkb/util.py +++ b/pori_python/graphkb/util.py @@ -1,6 +1,5 @@ import requests from requests.adapters import HTTPAdapter -from requests.packages.urllib3.util.retry import Retry import hashlib import json @@ -9,6 +8,7 @@ import time from datetime import datetime from typing import Any, Dict, Iterable, List, Optional, Union, cast +from urllib3.util.retry import Retry from .constants import DEFAULT_LIMIT, DEFAULT_URL, TYPES_TO_NOTATION, AA_3to1_MAPPING from .types import OntologyTerm, ParsedVariant, PositionalVariant, Record diff --git a/pori_python/ipr/main.py b/pori_python/ipr/main.py index eb9aa4c..c140dc4 100644 --- a/pori_python/ipr/main.py +++ b/pori_python/ipr/main.py @@ -463,7 +463,7 @@ def ipr_report( if ipr_upload: try: logger.info(f"Uploading to IPR {ipr_conn.url}") - ipr_result = ipr_conn.upload_report(output, async_upload, mins_to_wait) + ipr_result = ipr_conn.upload_report(output, mins_to_wait, async_upload) logger.info(ipr_result) output.update(ipr_result) except Exception as err: diff --git a/tests/test_graphkb/test_statement.py b/tests/test_graphkb/test_statement.py index d0d8a50..92db514 100644 --- a/tests/test_graphkb/test_statement.py +++ b/tests/test_graphkb/test_statement.py @@ -2,15 +2,18 @@ import pytest from unittest.mock import Mock -from pori_python.graphkb import statement - -from .test_match import ( # noqa - 'F401 imported but unused' is being fooled by pytest conventions - conn, -) +from pori_python.graphkb import GraphKBConnection, statement EXCLUDE_INTEGRATION_TESTS = os.environ.get("EXCLUDE_INTEGRATION_TESTS") == "1" +@pytest.fixture(scope="module") +def conn() -> GraphKBConnection: + conn = GraphKBConnection() + conn.login(os.environ["GRAPHKB_USER"], os.environ["GRAPHKB_PASS"]) + return conn + + @pytest.fixture() def graphkb_conn(): def make_rid_list(*values):