From bfe00bbb1940130db6877107ca66032588e7700c Mon Sep 17 00:00:00 2001 From: artie Date: Sat, 27 Apr 2024 12:36:28 +0200 Subject: [PATCH] fixes and improvements --- Makefile | 16 +++++++++++++--- README.md | 31 ++++++++++++++++++++++++++++++- artemis/bot.py | 1 - 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 29d37b0..03fb784 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,21 @@ ENV=env BIN=$(ENV)/bin +PYTHON=$(BIN)/python +PIP=$(BIN)/pip + +.PHONY: venv install dev watch clean + +venv: + python3 -m venv env install: - $(BIN)/pip install -Ur requirements.txt + $(PIP) install -Ur requirements.txt dev: - source $(BIN)/activate; pnpx nodemon bot.py + $(PYTHON) -m artemis.bot + +watch: + pnpx nodemon -e py,toml -x $(PYTHON) -m artemis.bot clean: - rm -rf venv + rm -rf env diff --git a/README.md b/README.md index 1f3ec27..ac6d99c 100644 --- a/README.md +++ b/README.md @@ -1 +1,30 @@ -### beep boop \ No newline at end of file +### Virtual env setup +``` +make venv +``` + +### Installing dependencies +``` +make install +``` + +### Launching dev +``` +make dev +``` + +### Launching dev + watch +``` +make watch +``` + +### Launching prod +``` +pm2 start +``` + +### Launching prod (manual) +``` +. env/bin/activate +ENV=production python3 -m artemis.bot +``` diff --git a/artemis/bot.py b/artemis/bot.py index 16a0045..2061191 100644 --- a/artemis/bot.py +++ b/artemis/bot.py @@ -7,7 +7,6 @@ import sys import time import traceback from functools import cached_property -from pkgutil import iter_modules from typing import Optional import aiohttp