Skip to content

Commit

Permalink
chore: add presentation layer
Browse files Browse the repository at this point in the history
  • Loading branch information
theodu committed Aug 24, 2023
1 parent ee55de8 commit a418bbb
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/kili/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from kili.core.graphql.graphql_client import GraphQLClient, GraphQLClientName
from kili.core.graphql.operations.api_key.queries import APIKeyQuery, APIKeyWhere
from kili.core.graphql.operations.user.queries import GQL_ME
from kili.entrypoints.client.internal import InternalEntrypoints
from kili.entrypoints.client.issue import IssueEntrypoints
from kili.entrypoints.mutations.asset import MutationsAsset
from kili.entrypoints.mutations.data_connection import MutationsDataConnection
from kili.entrypoints.mutations.issue import MutationsIssue
Expand All @@ -40,6 +38,8 @@
from kili.entrypoints.subscriptions.label import SubscriptionsLabel
from kili.exceptions import AuthenticationFailed, UserNotFoundError
from kili.gateways.kili_api_gateway import KiliAPIGateway
from kili.presentation.client.internal import InternalClientMethod
from kili.presentation.client.issue import IssueClientMethod

warnings.filterwarnings("default", module="kili", category=DeprecationWarning)

Expand Down Expand Up @@ -78,7 +78,7 @@ class Kili( # pylint: disable=too-many-ancestors,too-many-instance-attributes
QueriesProjectVersion,
QueriesUser,
SubscriptionsLabel,
IssueEntrypoints,
IssueClientMethod,
):
"""Kili Client."""

Expand Down Expand Up @@ -178,7 +178,7 @@ def __init__(
api_key_query = APIKeyQuery(self.graphql_client, self.http_client)
self._check_expiry_of_key_is_close(api_key_query, self.api_key)

self.internal = InternalEntrypoints(self)
self.internal = InternalClientMethod(self)

def _check_api_key_valid(self) -> bool:
"""Check that the api_key provided is valid."""
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kili.entrypoints.queries.api_key import QueriesApiKey


class InternalEntrypoints(MutationsOrganization, QueriesApiKey):
class InternalClientMethod(MutationsOrganization, QueriesApiKey):
"""Inherit classes for internal use by Kili Technology only."""

def __init__(self, kili):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@for_all_methods(log_call, exclude=["__init__"])
class IssueEntrypoints:
class IssueClientMethod:
"""Set of Issue mutations."""

kili_api_gateway: KiliAPIGateway
Expand Down
2 changes: 1 addition & 1 deletion src/kili/services/plugins/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from typing import Dict, List, Optional

from kili.entrypoints.client import Kili
from kili.client import Kili
from kili.services.plugins.helpers import get_logger


Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_e2e_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest_mock
from pyinstrument.profiler import Profiler

from kili.entrypoints.client import Kili
from kili.client import Kili


def test_client_init_not_too_long_with_checks_enabled():
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_json_response_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from gql.transport import exceptions

from kili.entrypoints.client import Kili
from kili.client import Kili
from kili.exceptions import GraphQLError


Expand Down
2 changes: 1 addition & 1 deletion tests/integration/entrypoints/client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import pytest_mock
from filelock import FileLock

from kili.client import Kili
from kili.core.graphql.graphql_client import DEFAULT_GRAPHQL_SCHEMA_CACHE_DIR
from kili.entrypoints.client import Kili
from kili.exceptions import AuthenticationFailed


Expand Down

0 comments on commit a418bbb

Please sign in to comment.