diff --git a/pyproject.toml b/pyproject.toml index e88c84fe..3d6a843e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,8 +15,6 @@ dependencies = [ "aiofiles>=24.1.0", "aiohttp>=3.11.16", "arrow>=1.3.0", - "attrs>=25.3.0", - "cattrs>=23.1.2", "certifi>=2024.7.4", "python-dotenv>=1.0.1", "yarl>=1.19.0", diff --git a/src/europython_discord/extensions/organisers/organisers.py b/src/europython_discord/extensions/organisers/organisers.py index 00c92ec7..ba95eaed 100644 --- a/src/europython_discord/extensions/organisers/organisers.py +++ b/src/europython_discord/extensions/organisers/organisers.py @@ -1,22 +1,22 @@ """Commands for organisers.""" +import dataclasses import logging -import attrs import discord from discord.ext import commands -from europython_discord.extensions.organisers import roles +from europython_discord.extensions.organisers.roles import Roles _logger = logging.getLogger(f"bot.{__name__}") -@attrs.define class Organisers(commands.Cog): """A cog with commands for organisers.""" - _bot: commands.Bot - _roles: roles.Roles + def __init__(self, bot: commands.Bot, roles: Roles) -> None: + self._bot = bot + self._roles = roles @commands.command(name="participants") async def participants(self, ctx: commands.Context) -> None: @@ -50,7 +50,7 @@ def _get_counts(self, guild: discord.Guild) -> "_RoleCount": not_registered=sum(len(m.roles) == 1 for m in guild.members), **{ role: len(guild.get_role(role_id).members) - for role, role_id in attrs.asdict(self._roles).items() + for role, role_id in dataclasses.asdict(self._roles).items() }, ) @@ -77,7 +77,7 @@ def __hash__(self) -> int: return hash(id(self)) -@attrs.define(frozen=True) +@dataclasses.dataclass(frozen=True) class _RoleCount: """Counts of members.""" diff --git a/src/europython_discord/extensions/organisers/roles.py b/src/europython_discord/extensions/organisers/roles.py index c500464b..49135e86 100644 --- a/src/europython_discord/extensions/organisers/roles.py +++ b/src/europython_discord/extensions/organisers/roles.py @@ -1,9 +1,9 @@ """Data structure for role IDs.""" -import attrs +import dataclasses -@attrs.define +@dataclasses.dataclass class Roles: """Role mapping for the organisers extension.""" diff --git a/uv.lock b/uv.lock index c94944fc..0a5f0a21 100644 --- a/uv.lock +++ b/uv.lock @@ -200,18 +200,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5d/35/be73b6015511aa0173ec595fc579133b797ad532996f2998fd6b8d1bbe6b/audioop_lts-0.2.1-cp313-cp313t-win_arm64.whl", hash = "sha256:78bfb3703388c780edf900be66e07de5a3d4105ca8e8720c5c4d67927e0b15d0", size = 23918 }, ] -[[package]] -name = "cattrs" -version = "24.1.3" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "attrs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/29/7b/da4aa2f95afb2f28010453d03d6eedf018f9e085bd001f039e15731aba89/cattrs-24.1.3.tar.gz", hash = "sha256:981a6ef05875b5bb0c7fb68885546186d306f10f0f6718fe9b96c226e68821ff", size = 426684 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/ee/d68a3de23867a9156bab7e0a22fb9a0305067ee639032a22982cf7f725e7/cattrs-24.1.3-py3-none-any.whl", hash = "sha256:adf957dddd26840f27ffbd060a6c4dd3b2192c5b7c2c0525ef1bd8131d8a83f5", size = 66462 }, -] - [[package]] name = "certifi" version = "2025.1.31" @@ -335,8 +323,6 @@ dependencies = [ { name = "aiofiles" }, { name = "aiohttp" }, { name = "arrow" }, - { name = "attrs" }, - { name = "cattrs" }, { name = "certifi" }, { name = "discord-py" }, { name = "pydantic" }, @@ -359,8 +345,6 @@ requires-dist = [ { name = "aiofiles", specifier = ">=24.1.0" }, { name = "aiohttp", specifier = ">=3.11.16" }, { name = "arrow", specifier = ">=1.3.0" }, - { name = "attrs", specifier = ">=25.3.0" }, - { name = "cattrs", specifier = ">=23.1.2" }, { name = "certifi", specifier = ">=2024.7.4" }, { name = "discord-py", specifier = ">=2.3.1" }, { name = "pydantic", specifier = ">=2.8.2" },