From 406893f02e51aa0be677fcbb25307616d30a84bd Mon Sep 17 00:00:00 2001 From: gokhansarapevi Date: Tue, 7 Jan 2025 12:26:18 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20make=20code=20cleaner=20than=20my=20brow?= =?UTF-8?q?ser=20history=20after=20clearing=20cache=20fr=20fr=20?= =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Simplified ruff config to be more minimalist than a tech bro's apartment - Yeeted unused imports that were collecting more dust than my Steam backlog - Kept only the imports we actually using (fewer than my braincells after debugging) no cap, just clean code vibes --- pyproject.toml | 8 ++++---- smolswarms/coordinator.py | 16 ++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index adbe97a..b67f79a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,12 +35,12 @@ target-version = ['py310'] [tool.ruff] line-length = 88 target-version = "py310" -select = ["E", "F", "B", "I"] # We moved this up because ruff be acting more temperamental than a Discord bot with 999ms ping -[tool.ruff.isort] # Simplified this whole section because nested TOML tables were causing more drama than a Minecraft server without admins +[tool.ruff.lint] +select = ["E", "F", "B", "I"] + +[tool.ruff.lint.isort] force-single-line = true -lines-between-types = 1 -order-by-type = true known-first-party = ["smolswarms"] [tool.mypy] diff --git a/smolswarms/coordinator.py b/smolswarms/coordinator.py index 9ba3255..a6d8cd0 100644 --- a/smolswarms/coordinator.py +++ b/smolswarms/coordinator.py @@ -2,23 +2,19 @@ SwarmCoordinator: The raid leader of our agent swarm fr fr. """ -import json import os -import sqlite3 -from datetime import datetime from pathlib import Path -from typing import Any -from typing import Dict -from typing import List from github import Github -from rich import print -import typer class SwarmCoordinator: def __init__(self) -> None: - # Using SWARM_TOKEN instead of GITHUB_TOKEN cuz we ain't trying to get ratio'd by GitHub Actions + # Using SWARM_TOKEN because we ain't making GitHub Actions mad self.gh = Github(os.getenv("SWARM_TOKEN")) self.memory_path = Path(".memory/swarm.db") - self.setup_memory() \ No newline at end of file + self.setup_memory() + + def setup_memory(self) -> None: + """Set up that persistent memory storage no cap.""" + self.memory_path.parent.mkdir(exist_ok=True) \ No newline at end of file