From 56406de693281d53a11466321a65ad09f2051da5 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Tue, 18 Mar 2025 10:48:48 -0400 Subject: [PATCH] Move things into a repo named module. --- $REPO_NAME_SNAKE/__init__.py | 1 + .../cogs}/commands/__init__.py | 0 .../cogs}/commands/hi.py | 2 +- main.py => $REPO_NAME_SNAKE/main.py | 0 settings.py => $REPO_NAME_SNAKE/settings.py | 0 .gitea/template | 4 ++-- .vscode/launch.json | 10 ++++----- Dockerfile | 6 ++--- config.py | 22 ------------------- 9 files changed, 12 insertions(+), 33 deletions(-) create mode 100644 $REPO_NAME_SNAKE/__init__.py rename {cogs => $REPO_NAME_SNAKE/cogs}/commands/__init__.py (100%) rename {cogs => $REPO_NAME_SNAKE/cogs}/commands/hi.py (90%) rename main.py => $REPO_NAME_SNAKE/main.py (100%) rename settings.py => $REPO_NAME_SNAKE/settings.py (100%) delete mode 100644 config.py diff --git a/$REPO_NAME_SNAKE/__init__.py b/$REPO_NAME_SNAKE/__init__.py new file mode 100644 index 0000000..5c6f685 --- /dev/null +++ b/$REPO_NAME_SNAKE/__init__.py @@ -0,0 +1 @@ +"""Empty init file for ${REPO_NAME_SNAKE} module.""" diff --git a/cogs/commands/__init__.py b/$REPO_NAME_SNAKE/cogs/commands/__init__.py similarity index 100% rename from cogs/commands/__init__.py rename to $REPO_NAME_SNAKE/cogs/commands/__init__.py diff --git a/cogs/commands/hi.py b/$REPO_NAME_SNAKE/cogs/commands/hi.py similarity index 90% rename from cogs/commands/hi.py rename to $REPO_NAME_SNAKE/cogs/commands/hi.py index 0a7a512..e6333c4 100644 --- a/cogs/commands/hi.py +++ b/$REPO_NAME_SNAKE/cogs/commands/hi.py @@ -7,7 +7,7 @@ from nextcord.ext import commands class HiCog(commands.Cog, name="Test commands."): """Class holds commands for testing.""" - def __init__(self, bot: nextcord.Bot) -> None: + def __init__(self, bot: commands.Bot) -> None: self.bot = bot @nextcord.slash_command() diff --git a/main.py b/$REPO_NAME_SNAKE/main.py similarity index 100% rename from main.py rename to $REPO_NAME_SNAKE/main.py diff --git a/settings.py b/$REPO_NAME_SNAKE/settings.py similarity index 100% rename from settings.py rename to $REPO_NAME_SNAKE/settings.py diff --git a/.gitea/template b/.gitea/template index fe0afa2..fa1baf7 100644 --- a/.gitea/template +++ b/.gitea/template @@ -1,5 +1,5 @@ +$REPO_NAME_SNAKE/* .gitea/workflows/*.yml -main.py +.vscode/launch.json pyproject.toml -settings.py Dockerfile \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 9ecc6e2..5c53f2c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,11 +5,11 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Module", - "type": "debugpy", - "request": "launch", - "module": "main", - "justMyCode": true + "name": "Python: Module", + "type": "debugpy", + "request": "${REPO_NAME_SNAKE}.launch", + "module": "main", + "justMyCode": true } ] } diff --git a/Dockerfile b/Dockerfile index 0fe2aba..89def11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,10 @@ FROM python:3.12.3-slim # install uv COPY --from=ghcr.io/astral-sh/uv:0.6.5 /uv /uvx /bin/ -COPY . /${REPO_NAME} +COPY . /${REPO_NAME_SNAKE} # Sync the project into a new environment, using the frozen lockfile -WORKDIR /${REPO_NAME} +WORKDIR /${REPO_NAME_SNAKE} RUN uv sync --frozen --no-dev -CMD ["uv", "run", "./main.py"] \ No newline at end of file +CMD ["uv", "run", "./${REPO_NAME_SNAKE}/main.py"] diff --git a/config.py b/config.py deleted file mode 100644 index 99a61a5..0000000 --- a/config.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -File contains classes defining the Hydra configuraton structure. -""" -from dataclasses import dataclass - - -@dataclass -class Params: - """ - Class defines the various configuration parameters. - """ - - discord_token: str - - -@dataclass -class BotConfig: - """ - Class defines all configs required for Dakiny Bot. - """ - - params: Params