Skip to content

Commit

Permalink
work around disagreement with pyright & reorder-python-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jul 5, 2022
1 parent 119e5a7 commit 1030729
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/state/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Mapping
from typing import MutableMapping
from typing import Optional
from typing import TYPE_CHECKING

import aiohttp
import aioredis
Expand All @@ -27,6 +28,16 @@
from app.logging import ansi_rgb_rainbow


if TYPE_CHECKING:
# XXX: reorder-python-imports removes redundant imports, meaning that the
# import of `databases.core` also imports databases. pyright however, does
# not support this behaviour and thus breaks the types from the parent module.
# sadly, neither party wishes to back down - we do this to work around this issue.
# https://github.com/asottile/reorder_python_imports/issues/221
# https://github.com/microsoft/pyright/issues/2964
import databases


STRANGE_LOG_DIR = Path.cwd() / ".data/logs"
GEOLOC_DB_FILE = Path.cwd() / "ext/GeoLite2-City.mmdb"

Expand Down

0 comments on commit 1030729

Please sign in to comment.