소스 검색

darkirc/bots: update README to instruct to use virtual envs and add seperate requirements files

dasman 1 년 전
부모
커밋
c22de43e1e

+ 1 - 0
bin/darkirc/script/.gitignore

@@ -0,0 +1 @@
+venv*

+ 45 - 17
bin/darkirc/script/README.md

@@ -21,39 +21,23 @@ is done through `meetbot_cfg.py`.
 `titlebot.py` is a bot used to print the title of a website provided by
 a link in a `PRIVMSG`.
 
-### Requirements
- `pip install beautifulsoup4 requests`
-
 ## `tweetifier`
 `tweetifier` is yet another bot that recognizes Twitter links, fetch
 the tweet text and print it out in irc.
 
-### Requirments
- `pip install tweety-ns`
-
 ## `taubot`
 sends notifications about some `tau` commands (namely: adding or 
 stopping a task, changing state, reassigning and new comments) to 
 desired channels in `darkirc`. 
 
-### Requirements
- `pip install argparse`
-
 ## `mirror-bot`
 sends a copy of the message sent in an IRC server to another.
 
-### Requirements
- `pip install argparse`
-
 ## `commitbot`
 sends notifications about pushed code to `github` to desired channels 
 in `darkirc`. 
 
-### Requirements
- - `pip install https.server`
- - github webhook
-
- ## `test-bot`
+## `test-bot`
 sends a response to user sent 'test' or 'echo' `PrivMsg`s.
 
 ## Setup
@@ -63,5 +47,49 @@ sends a response to user sent 'test' or 'echo' `PrivMsg`s.
 * Run a `darkirc` instance, make sure to point it to the new config.
 * Run the bot script.
 
+
+## Run
+
+### Using a venv
+
+All these bots are working on and require Python 3.12.7. Make sure 
+Python is installed and on the latest version.
+
+Depending on your setup you may need to install a virtual environment
+for Python. Do so as follows:
+
+```shell
+% python -m venv venv_{bot_name}
+% source venv_{bot_name}/bin/activate
+```
+
+Then install the requirements:
+
+```shell
+% pip install -r requirements_{bot_name}.txt
+```
+
+Run bot:
+
+```shell
+% python {bot_script}.py
+```
+
+You will need to reactivate the venv in your current terminal session
+each time you use the bot as follows:
+
+```shell
+% source venv_{bot_name}/bin/activate
+```
+
+### Without a venv
+
+If you don't require a venv, install the requirements and run needed bot as follows:
+
+```shell
+% pip install -r requirements.txt
+% python {bot_script}.py
+```
+
 **Notes:**
 * Make sure the `irc_listen` is the same in config and in bot script.

+ 1 - 0
bin/darkirc/script/bots/requirements_commitbot.txt

@@ -0,0 +1 @@
+https.server

+ 1 - 0
bin/darkirc/script/bots/requirements_tau_mirror.txt

@@ -0,0 +1 @@
+argparse

+ 2 - 0
bin/darkirc/script/bots/requirements_title.txt

@@ -0,0 +1,2 @@
+beautifulsoup4
+requests

+ 1 - 0
bin/darkirc/script/bots/requirements_tweety.txt

@@ -0,0 +1 @@
+tweety-ns