Skip to content

Commit

Permalink
2024 modernization (#188)
Browse files Browse the repository at this point in the history
* Switch to using uv for package management

* Reformat code with ruff

* Remove broken plugins

* Resolve most linter warnings

* First round of plugin pruning

* Clean up more plugins

* Move DID into FAQ command

* Remove prometheus

* Clean up dependencies; Remove sentiment analysis command to enable removing of NLTK

* WIP migration to module

* Re-implement sentry monitoring

* Basic plugin system

* Port help & LMGTFY

* Port number facts

* Port remainder of plugins

* Plugin shared base class

* __init__

* Add missed plugin to plugin list

* Update readme

* Upgrade dependencies

* Standardize on httpx, remove requests

* Fix dockerfile

* Add env to dockerignore

* Remove unused config values
  • Loading branch information
nint8835 authored Nov 24, 2024
1 parent dabf0d0 commit 4e5c80f
Show file tree
Hide file tree
Showing 127 changed files with 1,173 additions and 3,765 deletions.
17 changes: 15 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
data/
.dockerignore
.env
mounted_plugins/
.env.dist
.git
.github
.gitignore
.python-version
.ruff_cache
.venv
.vscode
**/__pycache__/
**/.DS_Store
docker-compose.yml
Dockerfile
LICENSE
README.md
3 changes: 0 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ AUTOMATA_VERIFIED_ROLE=
AUTOMATA_ENABLED_PLUGINS=
AUTOMATA_DISABLED_PLUGINS=
AUTOMATA_EXECUTIVE_DOCS_CHANNEL=
AUTOMATA_GENERAL_CHANNEL=
AUTOMATA_MEMBER_INTENTS_ENABLED=
AUTOMATA_STARBOARD_CHANNEL_ID=
AUTOMATA_STARBOARD_THRESHOLD=
AUTOMATA_DIARY_DAILY_CHANNEL=
WHITELIST_HTTP_API_BEARER_TOKEN=
SENTRY_DSN=
DISCORD_AUTH_URI=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ data/mongo/
### VisualStudioCode ###
.vscode/*
*.code-workspace
!.vscode/settings.json

### VisualStudioCode Patch ###
# Ignore all local history of files
Expand Down
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always",
"source.unusedImports": "always"
}
}
263 changes: 0 additions & 263 deletions Bot.py

This file was deleted.

15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM python:3.11-alpine3.18
COPY . /app
FROM ghcr.io/astral-sh/uv:python3.12-alpine

WORKDIR /app
RUN apk --update add --virtual build-dependencies gcc musl-dev libxml2-dev libxslt-dev --no-cache \
&& pip install -r requirements.txt \
&& apk del build-dependencies

CMD ["python", "Bot.py"]
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen
ENV PATH="/app/.venv/bin:$PATH"

COPY . .

CMD ["python", "-m", "automata"]
45 changes: 0 additions & 45 deletions Globals.py

This file was deleted.

13 changes: 0 additions & 13 deletions Plugin.py

This file was deleted.

Loading

0 comments on commit 4e5c80f

Please sign in to comment.