Compare commits
19
Commits
v4.0.0
..
bd365d575f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd365d575f | ||
|
|
0e262d5972 | ||
|
|
774e6ffedf | ||
|
|
de2542ece6 | ||
|
|
c29194a30a | ||
|
|
8870d93a44 | ||
|
|
6a26440c4d | ||
|
|
2735d6877f | ||
|
|
117f5655d7 | ||
|
|
c808bb2610 | ||
|
|
5e7b3790eb | ||
|
|
07ea150ad3 | ||
|
|
9280bbfbca | ||
|
|
abf076fceb | ||
|
|
0c0997624f | ||
|
|
67090e0d6f | ||
|
|
385129c434 | ||
|
|
327126307d | ||
|
|
36dad683d8 |
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Install Docker
|
||||
uses: https://github.com/papodaca/install-docker-action@v1
|
||||
- name: Log into container registry
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.cheezers.org
|
||||
username: imcompiling
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Install Docker
|
||||
uses: https://github.com/papodaca/install-docker-action@v1
|
||||
- name: Log into container registry
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.cheezers.org
|
||||
username: imcompiling
|
||||
|
||||
@@ -135,3 +135,4 @@ deleted_backups/
|
||||
highscores_data/
|
||||
TODO.txt
|
||||
sql_tester.py
|
||||
database.db
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
FROM python:3.12.3-slim
|
||||
|
||||
# install uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.4.30 /uv /uvx /bin/
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.6.2 /uv /uvx /bin/
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade && apt-get -y install sqlite3
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from nextcord.ext import commands
|
||||
from sqlalchemy import exc, select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from cogs.submission.submission_views import SubmissionCreateButton
|
||||
from database_setup.sql_data_classes import Category, CategoryGroup, engine
|
||||
from utilities.utils import MAX_LINE_LENGTH, autofill_groups, send_highscore_message
|
||||
|
||||
@@ -98,10 +97,9 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
||||
min_value=1,
|
||||
max_value=30,
|
||||
),
|
||||
channel: nextcord.abc.GuildChannel | None = nextcord.SlashOption(
|
||||
channel: nextcord.TextChannel | None = nextcord.SlashOption(
|
||||
description="Channel to post Group in. If left empty, defaults to current channel.",
|
||||
required=False,
|
||||
channel_types=[nextcord.ChannelType.text],
|
||||
default=None,
|
||||
),
|
||||
) -> None:
|
||||
@@ -120,11 +118,13 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
||||
"""
|
||||
# if no channel provided, use current channel.
|
||||
if channel is None:
|
||||
channel = interaction.channel
|
||||
channel_id: int = interaction.channel.id
|
||||
else:
|
||||
channel_id: int = channel.id
|
||||
|
||||
new_group = CategoryGroup(
|
||||
GroupName=group_name,
|
||||
ChannelId=channel.id,
|
||||
ChannelId=channel_id,
|
||||
GuildId=interaction.guild_id,
|
||||
PadLength=pad_length,
|
||||
UsernameLength=username_length,
|
||||
@@ -134,8 +134,7 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
||||
try:
|
||||
session.add(new_group)
|
||||
session.commit()
|
||||
message: nextcord.Message = await send_highscore_message(session, interaction.guild, new_group)
|
||||
await message.edit(view=SubmissionCreateButton(self._bot))
|
||||
await send_highscore_message(session, interaction.guild, new_group)
|
||||
await interaction.response.send_message(f'"{group_name}" has been created!', ephemeral=True)
|
||||
except exc.IntegrityError:
|
||||
# Category Group already exists in guild
|
||||
@@ -147,7 +146,7 @@ class CreateCog(commands.Cog, name="Create Cog"):
|
||||
@category.on_autocomplete("group_id")
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str) -> None:
|
||||
"""
|
||||
Collects list of table names and compares to input table name for autocomplete assistance.
|
||||
Collects list of group names and compares to input group name for autocomplete assistance.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with command.
|
||||
|
||||
+10
-10
@@ -18,7 +18,7 @@ from utilities.utils import (
|
||||
from .views.delete_confirm import DeleteConfirmView, create_delete_id
|
||||
|
||||
|
||||
class DeleteCog(commands.Cog, name="Table Management"):
|
||||
class DeleteCog(commands.Cog, name="Delete Cog"):
|
||||
"""Class holds commands for deleting."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
@@ -32,7 +32,7 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
async def all(self, interaction: nextcord.Interaction) -> None:
|
||||
"""Subcommand parent for deleting all of a thing. Never called."""
|
||||
|
||||
@all.subcommand(description="Clears highscores channel of all table messages. Does not change data.")
|
||||
@all.subcommand(description="Clears highscores channel of all highscore messages. Does not change data.")
|
||||
async def channel_messages(
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
@@ -69,16 +69,16 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
|
||||
for group in groups:
|
||||
try:
|
||||
table_message: nextcord.Message = await channel.fetch_message(group.MessageId)
|
||||
await table_message.delete()
|
||||
message: nextcord.Message = await channel.fetch_message(group.MessageId)
|
||||
await message.delete()
|
||||
except nextcord.NotFound:
|
||||
# silently ignore that messages are not found. They got deleted already.
|
||||
pass
|
||||
|
||||
await interaction.send("Table messages deleted.", ephemeral=True)
|
||||
await interaction.send("Highscore messages deleted.", ephemeral=True)
|
||||
|
||||
@all.subcommand(
|
||||
description="Removes all of a user's scores. Warning: data is destroyed, use with case.",
|
||||
description="Removes all of a user's scores. Warning: data is destroyed, use with care.",
|
||||
)
|
||||
async def users(
|
||||
self,
|
||||
@@ -90,7 +90,7 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
"""
|
||||
Searches all of guild's scores data for any score from the user and removes.
|
||||
|
||||
Updates table message is user was removed from that table.
|
||||
Updates highscore message if user was removed from that Category Group.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -112,7 +112,7 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
for group in session.scalars(stmt):
|
||||
await send_highscore_message(session, interaction.guild, group)
|
||||
|
||||
await interaction.send(f'User "{user_name}" was removed from all tables.', ephemeral=True)
|
||||
await interaction.send(f'User "{user_name}" was removed from all Category Groups.', ephemeral=True)
|
||||
|
||||
@delete.subcommand(description="Delete a category from a group. Deletion is perminant.")
|
||||
async def category(
|
||||
@@ -225,7 +225,7 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
@group.on_autocomplete("group_id")
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str) -> None:
|
||||
"""
|
||||
Autocomplete function for table names.
|
||||
Autocomplete function for group names.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -264,7 +264,7 @@ class DeleteCog(commands.Cog, name="Table Management"):
|
||||
"""
|
||||
await interaction.response.send_autocomplete(
|
||||
autofill_users_in_group_category(
|
||||
interaction.guild_id, int(group_id), category_id if category_id else 0, user_name
|
||||
interaction.guild_id, int(group_id), int(category_id) if category_id else 0, user_name
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class HelpCog(commands.Cog, name="Help commands."):
|
||||
help_str: str = "Welcome to Agon! Three simple steps are needed to get started."
|
||||
help_str += '1.) Set a channel to receive submission verifications with "/set verify_channel."\n'
|
||||
help_str += "This channel is used to allow moderators to check if a submission is real/valid.\n\n"
|
||||
help_str += '2.) Set up your highscore tables! Use "/create group" to first create a group message in the'
|
||||
help_str += '2.) Set up your highscores! Use "/create group" to first create a group message in the'
|
||||
help_str += 'channel you would like and then use "/create category" to create a category in that group message!'
|
||||
help_str += "\n\n"
|
||||
help_str += '3.) Users can then submit scores with the "/submit" command.'
|
||||
|
||||
+15
-26
@@ -8,19 +8,16 @@ from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
# pylint: disable=import-error
|
||||
from cogs.submission.submission_views import SubmissionCreateButton
|
||||
from database_setup.sql_data_classes import CategoryGroup, engine
|
||||
from utilities.utils import autofill_groups, send_highscore_message
|
||||
|
||||
|
||||
class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
"""
|
||||
Class holds commands for refreshing.
|
||||
"""
|
||||
"""Class holds commands for refreshing."""
|
||||
|
||||
def __init__(self, bot: commands.Bot) -> None:
|
||||
"""
|
||||
Default constructor for RefreshCog class
|
||||
Default constructor for RefreshCog class.
|
||||
|
||||
Args:
|
||||
bot (commands.Bot): Bot object. Required to register submission button view.
|
||||
@@ -28,19 +25,17 @@ class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
self._bot = bot
|
||||
|
||||
@nextcord.slash_command(default_member_permissions=nextcord.Permissions(administrator=True))
|
||||
async def refresh(self, interaction: nextcord.Interaction):
|
||||
"""
|
||||
Parent slash command for refreshing things. Never called.
|
||||
"""
|
||||
async def refresh(self, interaction: nextcord.Interaction) -> None:
|
||||
"""Parent slash command for refreshing things. Never called."""
|
||||
|
||||
@refresh.subcommand(description="Manually refresh a table. Use when changing settings or data manually changed.")
|
||||
@refresh.subcommand(description="Manually refresh a group. Use when changing settings or data manually changed.")
|
||||
async def group(
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
group_id: str = nextcord.SlashOption(name="group", description="Name of Group.", required=True),
|
||||
) -> None:
|
||||
"""
|
||||
Refreshes a table given by user.
|
||||
Refreshes a group given by user.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -54,25 +49,20 @@ class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
)
|
||||
group = session.scalar(stmt)
|
||||
|
||||
message: nextcord.Message = await send_highscore_message(session, interaction.guild, group)
|
||||
await message.edit(view=SubmissionCreateButton(self._bot))
|
||||
|
||||
await interaction.response.send_message(f"Updated table {group.GroupName}!", ephemeral=True)
|
||||
await send_highscore_message(session, interaction.guild, group)
|
||||
await interaction.response.send_message(f"Updated group {group.GroupName}!", ephemeral=True)
|
||||
|
||||
@refresh.subcommand()
|
||||
async def all(self, interaction: nextcord.Interaction):
|
||||
"""
|
||||
Subcommand parent for refreshing all things. Never called.
|
||||
"""
|
||||
async def all(self, interaction: nextcord.Interaction) -> None:
|
||||
"""Subcommand parent for refreshing all things. Never called."""
|
||||
|
||||
@all.subcommand(description="Triggers post/update of highscores to registered highscore channels.")
|
||||
async def groups(self, interaction: nextcord.Interaction) -> None:
|
||||
"""
|
||||
A command which posts the highscore in the registered channel.
|
||||
Sends warning if no channel has been registered.
|
||||
|
||||
Either creates new messages for each table if one doesn't exist
|
||||
or edits the existing message.
|
||||
Sends warning if no channel has been registered. Either creates new messages for each group if one doesn't
|
||||
exist or edits the existing message.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -84,15 +74,14 @@ class RefreshCog(commands.Cog, name="Refresh Cog"):
|
||||
await interaction.response.defer(ephemeral=True)
|
||||
|
||||
for group in session.scalars(stmt):
|
||||
message: nextcord.Message = await send_highscore_message(session, interaction.guild, group)
|
||||
await message.edit(view=SubmissionCreateButton(self._bot))
|
||||
await send_highscore_message(session, interaction.guild, group)
|
||||
|
||||
await interaction.send(f"Posted all groups in {interaction.guild.name}'s highscores.", ephemeral=True)
|
||||
|
||||
@group.on_autocomplete("group_id")
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str):
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str) -> None:
|
||||
"""
|
||||
Collects list of table names and compares to input table name for autocomplete assistance.
|
||||
Collects list of group names and compares to input group name for autocomplete assistance.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction with command.
|
||||
|
||||
@@ -10,7 +10,7 @@ from sqlalchemy.orm import Session
|
||||
from cogs.submission.verification_view import VerificationView
|
||||
from database_setup.sql_data_classes import Category, CategoryGroup, Guild, Submission, engine
|
||||
from main import logger
|
||||
from utilities.utils import GUILDS, autofill_categories, autofill_groups, submit_score
|
||||
from utilities.utils import autofill_categories, autofill_groups, submit_score
|
||||
|
||||
|
||||
class SubmissionCog(commands.Cog):
|
||||
@@ -19,7 +19,7 @@ class SubmissionCog(commands.Cog):
|
||||
def __init__(self) -> None:
|
||||
return
|
||||
|
||||
@nextcord.slash_command(guild_ids=GUILDS)
|
||||
@nextcord.slash_command()
|
||||
async def submit( # noqa: PLR0913
|
||||
self,
|
||||
interaction: nextcord.Interaction,
|
||||
@@ -47,6 +47,7 @@ class SubmissionCog(commands.Cog):
|
||||
group_id (str): Is SlashOption. Group that the score category belongs in.
|
||||
category_id (str): Is SlashOption. Category to submit the score in.
|
||||
score (str): Is SlashOption. The score.
|
||||
proof (nextcord.Attachment): Is SlashOption. Picture to provide proof of score.
|
||||
username (str, optional): Is SlashOption. Username to associate with the score.
|
||||
"""
|
||||
# fill out username if not passed in
|
||||
@@ -208,7 +209,7 @@ class SubmissionCog(commands.Cog):
|
||||
@submit.on_autocomplete("group_id")
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str) -> None:
|
||||
"""
|
||||
Autocomplete function for table names.
|
||||
Autocomplete function for group names.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
|
||||
+19
-20
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
View command heirarchy.
|
||||
"""
|
||||
"""View command hierarchy."""
|
||||
|
||||
import nextcord
|
||||
import pandas as pd
|
||||
@@ -14,20 +12,14 @@ from utilities.utils import MAX_LINE_LENGTH, autofill_categories, autofill_group
|
||||
|
||||
|
||||
class ViewCog(commands.Cog, name="View Command"):
|
||||
"""
|
||||
Class holds commands for viewing data.
|
||||
"""
|
||||
"""Class holds commands for viewing data."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
Default constructor for ViewCog class. Does nothing.
|
||||
"""
|
||||
"""Default constructor for ViewCog class. Does nothing."""
|
||||
|
||||
@nextcord.slash_command()
|
||||
async def view(self, interaction: nextcord.Interaction):
|
||||
"""
|
||||
Parent slash command for view. Never called.
|
||||
"""
|
||||
async def view(self, interaction: nextcord.Interaction) -> None:
|
||||
"""Parent slash command for view. Never called."""
|
||||
|
||||
@view.subcommand(description="Lists all scores for a given category.")
|
||||
async def leaderboard(
|
||||
@@ -39,10 +31,12 @@ class ViewCog(commands.Cog, name="View Command"):
|
||||
category_id: str = nextcord.SlashOption(
|
||||
name="category", description="Category to show leaderboard.", required=True
|
||||
),
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Gathers all users that have a submission in the group/category combo and returns a message with them
|
||||
in ranked order.
|
||||
Create message with leaderboard of a group and category.
|
||||
|
||||
Gathers all users that have a submission in the group/category combo and returns a
|
||||
message with them in ranked order.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -71,7 +65,12 @@ class ViewCog(commands.Cog, name="View Command"):
|
||||
for i, row in scores.iterrows():
|
||||
str_list.append(
|
||||
format_score_string(
|
||||
row["UserName"], row["Score"], longest_str, category.IsTimeRecord, i + 1, MAX_LINE_LENGTH
|
||||
row["UserName"],
|
||||
row["Score"],
|
||||
longest_str,
|
||||
category.IsTimeRecord,
|
||||
i + 1, # type: ignore[reportOperatorIssue]
|
||||
MAX_LINE_LENGTH,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -87,9 +86,9 @@ class ViewCog(commands.Cog, name="View Command"):
|
||||
await interaction.response.send_message(content=message_str)
|
||||
|
||||
@leaderboard.on_autocomplete("group_id")
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str):
|
||||
async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str) -> None:
|
||||
"""
|
||||
Autocomplete function for table names.
|
||||
Autocomplete function for group names.
|
||||
|
||||
Args:
|
||||
interaction (nextcord.Interaction): Interaction that invoked the command.
|
||||
@@ -98,7 +97,7 @@ class ViewCog(commands.Cog, name="View Command"):
|
||||
await interaction.response.send_autocomplete(autofill_groups(interaction.guild_id, group_id))
|
||||
|
||||
@leaderboard.on_autocomplete("category_id")
|
||||
async def category_autocomplete(self, interaction: nextcord.Interaction, category_id: str, group_id: str):
|
||||
async def category_autocomplete(self, interaction: nextcord.Interaction, category_id: str, group_id: str) -> None:
|
||||
"""
|
||||
Autocomplete function for category names.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""View for verification buttons."""
|
||||
|
||||
import nextcord
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import delete, select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database_setup.sql_data_classes import Submission, engine
|
||||
@@ -19,6 +19,14 @@ class VerificationView(nextcord.ui.View):
|
||||
@nextcord.ui.button(label="Deny", style=nextcord.ButtonStyle.red, custom_id="deny-button-submission")
|
||||
async def deny_button(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None: # noqa: ARG002
|
||||
"""Button for denying score submission."""
|
||||
with Session(engine) as session:
|
||||
stmt = (
|
||||
delete(Submission)
|
||||
.where(Submission.GuildId == interaction.guild_id)
|
||||
.where(Submission.MessageId == interaction.message.id)
|
||||
)
|
||||
session.execute(stmt)
|
||||
session.commit()
|
||||
await interaction.message.delete()
|
||||
|
||||
@nextcord.ui.button(label="Approve", style=nextcord.ButtonStyle.green, custom_id="approve-button-submission")
|
||||
@@ -41,6 +49,8 @@ class VerificationView(nextcord.ui.View):
|
||||
await submit_score(
|
||||
interaction, submission.GroupId, submission.CategoryId, submission.UserName, submission.Score
|
||||
)
|
||||
session.delete(submission)
|
||||
session.commit()
|
||||
content = interaction.message.content
|
||||
content += f"\nApproved by <@{interaction.user.id}>."
|
||||
# remove the bot information embed. it should always be the first one.
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
from sqlalchemy.dialects.mysql import BIGINT, INTEGER, SMALLINT
|
||||
from sqlmodel import Column, Field, ForeignKey, Relationship, Session, SQLModel, UniqueConstraint, create_engine
|
||||
|
||||
|
||||
class Guild(SQLModel, table=True):
|
||||
"""
|
||||
Represents a Guild entity in the database.
|
||||
|
||||
Attributes:
|
||||
id (int): The unique identifier for the guild.
|
||||
name (str): The name of the guild.
|
||||
submission_channel (int): The ID of the submission channel associated with the guild.
|
||||
verification_channel (int): The ID of the verification channel associated with the guild.
|
||||
active (bool): Indicates whether the guild is active. Defaults to True.
|
||||
category_groups (list[CategoryGroup]): A list of category groups associated with the guild.
|
||||
"""
|
||||
|
||||
__tablename__: str = "Guilds"
|
||||
|
||||
id: int = Field(sa_column=Column(BIGINT(unsigned=True), primary_key=True, nullable=False))
|
||||
name: str = Field(max_length=95)
|
||||
submission_channel: int = Field(sa_column=Column(BIGINT(unsigned=True)))
|
||||
verification_channel: int = Field(sa_column=Column(BIGINT(unsigned=True)))
|
||||
active: bool = Field(default=True)
|
||||
|
||||
category_groups: list["CategoryGroup"] = Relationship(back_populates="guild", cascade_delete=True)
|
||||
|
||||
|
||||
class CategoryGroup(SQLModel, table=True):
|
||||
"""
|
||||
Represents a category group in the database.
|
||||
|
||||
Attributes:
|
||||
id (int | None): The primary key of the category group.
|
||||
name (str): The name of the category group, with a maximum length of 50 characters.
|
||||
channel_id (int): The ID of the channel associated with the category group.
|
||||
guild_id (int): The ID of the guild associated with the category group.
|
||||
message_id (int): The ID of the message associated with the category group.
|
||||
pad_length (int): The padding length for the category group, default is 12.
|
||||
username_length (int): The username length for the category group, default is 12.
|
||||
guild (Guild | None): The guild relationship back-populated from the Guild model.
|
||||
"""
|
||||
|
||||
__tablename__: str = "CategoryGroups"
|
||||
|
||||
id: int | None = Field(default=None, primary_key=True)
|
||||
name: str = Field(max_length=50)
|
||||
channel_id: int = Field(sa_column=Column(BIGINT(unsigned=True)))
|
||||
guild_id: int = Field(
|
||||
sa_column=Column(
|
||||
BIGINT(unsigned=True),
|
||||
ForeignKey("Guilds.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
)
|
||||
)
|
||||
message_id: int = Field(sa_column=Column(BIGINT(unsigned=True)))
|
||||
pad_length: int = Field(default=12, sa_column=Column(SMALLINT(unsigned=True)))
|
||||
username_length: int = Field(default=12, sa_column=Column(SMALLINT(unsigned=True)))
|
||||
|
||||
__table_args__ = (UniqueConstraint("guild_id", "name", name="UniqueGuildCategoryGroup"),)
|
||||
|
||||
guild: Guild | None = Relationship(back_populates="category_groups")
|
||||
categories: list["Category"] | None = Relationship(back_populates="category_group", cascade_delete=True)
|
||||
|
||||
|
||||
class Category(SQLModel, table=True):
|
||||
__tablename__: str = "Categories"
|
||||
|
||||
id: int | None = Field(default=None, primary_key=True)
|
||||
name: str = Field(max_length=30)
|
||||
group_id: int = Field(
|
||||
sa_column=Column(
|
||||
INTEGER(unsigned=True),
|
||||
ForeignKey("CategoryGroups.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
)
|
||||
)
|
||||
size: int = Field(sa_column=Column(SMALLINT(unsigned=True), default=3, nullable=False))
|
||||
is_ascending: bool = Field(default=True, nullable=False)
|
||||
is_time_record: bool = Field(default=False, nullable=False)
|
||||
is_validated: bool = Field(default=True, nullable=False)
|
||||
|
||||
__table_args__ = (UniqueConstraint("group_id", "name", name="UniqueCategoryInGroup"),)
|
||||
|
||||
category_group: CategoryGroup | None = Relationship(back_populates="categories")
|
||||
scores: list["Score"] | None = Relationship(back_populates="category", cascade_delete=True)
|
||||
|
||||
|
||||
class Score(SQLModel, table=True):
|
||||
__tablename__: str = "Scores"
|
||||
|
||||
username: str = Field(max_length=30, nullable=False, primary_key=True)
|
||||
score: float = Field(nullable=False)
|
||||
category_id: int = Field(
|
||||
sa_column=Column(
|
||||
INTEGER(unsigned=True),
|
||||
ForeignKey("Categories.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
primary_key=True,
|
||||
),
|
||||
)
|
||||
|
||||
category: Category | None = Relationship(back_populates="scores")
|
||||
|
||||
|
||||
class Submission(SQLModel, table=True):
|
||||
__tablename__: str = "Submissions"
|
||||
|
||||
category_id: int = Field(
|
||||
sa_column=Column(
|
||||
INTEGER(unsigned=True),
|
||||
nullable=False,
|
||||
primary_key=True,
|
||||
),
|
||||
)
|
||||
group_id: int = Field(
|
||||
sa_column=Column(
|
||||
INTEGER(unsigned=True),
|
||||
nullable=False,
|
||||
)
|
||||
)
|
||||
guild_id: int = Field(sa_column=Column(BIGINT(unsigned=True), nullable=False))
|
||||
message_id: int = Field(sa_column=Column(BIGINT(unsigned=True), nullable=False))
|
||||
score: str = Field(max_length=30, nullable=False)
|
||||
user_id: int = Field(sa_column=Column(BIGINT(unsigned=True), nullable=False))
|
||||
username: str = Field(max_length=30, nullable=False, primary_key=True)
|
||||
|
||||
|
||||
url = "sqlite:///database.db"
|
||||
engine = create_engine(url)
|
||||
SQLModel.metadata.create_all(engine)
|
||||
|
||||
with Session(engine) as session:
|
||||
guild = Guild(id=1, name="test guild", submission_channel=1, verification_channel=2)
|
||||
session.add(guild)
|
||||
|
||||
group1 = CategoryGroup(name="group1", channel_id=1, guild_id=1, message_id=1)
|
||||
group2 = CategoryGroup(name="group2", channel_id=2, guild_id=1, message_id=2)
|
||||
session.add(group1)
|
||||
session.add(group2)
|
||||
|
||||
session.commit()
|
||||
@@ -1,18 +1,32 @@
|
||||
"""Simple file to set up the sqlalchemy connection to database."""
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
# from sqlalchemy import create_engine
|
||||
# from sqlalchemy.ext.automap import automap_base
|
||||
from sqlmodel import BigInteger, Column, Field, SQLModel, create_engine
|
||||
from utilities import config
|
||||
|
||||
# connect with sql alchemy and autoload schema
|
||||
url = f"mysql+pymysql://{config.SQL_USER}:{config.SQL_PASS}@{config.SQL_HOST}/{config.SQL_DB}"
|
||||
engine = create_engine(url)
|
||||
Base = automap_base()
|
||||
Base.prepare(autoload_with=engine)
|
||||
|
||||
# define the classes
|
||||
Category = Base.classes.Categories
|
||||
CategoryGroup = Base.classes.CategoryGroups
|
||||
Guild = Base.classes.Guilds
|
||||
Score = Base.classes.Scores
|
||||
Submission = Base.classes.Submissions
|
||||
class Guilds(SQLModel, table=True):
|
||||
id: int = Field(sa_column=Column(BigInteger(), primary_key=True))
|
||||
name: str
|
||||
submission_channel: int = Field(sa_column=Column(BigInteger()))
|
||||
verification_channel: int = Field(sa_column=Column(BigInteger()))
|
||||
active: bool = Field(default=True)
|
||||
|
||||
|
||||
# connect with sql alchemy and autoload schema
|
||||
if config.ENVIRONMENT == "prod":
|
||||
url = f"mysql+pymysql://{config.SQL_USER}:{config.SQL_PASS}@{config.SQL_HOST}/{config.SQL_DB}"
|
||||
else:
|
||||
url = "sqlite:///database.db"
|
||||
engine = create_engine(url)
|
||||
SQLModel.metadata.create_all(engine)
|
||||
# Base = automap_base()
|
||||
# Base.prepare(autoload_with=engine)
|
||||
|
||||
# # define the classes
|
||||
# Category = Base.classes.Categories
|
||||
# CategoryGroup = Base.classes.CategoryGroups
|
||||
# Guild = Base.classes.Guilds
|
||||
# Score = Base.classes.Scores
|
||||
# Submission = Base.classes.Submissions
|
||||
|
||||
@@ -33,9 +33,6 @@ def main() -> None:
|
||||
# These need to be enabled in the developer portal as well
|
||||
intents = nextcord.Intents.default()
|
||||
|
||||
# Required in order to read messages (eg. prefix commands)
|
||||
intents.message_content = True
|
||||
|
||||
bot = commands.Bot(
|
||||
commands.when_mentioned_or(config.BOT_PREFIX),
|
||||
intents=intents,
|
||||
|
||||
+1
-2
@@ -11,7 +11,7 @@ dependencies = [
|
||||
"pymysql>=1.1.1",
|
||||
"python-dotenv>=1.0.1",
|
||||
"setuptools>=75.3.0",
|
||||
"sqlalchemy>=2.0.35",
|
||||
"sqlmodel>=0.0.22",
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
|
||||
@@ -47,7 +47,6 @@ exclude = [
|
||||
"node_modules",
|
||||
"site-packages",
|
||||
"venv",
|
||||
"dakiny-messages", # Don't need to lint this git repo.
|
||||
]
|
||||
|
||||
# Same as Black.
|
||||
|
||||
+2
-3
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
Loads environment variables for use in bot.
|
||||
"""
|
||||
"""Loads environment variables for use in bot."""
|
||||
|
||||
import os
|
||||
|
||||
@@ -15,3 +13,4 @@ SQL_DB = os.getenv("SQL_DB", "")
|
||||
SQL_HOST = os.getenv("SQL_HOST", "")
|
||||
SQL_PASS = os.getenv("SQL_PASS", "")
|
||||
SQL_USER = os.getenv("SQL_USER", "")
|
||||
ENVIRONMENT: str = os.getenv("ENVIRONMENT", "prod")
|
||||
|
||||
+8
-40
@@ -1,8 +1,5 @@
|
||||
"""
|
||||
Contains various utlity functions for highscores bot
|
||||
"""
|
||||
"""Contains various utility functions for highscores bot."""
|
||||
|
||||
import json
|
||||
import time
|
||||
|
||||
import nextcord
|
||||
@@ -15,12 +12,11 @@ from database_setup.sql_data_classes import Category, CategoryGroup, Guild, Scor
|
||||
|
||||
MAX_LINE_LENGTH = 142
|
||||
|
||||
GUILDS = [1000247361639030804]
|
||||
|
||||
|
||||
def autofill_categories(guild_id: int, group_id: int, category_begin: str) -> "dict[str, str]":
|
||||
"""
|
||||
Returns all category names that start with category_begin.
|
||||
|
||||
If category_begin is empty, returns list of all category names.
|
||||
|
||||
Args:
|
||||
@@ -164,9 +160,12 @@ def autofill_users_in_guild(guild_id: int, user_begin: str) -> "list[str]":
|
||||
return users[:25]
|
||||
|
||||
|
||||
# TODO(imcompiling): #73 Address complexity warning.
|
||||
# 073
|
||||
def format_highscore_message(session: Session, group: CategoryGroup) -> str:
|
||||
"""
|
||||
Creates a formatted string for a boss's highscore discord message.
|
||||
Creates a formatted string for a category's highscore discord message.
|
||||
|
||||
This formatted string is in discord's code block to ensure monospace text.
|
||||
Loops through each category to build the message one place at a time.
|
||||
|
||||
@@ -213,7 +212,6 @@ def format_highscore_message(session: Session, group: CategoryGroup) -> str:
|
||||
str_list: list[str] = ["" for i in range(max_cat_size + 1)]
|
||||
groups_df = d_f.groupby("CategoryId")
|
||||
|
||||
# TODO figure out how to have less nests.
|
||||
for category in categories:
|
||||
# category name string
|
||||
str_list[0] += f"{category.CategoryName}".ljust(pad_length, " ")
|
||||
@@ -269,10 +267,8 @@ def format_highscore_message(session: Session, group: CategoryGroup) -> str:
|
||||
ret_string += string.rstrip() + "\n"
|
||||
|
||||
# add extra newline at category split unless there is already a space.
|
||||
if ((ind + 1) % (max_cat_size + 1)) == 0:
|
||||
# checking inside the other if to ensure called as little as possible.
|
||||
if not ret_string.endswith("\n\n"):
|
||||
ret_string += "\n"
|
||||
if ((ind + 1) % (max_cat_size + 1)) == 0 and not ret_string.endswith("\n\n"):
|
||||
ret_string += "\n"
|
||||
|
||||
return ret_string + "```"
|
||||
|
||||
@@ -400,31 +396,3 @@ async def submit_score(
|
||||
group = session.scalar(stmt)
|
||||
|
||||
await send_highscore_message(session, interaction.guild, group)
|
||||
|
||||
|
||||
def add_preset_configuration(guild_id: int, config_str: str) -> None:
|
||||
"""
|
||||
Adds an example configuration to a Guild. Uses guild id to know which guild and
|
||||
config name to open a file in example_config.
|
||||
|
||||
Args:
|
||||
guild_id (int): Guild id to add config to
|
||||
config_str (str): Config name to add
|
||||
"""
|
||||
with Session(engine) as session:
|
||||
with open(f"example_config/{config_str}.json", encoding="utf-8") as file:
|
||||
config = json.load(file)
|
||||
|
||||
for group_name, categorys in config["tables"].items():
|
||||
group_obj = CategoryGroup(GroupName=group_name, GuildId=guild_id)
|
||||
session.add(group_obj)
|
||||
for category_name in categorys:
|
||||
cat_obj = Category(
|
||||
CategoryName=category_name,
|
||||
Size=config["table_size"],
|
||||
IsTimeRecord=config["categories"][category_name]["is_time_record"],
|
||||
IsAscending=config["categories"][category_name]["ascending"],
|
||||
)
|
||||
session.add(cat_obj)
|
||||
|
||||
session.commit()
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies = [
|
||||
{ name = "pymysql" },
|
||||
{ name = "python-dotenv" },
|
||||
{ name = "setuptools" },
|
||||
{ name = "sqlalchemy" },
|
||||
{ name = "sqlmodel" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
@@ -28,7 +28,7 @@ requires-dist = [
|
||||
{ name = "pymysql", specifier = ">=1.1.1" },
|
||||
{ name = "python-dotenv", specifier = ">=1.0.1" },
|
||||
{ name = "setuptools", specifier = ">=75.3.0" },
|
||||
{ name = "sqlalchemy", specifier = ">=2.0.35" },
|
||||
{ name = "sqlmodel", specifier = ">=0.0.22" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
@@ -102,6 +102,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17", size = 7617 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
version = "0.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "24.2.0"
|
||||
@@ -425,6 +434,59 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc", size = 117552 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.10.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-types" },
|
||||
{ name = "pydantic-core" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b7/ae/d5220c5c52b158b1de7ca89fc5edb72f304a70a4c540c84c8844bf4008de/pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236", size = 761681 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/3c/8cc1cc84deffa6e25d2d0c688ebb80635dfdbf1dbea3e30c541c8cf4d860/pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584", size = 431696 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-core"
|
||||
version = "2.27.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fc/01/f3e5ac5e7c25833db5eb555f7b7ab24cd6f8c322d3a3ad2d67a952dc0abc/pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39", size = 413443 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/74/51c8a5482ca447871c93e142d9d4a92ead74de6c8dc5e66733e22c9bba89/pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0", size = 1893127 },
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/f3/c97e80721735868313c58b89d2de85fa80fe8dfeeed84dc51598b92a135e/pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef", size = 1811340 },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/91/840ec1375e686dbae1bd80a9e46c26a1e0083e1186abc610efa3d9a36180/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7", size = 1822900 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/31/4240bc96025035500c18adc149aa6ffdf1a0062a4b525c932065ceb4d868/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934", size = 1869177 },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/20/02fbaadb7808be578317015c462655c317a77a7c8f0ef274bc016a784c54/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6", size = 2038046 },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/86/7f306b904e6c9eccf0668248b3f272090e49c275bc488a7b88b0823444a4/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c", size = 2685386 },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/f0/49129b27c43396581a635d8710dae54a791b17dfc50c70164866bbf865e3/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2", size = 1997060 },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/0f/943b4af7cd416c477fd40b187036c4f89b416a33d3cc0ab7b82708a667aa/pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4", size = 2004870 },
|
||||
{ url = "https://files.pythonhosted.org/packages/35/40/aea70b5b1a63911c53a4c8117c0a828d6790483f858041f47bab0b779f44/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3", size = 1999822 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/b3/807b94fd337d58effc5498fd1a7a4d9d59af4133e83e32ae39a96fddec9d/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4", size = 2130364 },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/df/791c827cd4ee6efd59248dca9369fb35e80a9484462c33c6649a8d02b565/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57", size = 2158303 },
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/67/4e197c300976af185b7cef4c02203e175fb127e414125916bf1128b639a9/pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc", size = 1834064 },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/ea/cd7209a889163b8dcca139fe32b9687dd05249161a3edda62860430457a5/pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9", size = 1989046 },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/49/c54baab2f4658c26ac633d798dab66b4c3a9bbf47cff5284e9c182f4137a/pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b", size = 1885092 },
|
||||
{ url = "https://files.pythonhosted.org/packages/41/b1/9bc383f48f8002f99104e3acff6cba1231b29ef76cfa45d1506a5cad1f84/pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b", size = 1892709 },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/6c/e62b8657b834f3eb2961b49ec8e301eb99946245e70bf42c8817350cbefc/pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154", size = 1811273 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/15/52cfe49c8c986e081b863b102d6b859d9defc63446b642ccbbb3742bf371/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9", size = 1823027 },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/1c/b6f402cfc18ec0024120602bdbcebc7bdd5b856528c013bd4d13865ca473/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9", size = 1868888 },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/7b/8cb75b66ac37bc2975a3b7de99f3c6f355fcc4d89820b61dffa8f1e81677/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1", size = 2037738 },
|
||||
{ url = "https://files.pythonhosted.org/packages/c8/f1/786d8fe78970a06f61df22cba58e365ce304bf9b9f46cc71c8c424e0c334/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a", size = 2685138 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/74/d12b2cd841d8724dc8ffb13fc5cef86566a53ed358103150209ecd5d1999/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e", size = 1997025 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/6e/940bcd631bc4d9a06c9539b51f070b66e8f370ed0933f392db6ff350d873/pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4", size = 2004633 },
|
||||
{ url = "https://files.pythonhosted.org/packages/50/cc/a46b34f1708d82498c227d5d80ce615b2dd502ddcfd8376fc14a36655af1/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27", size = 1999404 },
|
||||
{ url = "https://files.pythonhosted.org/packages/ca/2d/c365cfa930ed23bc58c41463bae347d1005537dc8db79e998af8ba28d35e/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee", size = 2130130 },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/d7/eb64d015c350b7cdb371145b54d96c919d4db516817f31cd1c650cae3b21/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1", size = 2157946 },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/99/bddde3ddde76c03b65dfd5a66ab436c4e58ffc42927d4ff1198ffbf96f5f/pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130", size = 1834387 },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/47/82b5e846e01b26ac6f1893d3c5f9f3a2eb6ba79be26eef0b759b4fe72946/pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee", size = 1990453 },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pymysql"
|
||||
version = "1.1.1"
|
||||
@@ -536,6 +598,19 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b8/49/21633706dd6feb14cd3f7935fc00b60870ea057686035e1a99ae6d9d9d53/SQLAlchemy-2.0.36-py3-none-any.whl", hash = "sha256:fddbe92b4760c6f5d48162aef14824add991aeda8ddadb3c31d56eb15ca69f8e", size = 1883787 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlmodel"
|
||||
version = "0.0.22"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pydantic" },
|
||||
{ name = "sqlalchemy" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b5/39/8641040ab0d5e1d8a1c2325ae89a01ae659fc96c61a43d158fb71c9a0bf0/sqlmodel-0.0.22.tar.gz", hash = "sha256:7d37c882a30c43464d143e35e9ecaf945d88035e20117bf5ec2834a23cbe505e", size = 116392 }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/dd/b1/3af5104b716c420e40a6ea1b09886cae3a1b9f4538343875f637755cae5b/sqlmodel-0.0.22-py3-none-any.whl", hash = "sha256:a1ed13e28a1f4057cbf4ff6cdb4fc09e85702621d3259ba17b3c230bfb2f941b", size = 28276 },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.12.2"
|
||||
|
||||
Reference in New Issue
Block a user