From a8bb62dcf30a2fbf7dd8ce7feb1958fc30a43e8a Mon Sep 17 00:00:00 2001 From: cswimr Date: Sat, 25 Jan 2025 14:39:24 -0500 Subject: [PATCH 1/5] fix(devcontainer): ensure pip is installed in the devcontainer this is being done because Red-DiscordBot requires pip to be installed to function, but does not declare it as a dependency. this is only a problem when uv is being used to install dependencies in an environment where pip is not present. so, we ensure pip is present! --- .devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 19d07ab..c08c396 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,4 +31,5 @@ COPY --from=uv --chown=vscode: /uv /uvx /bin/ COPY --from=python --chown=vscode: /usr/local /usr/local RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python; \ - python --version + python --version; \ + python -m ensurepip From 7369f5810ae6d6c08d8436a9065542c1fef7b85a Mon Sep 17 00:00:00 2001 From: cswimr Date: Sat, 25 Jan 2025 14:43:02 -0500 Subject: [PATCH 2/5] fix(devcontainer): chown workspace directory for some reason, the default `.data` mount is not owned by the `vscode` user (on my system at least), so we `chown` it to ensure that `uv run redbot-setup` can write to the directory. --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 23d0b75..104770e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -30,6 +30,6 @@ "PROJECT_DIR": "/workspaces/SeaCogs" }, "mounts": ["source=seacogs-persistent-data,target=/workspaces/SeaCogs/.data,type=volume"], - "postCreateCommand": "uv sync --frozen", + "postCreateCommand": "uv sync --frozen && sudo chown -R vscode:vscode /workspaces/SeaCogs/.data", "remoteUser": "vscode" } From 9b60a8f01e0b28e1cae1fbc923338ce8347b76b3 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sat, 25 Jan 2025 15:47:05 -0500 Subject: [PATCH 3/5] chore(vscode): add `-vvv` argument to launch & debug --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d4d69e..44c2cf3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "debugpy", "request": "launch", "module": "redbot", - "args": ["local"] + "args": ["local", "-vvv"] } ] } From f831bfcdd59120f8f08fc9849c756b3c18729e29 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sat, 25 Jan 2025 16:50:51 -0500 Subject: [PATCH 4/5] feat(vscode): add `--dev` argument to redbot args --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 44c2cf3..84a95c2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "debugpy", "request": "launch", "module": "redbot", - "args": ["local", "-vvv"] + "args": ["local", "--dev", "-vvv"] } ] } From 78f036da48d6daa55e645283e7c48d7275b7ec75 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sat, 25 Jan 2025 22:50:35 +0000 Subject: [PATCH 5/5] feat(devcontainer): initialize redbot instance in postCreateCommand --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 104770e..06e81b7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -30,6 +30,6 @@ "PROJECT_DIR": "/workspaces/SeaCogs" }, "mounts": ["source=seacogs-persistent-data,target=/workspaces/SeaCogs/.data,type=volume"], - "postCreateCommand": "uv sync --frozen && sudo chown -R vscode:vscode /workspaces/SeaCogs/.data", + "postCreateCommand": "uv sync --frozen && sudo chown -R vscode:vscode /workspaces/SeaCogs/.data && uv run redbot-setup --no-prompt --instance-name=local --data-path=/workspaces/SeaCogs/.data --backend=json", "remoteUser": "vscode" }