diff --git a/.gitea/template b/.gitea/template index dde8dec..110d621 100644 --- a/.gitea/template +++ b/.gitea/template @@ -1,2 +1,3 @@ .gitea/workflows/*.yml -bot.py \ No newline at end of file +main.py +pyproject.toml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 872ffcc..8eb0026 100644 --- a/.gitignore +++ b/.gitignore @@ -125,9 +125,6 @@ dmypy.json # Pyre type checker .pyre/ -# IDE -.vscode/ - # logging nextcord.log outputs/ \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..b8dd61b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "ms-python.vscode-pylance", + "ms-python.python", + "ms-python.debugpy", + "charliermarsh.ruff" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 7fc344e..9ecc6e2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,9 +6,9 @@ "configurations": [ { "name": "Python: Module", - "type": "python", + "type": "debugpy", "request": "launch", - "module": "bot", + "module": "main", "justMyCode": true } ] diff --git a/Dockerfile b/Dockerfile index 6688c05..89bfed0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,13 @@ -FROM python:3.10.6-slim - -RUN pip install --upgrade pip +FROM python:3.11.9-slim WORKDIR /home -COPY requirements.txt requirements.txt - COPY config.py config.py -COPY bot.py bot.py +COPY main.py main.py +COPY pyproject.toml pyproject.toml COPY cogs cogs/ -RUN pip install -r requirements.txt +RUN pip install --upgrade pip && pip install poetry && poetry export -f requirements.txt --output requirements.txt && pip install -r requirements.txt -CMD ["python3", "-u", "./bot.py"] \ No newline at end of file +CMD ["python3", "-u", "./main.py"] \ No newline at end of file diff --git a/bot.py b/main.py similarity index 100% rename from bot.py rename to main.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6732c23 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,96 @@ +[tool.poetry] +name = "${REPO_NAME}" +version = "0.1.0" +description = "" +authors = ["${REPO_OWNER}"] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +hydra-core = "1.3.2" +nextcord = "2.6.1" +python-dotenv = "1.0.0" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.ruff] +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 120 +indent-width = 4 + +# Assume Python 3.8 +target-version = "py38" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F", "D100", "D1"] +ignore = ["D107"] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = true + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic"