Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
run: |
source venv/bin/activate
cargo test --verbose
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __pycache__/
# Distribution / packaging
socha_builds/
.Python
.venv/
venv*/
env/
bin/
build/
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ name = "socha"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.2" }
pyo3-log = "0.10.0"
pyo3 = { version = "0.27.1", features = ["extension-module"] }
pyo3-log = "0.13.2"
log = "0.4.20"
itertools = "0.13.0"

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ build-backend = "maturin"
name = "socha"
version = "4.3.4"
authors = [
{ name = "yoente", email = "[email protected].de" },
{ name = "yoente", email = "anthony@software-challenge.de" },
{ name = "maxblan", email = "[email protected]" },
]
description = "Dieses Paket ist für die Software-Challenge Germany 2026, bei der in dieser Saison das Spiel 'Piranhas' im Mittelpunkt steht."
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["xsdata==22.9"]
dependencies = ["xsdata==25.7", "setuptools==80.9.0"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
Expand All @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python",
"Programming Language :: Rust",
Expand Down
2 changes: 0 additions & 2 deletions python/socha/api/networking/xml_protocol_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def map_last_move(last_move: LastMove, params: dict):


def custom_class_factory(clazz, params: dict):
# print("TEST01: ", clazz, params)

if clazz.__name__ == 'Data':
return map_object(clazz, params)
if clazz.__name__ == 'LastMove':
Expand Down
2 changes: 1 addition & 1 deletion python/socha/api/protocol/protocol.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from dataclasses import dataclass, field
from typing import List, Optional

Expand Down Expand Up @@ -493,7 +494,6 @@ class Meta:
},
)


@dataclass
class Joined(ResponsePacket):
"""
Expand Down
10 changes: 6 additions & 4 deletions python/socha/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging
import urllib.request

import pkg_resources
from importlib.metadata import version, PackageNotFoundError
from socha.api.networking.game_client import GameClient, IClientHandler
from socha.utils.package_builder import SochaPackageBuilder

Expand Down Expand Up @@ -56,6 +56,7 @@ def __init__(
log: If True the client write a log file to the current directory.
verbose: Verbose option for logging.
build: If set, the client will build a zip package with the given name.
python_version: When building, takes string for specified python version. Standard: "3.10".
"""
VERBOSE = 15
logging.addLevelName(VERBOSE, "VERBOSE")
Expand Down Expand Up @@ -141,7 +142,7 @@ def _setup_debugger(self, verbose: bool, log_level: int):
def check_socha_version():
package_name = "socha"
try:
installed_version = pkg_resources.get_distribution(package_name).version
installed_version = version(package_name)
# trunk-ignore(bandit/B310)
response = urllib.request.urlopen(
f"https://pypi.org/pypi/{package_name}/json"
Expand All @@ -157,7 +158,7 @@ def check_socha_version():
logging.info(
f"You're running the latest version of {package_name} ({latest_version})"
)
except pkg_resources.DistributionNotFound:
except PackageNotFoundError:
logging.error(f"{package_name} is not installed.")
except urllib.error.URLError as e:
logging.warning(
Expand Down Expand Up @@ -241,10 +242,11 @@ def _handle_start_args():
parser.add_argument(
"-a",
"--architecture",
help="Specifies the build architecture (e.g.: manylinux1_x86_64).",
help="Specifies the build architecture (e.g.: manylinux2014_x86_64).",
)

parser.add_argument(
"-pyv",
"--python-version",
help="Specifies the build python version (e.g.: 3.10 - this is standard).",
)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
xsdata==22.9
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use pyo3::*;
use types::PyModule;
use pyo3::types::PyModuleMethods;

pub mod plugin2026;

Expand Down
4 changes: 3 additions & 1 deletion src/plugin2026/test/game_state_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
use pyo3::Python;

use crate::plugin2026::{
field_type::FieldType, r#move::Move, test::common::create_test_game_state, utils::{coordinate::Coordinate, direction::Direction}
};
Expand Down Expand Up @@ -39,7 +41,7 @@ mod tests {

#[test]
pub fn perform_move_test() {
pyo3::prepare_freethreaded_python();
Python::initialize();

let mut state = create_test_game_state();

Expand Down
Loading