Skip to content

Commit

Permalink
Update dependencies and drop Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Aug 23, 2024
1 parent 52dddaf commit 9fd9f89
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 422 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
.PHONY: all clean format format-check lint lint-fix type
.PHONY: all clean fix format format-check lint lint-fix type

CMD:=poetry run
PYMODULE:=kmibot

all: type format lint
fix: format lint-fix

format:
$(CMD) ruff format $(PYMODULE)
Expand All @@ -12,10 +13,10 @@ format-check:
$(CMD) ruff format --check $(PYMODULE)

lint:
$(CMD) ruff $(PYMODULE)
$(CMD) ruff check $(PYMODULE)

lint-fix:
$(CMD) ruff --fix $(PYMODULE)
$(CMD) ruff check --fix $(PYMODULE)

type:
$(CMD) mypy $(PYMODULE)
Expand Down
6 changes: 3 additions & 3 deletions kmibot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from zoneinfo import ZoneInfo

import discord
import tomli
import tomllib
from pydantic import BaseModel, HttpUrl, ValidationError, validator
from pydantic_settings import BaseSettings

Expand Down Expand Up @@ -65,12 +65,12 @@ def parse_timezone(cls, val: str) -> ZoneInfo: # noqa: N805
def load_from_file(cls, path: Path) -> "BotConfig": # noqa: ANN102
try:
with path.open("rb") as fh:
data = tomli.load(fh)
data = tomllib.load(fh)
except FileNotFoundError as e:
raise ConfigError("Unable to find config file") from e
except OSError as e:
raise ConfigError("Unable to read config file.") from e
except tomli.TOMLDecodeError as e:
except tomllib.TOMLDecodeError as e:
raise ConfigError(f"Unable to parse TOML: {e}") from e

try:
Expand Down
8 changes: 4 additions & 4 deletions kmibot/modules/ferry/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ async def publish_accusation(
quote: str,
) -> None:
try:
person_criminal = await self.ferry_module.api_client.get_person_for_discord_member(
person_criminal = await self.ferry_module.api_client.get_person_for_discord_member( # type: ignore[has-type]
criminal
) # type: ignore[has-type]
person_accuser = await self.ferry_module.api_client.get_person_for_discord_member(
)
person_accuser = await self.ferry_module.api_client.get_person_for_discord_member( # type: ignore[has-type]
accuser
) # type: ignore[has-type]
)
except httpx.HTTPStatusError as exc:
LOGGER.exception(exc)
return
Expand Down
Loading

0 comments on commit 9fd9f89

Please sign in to comment.