Skip to content

Commit ae15c0a

Browse files
committed
fix: update setuptools and replace pkg_resources
1 parent 2ba9665 commit ae15c0a

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "maturin"
66
name = "socha"
77
version = "4.3.4"
88
authors = [
9-
{ name = "yoente", email = "stu250140@mail.uni-kiel.de" },
9+
{ name = "yoente", email = "anthony@software-challenge.de" },
1010
{ name = "maxblan", email = "stu222782@mail.uni-kiel.de" },
1111
]
1212
description = "Dieses Paket ist für die Software-Challenge Germany 2026, bei der in dieser Saison das Spiel 'Piranhas' im Mittelpunkt steht."

python/socha/starter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import logging
99
import urllib.request
1010

11-
import pkg_resources
11+
from importlib.metadata import version, PackageNotFoundError
1212
from socha.api.networking.game_client import GameClient, IClientHandler
1313
from socha.utils.package_builder import SochaPackageBuilder
1414

@@ -142,7 +142,7 @@ def _setup_debugger(self, verbose: bool, log_level: int):
142142
def check_socha_version():
143143
package_name = "socha"
144144
try:
145-
installed_version = pkg_resources.get_distribution(package_name).version
145+
installed_version = version(package_name)
146146
# trunk-ignore(bandit/B310)
147147
response = urllib.request.urlopen(
148148
f"https://pypi.org/pypi/{package_name}/json"
@@ -158,7 +158,7 @@ def check_socha_version():
158158
logging.info(
159159
f"You're running the latest version of {package_name} ({latest_version})"
160160
)
161-
except pkg_resources.DistributionNotFound:
161+
except PackageNotFoundError:
162162
logging.error(f"{package_name} is not installed.")
163163
except urllib.error.URLError as e:
164164
logging.warning(

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
xsdata==25.7

0 commit comments

Comments
 (0)