Skip to content

Commit

Permalink
Updated if False checks to if TYPE_CHECKING, and updated docs to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieran-Lock committed Aug 22, 2023
1 parent 0148e6f commit f407728
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 54 deletions.
50 changes: 25 additions & 25 deletions docs/src/lib/content/project.ts

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion sqliteframe/entity/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from dataclasses import dataclass, field
from ..types import Type
from ..where import Comparisons, Condition
from ..foreign_key import ForeignKey
if False:
if TYPE_CHECKING:
from .entity import Entity


Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/entity/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"""

from __future__ import annotations
from typing import TypeVar, Literal, Iterable, Optional, Callable, Iterator
from typing import TypeVar, Literal, Iterable, Optional, Callable, Iterator, TYPE_CHECKING
from pprint import pformat
from inspect import getmembers, isroutine
from .column import Column
from ..types import Type
from ..statements import InsertInto, Set, CreateTable, Select, DeleteFrom, DropTable
from ..wildcards import Wildcards
from ..foreign_key import ForeignKey
if False:
if TYPE_CHECKING:
from ..database import Database


Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/foreign_key/foreign_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from __future__ import annotations
from functools import cached_property
from typing import TypeVar, Optional, Callable
from typing import TypeVar, Optional, Callable, TYPE_CHECKING
from .restraints import Restraints
from ..types import Type
if False:
if TYPE_CHECKING:
from ..entity import Entity, Column


Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/join/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .join_types import JoinTypes
from ..where import Condition, Where
if False:
if TYPE_CHECKING:
from sqliteframe.entity import Entity


Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/order_by/order_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .order_types import OrderTypes
if False:
if TYPE_CHECKING:
from sqliteframe.entity import Column


Expand Down
5 changes: 2 additions & 3 deletions sqliteframe/parameterized/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Literal

if False:
from typing import Literal, TYPE_CHECKING
if TYPE_CHECKING:
from ..statements import Statement


Expand Down
5 changes: 2 additions & 3 deletions sqliteframe/result/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"""

from __future__ import annotations
from typing import Iterator
from typing import Iterator, TypeVar, TYPE_CHECKING
from sqlite3 import Cursor
if False:
from typing import TypeVar
if TYPE_CHECKING:
from sqliteframe.entity import Column
ColumnT = TypeVar("ColumnT", bound=Column)

Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/statements/create_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .statement import Statement
if False:
if TYPE_CHECKING:
from ..entity import Column, Entity


Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/statements/delete_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .statement import Statement
from ..where import Where, Condition
if False:
if TYPE_CHECKING:
from ..entity import Entity


Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/statements/drop_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .statement import Statement
if False:
if TYPE_CHECKING:
from ..entity import Entity


Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/statements/insert_into.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"""

from __future__ import annotations
from typing import TypeVar, TYPE_CHECKING
from .statement import Statement
if False:
from typing import TypeVar
if TYPE_CHECKING:
from ..entity import Column, Entity
ColumnT = TypeVar("ColumnT", bound=Column)

Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/statements/pragma.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""

from __future__ import annotations
from typing import Optional
from typing import Optional, TYPE_CHECKING
from .statement import Statement
from ..pragma import PragmaStatements, PragmaTypes
if False:
if TYPE_CHECKING:
from ..database import Database


Expand Down
3 changes: 2 additions & 1 deletion sqliteframe/statements/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .statement import Statement
from ..wildcards import Wildcards
from ..order_by import OrderBy, OrderTypes
from ..where import Where, Condition
from ..join import Join, JoinTypes
if False:
if TYPE_CHECKING:
from ..entity import Column, Entity


Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/statements/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""

from __future__ import annotations
from typing import TypeVar, TYPE_CHECKING
from .statement import Statement
from ..where import Where
if False:
from typing import TypeVar
if TYPE_CHECKING:
from ..entity import Column, Entity
ColumnT = TypeVar("ColumnT", bound=Column)

Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/statements/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"""

from __future__ import annotations
from typing import Callable, Literal
from typing import Callable, Literal, TYPE_CHECKING
from abc import ABC, abstractmethod
from ..result import Result
from ..parameterized import Parameterized
if False:
if TYPE_CHECKING:
from ..entity import Column
from ..database import Database

Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/where/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .comparisons import Comparisons
from .conjunctions import Conjunctions
from ..parameterized import Parameterized

if False:
if TYPE_CHECKING:
from ..entity import Column
from .where import Where

Expand Down
4 changes: 2 additions & 2 deletions sqliteframe/where/where.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING
from .conjunctions import Conjunctions
from ..parameterized import Parameterized

if False:
if TYPE_CHECKING:
from .condition import Condition


Expand Down

0 comments on commit f407728

Please sign in to comment.