Skip to content

Commit

Permalink
Add multiple future annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Dec 17, 2024
1 parent 4721927 commit 45ac0f6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/arcade_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- Split marines before engaging
"""

from __future__ import annotations

from loguru import logger

from sc2 import maps
Expand Down
2 changes: 2 additions & 0 deletions sc2/generate_ids.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import importlib
import json
import platform
Expand Down
2 changes: 2 additions & 0 deletions sc2/paths.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import platform
import re
Expand Down
6 changes: 4 additions & 2 deletions sc2/portconfig.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json

# pyre-fixme[21]
Expand Down Expand Up @@ -49,7 +51,7 @@ def as_json(self) -> str:
return json.dumps({"shared": self.shared, "server": self.server, "players": self.players})

@classmethod
def contiguous_ports(cls, guests: int = 1, attempts: int = 40) -> "Portconfig":
def contiguous_ports(cls, guests: int = 1, attempts: int = 40) -> Portconfig:
"""Returns a Portconfig with adjacent ports"""
for _ in range(attempts):
start = portpicker.pick_unused_port()
Expand All @@ -65,6 +67,6 @@ def contiguous_ports(cls, guests: int = 1, attempts: int = 40) -> "Portconfig":
raise portpicker.NoFreePortFoundError()

@classmethod
def from_json(cls, json_data: bytearray | bytes | str) -> "Portconfig":
def from_json(cls, json_data: bytearray | bytes | str) -> Portconfig:
data = json.loads(json_data)
return cls(server_ports=data["server"], player_ports=data["players"])
2 changes: 2 additions & 0 deletions sc2/protocol.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import sys
from contextlib import suppress
Expand Down
2 changes: 2 additions & 0 deletions sc2/proxy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# pyre-ignore-all-errors[16, 29]
from __future__ import annotations

import asyncio
import os
import platform
Expand Down
2 changes: 2 additions & 0 deletions test/autotest_bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys
from pathlib import Path

Expand Down
2 changes: 2 additions & 0 deletions test/benchmark_distance_two_points.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# pyre-ignore-all-errors[21]
from __future__ import annotations

import math
import platform
import random
Expand Down
2 changes: 2 additions & 0 deletions test/damagetest_bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys
from pathlib import Path

Expand Down

0 comments on commit 45ac0f6

Please sign in to comment.