Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[run]
source = killua
omit =
killua/tests/*
killua/download.py
killua/migrate.py

[report]
fail_under = 70
show_missing = True
skip_empty = True
precision = 1
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if __name__ == .__main__.:

[html]
directory = htmlcov

[xml]
output = coverage.xml
3 changes: 2 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ TOKEN="bot token"
PXLAPI="plxapi token"
PATREON="patreon token"
DBL_TOKEN="discord bot list token"
TOPGG_TOKEN="top.gg token"
# v1 only: Top.gg project page → Integrations & API → create/copy token (not legacy v0 bot token)
TOPGG_TOKEN=
API_KEY="key used in Killua API"
MODE="dev"
HASH_SECRET="hash secret"
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python tests and coverage

on:
push:
branches: [main, master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt

- name: Command vs test class inventory (report)
run: python scripts/check_test_commands.py

- name: Download cards for tests
run: python -m killua --download public

- name: Tests and coverage gate
run: |
coverage run -m killua -t
coverage report
coverage xml
19 changes: 0 additions & 19 deletions .github/workflows/sonarqube-analysis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ assets/cdn/*
#python stuff
**/__pycache__

# coverage.py
htmlcov/
.coverage
.coverage.*
coverage.xml

# Rust build
**/target

**/env
**/.venv

**/.DS_Store
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ While running Killua using Docker is more convenient, running from source is mor
> Not running Killua in Docker will make you unable to use Grafana or Prometheus. The code handles this on its own but if you want to use either of these you must run Killua using docker-compose. You also do not need to run the rust proxy as the IPC connection will be direct.

### Bot process
Note: Killua runs on Python 3.9. Some later versions introduce breaking changes and are not supported.
Note: Killua supports **Python 3.9–3.13**. Use a virtual environment matching your installed version (`python3 -m venv env`).

First, set up a virtual environment. Do so with `python3 -m venv env; source env/bin/activate` (for linux and macOS). To leave the virtual environment after you are done, simply run `deactivate`

Expand Down Expand Up @@ -257,7 +257,7 @@ To start the API, ideally you should use a different Terminal or screen/tmux ses

<details>
<summary><b>Running using Docker</b></summary>
Running from Docker, while taking longer to start up, is much more convenient and allows you to use Grafana and Prometheus. To run Killua using Docker, follow these steps:
Running from Docker, while taking longer to start up, is much more convenient and allows you to use Grafana and Prometheus. The bot image is built on **Python 3.13** (`killua/Dockerfile`). To run Killua using Docker, follow these steps:


1) Clone the repository (you need the `docker-compose.yml` file)
Expand Down
2 changes: 1 addition & 1 deletion alloy/config.alloy
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ discovery.relabel "docker_logs_filter" {

rule {
source_labels = ["__meta_docker_container_name"]
regex = "/(api|bot|proxy)"
regex = "/(rust_api|python_bot|zmq_proxy|api|bot|proxy)"
action = "keep"
}

Expand Down
Loading
Loading