Skip to content

Commit

Permalink
Fix overload error on Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Jan 25, 2025
1 parent eb23588 commit cd41a4e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bobuild/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from functools import partial
from pathlib import Path
from typing import Literal
from typing import overload

from bobuild.config import GitConfig
from bobuild.log import logger
from bobuild.run import read_stream_task
from bobuild.typing_bo import overload
from bobuild.utils import asyncio_run


Expand Down
2 changes: 1 addition & 1 deletion bobuild/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from functools import partial
from pathlib import Path
from typing import Literal
from typing import overload

from bobuild.config import MercurialConfig
from bobuild.log import logger
from bobuild.multiconfig import MultiConfigParser
from bobuild.run import read_stream_task
from bobuild.typing_bo import overload
from bobuild.utils import asyncio_run


Expand Down
2 changes: 1 addition & 1 deletion bobuild/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from typing import Literal
from typing import Protocol
from typing import TypeVar
from typing import overload
from typing import override

import watchdog.events
Expand All @@ -23,6 +22,7 @@
from bobuild.config import RS2Config
from bobuild.log import logger
from bobuild.multiconfig import MultiConfigParser
from bobuild.typing_bo import overload
from bobuild.utils import asyncio_run
from bobuild.utils import kill_process_tree

Expand Down
3 changes: 2 additions & 1 deletion bobuild/tasks_bo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from typing import Iterator
from typing import Literal
from typing import TypeVar
from typing import overload

import discord
from redis.asyncio import Redis
Expand All @@ -42,6 +41,7 @@
from bobuild.steamcmd import workshop_build_item_many
from bobuild.tasks import bo_build_lock_name
from bobuild.tasks import broker
from bobuild.typing_bo import overload
from bobuild.utils import copy_tree
from bobuild.utils import utcnow
from bobuild.workshop import WorkshopManifest
Expand Down Expand Up @@ -261,6 +261,7 @@ async def gather(
except (Exception, asyncio.CancelledError):
pass


# TODO: tag-based builds:
# - Compile code for all commits.
# - BrewContent runs: if git OR packages OR map tag is newer.
Expand Down
8 changes: 8 additions & 0 deletions bobuild/typing_bo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
try:
from typing import overload
except ImportError:
from typing_extensions import overload

__all__ = [
"overload",
]
2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
exclude = ["submodules/"]

lint.typing-modules = ["bobuild.typing_bo"]

0 comments on commit cd41a4e

Please sign in to comment.