Multipurpose discord bot for the Zeusops community
Requires Python 3.12
Depends on what the code in there does.
Install the module first:
make install
# or
poetry install
Then inside the virtual environment, launch the command:
# Run single command inside virtualenv
poetry run zeusops-bot
# or
# Load the virtualenv first
poetry shell
# Then launch the command, staying in virtualenv
zeusops-bot
Suggest the following config via .env
:
export BOT_REFORGER_REFERENCE_CONFIG=data/reference_config.json
export BOT_REFORGER_CONFIG_FOLDER=data/generated/
export BOT_DISCORD_TOKEN=$(pass zeusops/testapp_operationbot_token)
This repository uses Python3.12, using
Poetry as package manager to define a
Python package inside src/zeusops_bot/
.
poetry
will create virtual environments if needed, fetch
dependencies, and install them for development.
For ease of development, a Makefile
is provided, use it like this:
make # equivalent to "make all" = install lint docs test build
# run only specific tasks:
make install
make lint
make test
# Combine tasks:
make install test
Once installed, the module's code can now be reached through running Python in Poetry:
$ poetry run python
>>> from zeusops_bot import main
>>> main("blabla")
This codebase uses pre-commit to run linting
tools like flake8
. Use pre-commit install
to install git
pre-commit hooks to force running these checks before any code can be
committed, use make lint
to run these manually. Testing is provided
by pytest
separately in make test
.
Documentation is generated via Sphinx, using the cool myst_parser plugin to support Markdown files like this one.
Other Sphinx plugins provide extra documentation features, like the recent sphinx-autodoc2 to generate API reference without headaches, and with myst-markdown support in docstrings too!
To build the documentation, run
# Requires the project dependencies provided by "make install"
make docs
# Generates docs/build/html/
To browse the web version of the documentation you just built, run:
make docs-serve
And remember that make
supports multiple targets, so you can generate the
documentation and serve it:
make docs docs-serve
This repository was created by the copier template available at gh:OverkillGuy/python-template, using version v1.8.1.