Skip to content

Commit

Permalink
🚨 moved import guards to end of imports
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 9, 2024
1 parent 437bf62 commit 791fcf6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
11 changes: 5 additions & 6 deletions ozi/fix/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
import sys
from email import message_from_string
from pathlib import Path

if sys.version_info >= (3, 11): # pragma: no cover
import tomllib as toml
elif sys.version_info < (3, 11): # pragma: no cover
import tomli as toml

from typing import TYPE_CHECKING

from blastpipe.ozi_templates.filter import underscorify # pyright: ignore
Expand All @@ -26,6 +20,11 @@
from ozi.spec import METADATA
from ozi.tap import TAP

if sys.version_info >= (3, 11): # pragma: no cover
import tomllib as toml
elif sys.version_info < (3, 11): # pragma: no cover
import tomli as toml

if TYPE_CHECKING:
from email.message import Message

Expand Down
1 change: 1 addition & 0 deletions ozi/fix/rewrite_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ozi.render import build_child
from ozi.render import build_file
from ozi.render import find_user_template
from ozi.spec import METADATA

if TYPE_CHECKING:
import sys
Expand Down
2 changes: 2 additions & 0 deletions ozi/spec/_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version

from setuptools_scm import get_version # type: ignore

from ozi.spec.base import Default
from ozi.spec.ci import RuffLint
from ozi.spec.project import ClassicProject
Expand Down
12 changes: 2 additions & 10 deletions ozi/spec/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,28 @@
from __future__ import annotations

import platform
from dataclasses import dataclass
from dataclasses import field
from datetime import date
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from functools import cached_property
from typing import TYPE_CHECKING
from typing import Sequence
from typing import TypeAlias
from warnings import warn

from ozi.spec.base import Default

if TYPE_CHECKING:
import sys
from collections.abc import Callable
from collections.abc import Mapping

_VT: TypeAlias = list['_KT'] | Mapping[str, '_KT']
_KT: TypeAlias = str | int | float | None | _VT
_Lambda: TypeAlias = Callable[[], '_FactoryMethod']
_FactoryMethod: TypeAlias = Callable[[], _Lambda]

if sys.version_info >= (3, 11):
from typing import Self
elif sys.version_info < (3, 11):
from typing_extensions import Self

from dataclasses import dataclass
from dataclasses import field

pymajor, pyminor, pypatch = map(int, platform.python_version_tuple())
DATE_FORMAT = '%Y-%m-%d'
DEPRECATION_DELTA_WEEKS = 104
Expand Down

0 comments on commit 791fcf6

Please sign in to comment.