Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
chore(style): remove relative imports. (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterschutt authored Oct 31, 2022
1 parent 11fbd6e commit 3133774
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from starlite import CacheConfig
from starlite.config.cache import default_cache_key_builder

from . import redis, settings
from starlite_saqlalchemy import redis, settings

if TYPE_CHECKING:
from starlite.connection import Request
Expand Down
10 changes: 7 additions & 3 deletions src/starlite_saqlalchemy/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

from starlite import Dependency, Parameter, Provide

from . import settings
from .repository.filters import BeforeAfter, CollectionFilter, LimitOffset
from .repository.types import FilterTypes
from starlite_saqlalchemy import settings
from starlite_saqlalchemy.repository.filters import (
BeforeAfter,
CollectionFilter,
LimitOffset,
)
from starlite_saqlalchemy.repository.types import FilterTypes

if TYPE_CHECKING:

Expand Down
4 changes: 2 additions & 2 deletions src/starlite_saqlalchemy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
)
from starlite.utils.exception import create_exception_response

from .repository.exceptions import (
from starlite_saqlalchemy.repository.exceptions import (
RepositoryConflictException,
RepositoryException,
RepositoryNotFoundException,
)
from .service import ServiceException, UnauthorizedException
from starlite_saqlalchemy.service import ServiceException, UnauthorizedException

if TYPE_CHECKING:
from starlite.connection import Request
Expand Down
6 changes: 3 additions & 3 deletions src/starlite_saqlalchemy/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from starlite import get
from starlite.exceptions import ServiceUnavailableException

from . import settings
from .repository.sqlalchemy import SQLAlchemyRepository
from .settings import AppSettings
from starlite_saqlalchemy import settings
from starlite_saqlalchemy.repository.sqlalchemy import SQLAlchemyRepository
from starlite_saqlalchemy.settings import AppSettings


class HealthCheckFailure(ServiceUnavailableException):
Expand Down
10 changes: 5 additions & 5 deletions src/starlite_saqlalchemy/init_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def example_handler() -> dict:
from starlite.app import DEFAULT_CACHE_CONFIG, DEFAULT_OPENAPI_CONFIG
from starlite.plugins.sql_alchemy import SQLAlchemyPlugin

from . import (
from starlite_saqlalchemy import (
cache,
compression,
dependencies,
Expand All @@ -48,10 +48,10 @@ def example_handler() -> dict:
sqlalchemy_plugin,
static_files,
)
from .health import health_check
from .repository.exceptions import RepositoryException
from .service import ServiceException, make_service_callback
from .worker import create_worker_instance
from starlite_saqlalchemy.health import health_check
from starlite_saqlalchemy.repository.exceptions import RepositoryException
from starlite_saqlalchemy.service import ServiceException, make_service_callback
from starlite_saqlalchemy.worker import create_worker_instance

if TYPE_CHECKING:

Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from starlette.status import HTTP_200_OK
from starlite import LoggingConfig

from . import settings
from starlite_saqlalchemy import settings


class AccessLogFilter(logging.Filter): # pylint: disable=too-few-public-methods
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic_openapi_schema.v3_1_0 import Contact
from starlite import OpenAPIConfig

from . import settings
from starlite_saqlalchemy import settings

config = OpenAPIConfig(
title=settings.openapi.TITLE or settings.app.NAME,
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
registry,
)

from . import dto
from starlite_saqlalchemy import dto

if TYPE_CHECKING:
from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from redis.asyncio import Redis

from . import settings
from starlite_saqlalchemy import settings

__all__ = ["client"]

Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/repository/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING, Any, Generic, TypeVar

from .exceptions import RepositoryNotFoundException
from starlite_saqlalchemy.repository.exceptions import RepositoryNotFoundException

if TYPE_CHECKING:
from sqlalchemy.ext.asyncio import AsyncSession
Expand Down
17 changes: 12 additions & 5 deletions src/starlite_saqlalchemy/repository/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
from sqlalchemy import select, text
from sqlalchemy.exc import IntegrityError, SQLAlchemyError

from .abc import AbstractRepository
from .exceptions import RepositoryConflictException, RepositoryException
from .filters import BeforeAfter, CollectionFilter, LimitOffset
from starlite_saqlalchemy.repository.abc import AbstractRepository
from starlite_saqlalchemy.repository.exceptions import (
RepositoryConflictException,
RepositoryException,
)
from starlite_saqlalchemy.repository.filters import (
BeforeAfter,
CollectionFilter,
LimitOffset,
)

if TYPE_CHECKING:
from collections import abc
Expand All @@ -17,8 +24,8 @@
from sqlalchemy.engine import Result
from sqlalchemy.ext.asyncio import AsyncSession

from .. import orm
from .types import FilterTypes
from starlite_saqlalchemy import orm
from starlite_saqlalchemy.repository.types import FilterTypes

__all__ = [
"SQLAlchemyRepository",
Expand Down
6 changes: 5 additions & 1 deletion src/starlite_saqlalchemy/repository/types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Repository type definitions."""
from .filters import BeforeAfter, CollectionFilter, LimitOffset
from starlite_saqlalchemy.repository.filters import (
BeforeAfter,
CollectionFilter,
LimitOffset,
)

FilterTypes = BeforeAfter | CollectionFilter | LimitOffset
"""Aggregate type alias of the types supported for collection filtering."""
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration

from . import settings
from starlite_saqlalchemy import settings


def configure() -> None:
Expand Down
12 changes: 6 additions & 6 deletions src/starlite_saqlalchemy/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
from enum import Enum
from typing import TYPE_CHECKING, Any, Generic, TypeVar

from . import dto
from .repository.sqlalchemy import ModelT
from .sqlalchemy_plugin import async_session_factory
from .worker import queue
from starlite_saqlalchemy import dto
from starlite_saqlalchemy.repository.sqlalchemy import ModelT
from starlite_saqlalchemy.sqlalchemy_plugin import async_session_factory
from starlite_saqlalchemy.worker import queue

if TYPE_CHECKING:
from pydantic import BaseModel
from sqlalchemy.ext.asyncio import AsyncSession

from .repository.abc import AbstractRepository
from .repository.types import FilterTypes
from starlite_saqlalchemy.repository.abc import AbstractRepository
from starlite_saqlalchemy.repository.types import FilterTypes


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/sqlalchemy_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
SESSION_TERMINUS_ASGI_EVENTS,
)

from . import settings
from starlite_saqlalchemy import settings

if TYPE_CHECKING:
from sqlalchemy.ext.asyncio import AsyncSession
Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from starlite.config import StaticFilesConfig

from .constants import STATIC_DIR, STATIC_PATH
from starlite_saqlalchemy.constants import STATIC_DIR, STATIC_PATH

here = Path(__file__).parent

Expand Down
2 changes: 1 addition & 1 deletion src/starlite_saqlalchemy/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import orjson
import saq

from . import redis
from starlite_saqlalchemy import redis

if TYPE_CHECKING:
from signal import Signals
Expand Down

0 comments on commit 3133774

Please sign in to comment.