Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 1.56 KB

File metadata and controls

78 lines (56 loc) · 1.56 KB

OneBot

OneBot is an IRC bot based on irc3.

Development Setup

This project uses uv for dependency management and ruff for code style.

Prerequisites

Installation

  1. Sync dependencies:
    uv sync
    This creates a virtual environment and installs all dependencies (including dev dependencies).

Code Standards

We use ruff for linting and formatting. Ensure all code is compliant before committing.

  • Check code:
    uv run ruff check .
  • Format code:
    uv run ruff format .

Testing

Tests are written using pytest.

  • Run tests:
    uv run pytest
  • Run full test suite (multi-environment):
    uv run tox
    This uses tox-uv to test across supported Python versions.

Project Structure

  • onebot/: Main package source code.
    • plugins/: OneBot plugins (features like lastfm, trakt, wolframalpha, etc.).
    • __init__.py: Entry point (run function).
  • tests/: Test suite.
    • fixtures/: Test data (betamax cassettes, JSON responses).
  • docs/: Sphinx documentation.
  • pyproject.toml: Project configuration, dependencies, and tool settings.

Common Tasks

Adding a Dependency

uv add <package_name>

Adding a Plugin

  1. Create a new file in onebot/plugins/.
  2. Implement the plugin class decorated with @irc3.plugin.
  3. Add tests in tests/.

Building Documentation

cd docs
make html