chore(dev): update develop environment
This commit is contained in:
56
.devcontainer/devcontainer.json
Normal file
56
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"name": "OSU Lazer API",
|
||||||
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
|
"service": "devcontainer",
|
||||||
|
"shutdownAction": "stopCompose",
|
||||||
|
"workspaceFolder": "/workspaces/osu_lazer_api",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"ms-python.python",
|
||||||
|
"ms-python.vscode-pylance",
|
||||||
|
"detachhead.basedpyright",
|
||||||
|
"charliermarsh.ruff",
|
||||||
|
"ms-python.debugpy",
|
||||||
|
"ms-vscode.vscode-json",
|
||||||
|
"redhat.vscode-yaml",
|
||||||
|
"ms-vscode.docker"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
||||||
|
"python.terminal.activateEnvironment": true,
|
||||||
|
"python.linting.enabled": true,
|
||||||
|
"python.linting.pylintEnabled": false,
|
||||||
|
"python.linting.flake8Enabled": false,
|
||||||
|
"python.formatting.provider": "none",
|
||||||
|
"[python]": {
|
||||||
|
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.organizeImports": "explicit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ruff.enable": true,
|
||||||
|
"ruff.lint.enable": true,
|
||||||
|
"ruff.format.enable": true,
|
||||||
|
"ruff.importStrategy": "fromEnvironment",
|
||||||
|
"files.exclude": {
|
||||||
|
"**/__pycache__": true,
|
||||||
|
"**/*.pyc": true
|
||||||
|
},
|
||||||
|
"python.testing.pytestEnabled": true,
|
||||||
|
"python.testing.unittestEnabled": false,
|
||||||
|
"python.testing.pytestArgs": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"terminal.integrated.defaultProfile.linux": "bash"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/va-h/devcontainers-features/uv:1": {}
|
||||||
|
},
|
||||||
|
"forwardPorts": [8000, 3306, 6379],
|
||||||
|
"postCreateCommand": "uv sync --dev && uv run pre-commit install",
|
||||||
|
"remoteUser": "vscode"
|
||||||
|
}
|
||||||
56
.devcontainer/docker-compose.yml
Normal file
56
.devcontainer/docker-compose.yml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
devcontainer:
|
||||||
|
image: mcr.microsoft.com/devcontainers/python:3.13
|
||||||
|
volumes:
|
||||||
|
- ../..:/workspaces:cached
|
||||||
|
- ~/.ssh:/home/vscode/.ssh:ro
|
||||||
|
command: sleep infinity
|
||||||
|
networks:
|
||||||
|
- devcontainer-network
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: mysql+aiomysql://osu_user:osu_password@mysql:3306/osu_api
|
||||||
|
REDIS_URL: redis://redis:6379/0
|
||||||
|
SECRET_KEY: dev-secret-key-change-in-production
|
||||||
|
OSU_CLIENT_ID: "5"
|
||||||
|
OSU_CLIENT_SECRET: "FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk"
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: osu_api
|
||||||
|
MYSQL_USER: osu_user
|
||||||
|
MYSQL_PASSWORD: osu_password
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- mysql-data:/var/lib/mysql
|
||||||
|
- ../mysql-init:/docker-entrypoint-initdb.d:cached
|
||||||
|
networks:
|
||||||
|
- devcontainer-network
|
||||||
|
command: --default-authentication-plugin=mysql_native_password
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
networks:
|
||||||
|
- devcontainer-network
|
||||||
|
command: redis-server --appendonly yes
|
||||||
|
|
||||||
|
networks:
|
||||||
|
devcontainer-network:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mysql-data:
|
||||||
|
redis-data:
|
||||||
28
.editorconfig
Normal file
28
.editorconfig
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# Makefiles always use tabs for indentation
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
# Batch files use tabs for indentation
|
||||||
|
[*.bat]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
# Matches the exact files either package.json or .travis.yml
|
||||||
|
[{package.json,.travis.yml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[{*.py,*.pyi}]
|
||||||
|
indent_size = 4
|
||||||
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Server",
|
"name": "Server",
|
||||||
"type": "debugpy",
|
"type": "debugpy",
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .router import router as signalr_router
|
from .router import router as signalr_router
|
||||||
|
|
||||||
|
__all__ = ["signalr_router"]
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class Hub:
|
|||||||
args: list[Any] | None = packet[3]
|
args: list[Any] | None = packet[3]
|
||||||
if args is None:
|
if args is None:
|
||||||
args = []
|
args = []
|
||||||
streams: list[str] | None = packet[4] # TODO: stream support
|
# streams: list[str] | None = packet[4] # TODO: stream support
|
||||||
code = ResultKind.VOID
|
code = ResultKind.VOID
|
||||||
result = None
|
result = None
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user