This document provides guidance for AI agents working on the Abyssal Tome codebase.
This project uses uv for managing Python environments and dependencies, targeting Python 3.13.
-
Install
uv: If you don't haveuvinstalled, follow the official installation instructions from Astral'suvdocumentation. -
Create Virtual Environment: Navigate to the project root directory and run:
uv venv
This will create a virtual environment named
.venvin the project root. -
Activate Virtual Environment:
source .venv/bin/activate # On macOS/Linux # or .venv\\Scripts\\activate # On Windows
-
Install Dependencies: With the virtual environment activated, install project dependencies (including development dependencies) using:
uv sync --all-extras # Or `uv pip install -e .[dev]` if using older uv conventionsThis command reads
pyproject.tomland installs all specified packages.
We use ruff for formatting and linting, and ty for type checking. These tools are managed via uv tool as defined in pyproject.toml and run via pre-commit hooks.
-
Formatting (
ruff format): Code formatting is enforced byruff format. After activating your virtual environment (source .venv/bin/activate), you can run:ruff format . # OR, to be absolutely sure you're using the venv's ruff: # .venv/bin/python -m ruff format .
-
Linting (
ruff): Code linting is performed byruff. After activating your virtual environment, you can run:ruff . --fix # OR, to be absolutely sure: # .venv/bin/python -m ruff . --fix
-
Type Checking: Type checking setup has been deferred for now.
-
Pre-commit Hooks: Formatting and linting checks are configured as pre-commit hooks. These hooks now explicitly call the tools from the
.venv/bindirectory. Ensure pre-commit is installed (pip install pre-commitoruv pip install pre-commit) and hooks are set up (pre-commit install). They will run automatically on each commit. You can run them manually via:pre-commit run --all-files
-
Adding a new dependency:
uv pip install <package-name>
Then, manually add the package and its version to the appropriate section in
pyproject.toml([project.dependencies]or[project.optional-dependencies.dev]). -
Removing a dependency: Manually remove the package from
pyproject.toml. -
Updating dependencies: Modify the version specifiers in
pyproject.tomlas needed. -
After any changes to
pyproject.toml, re-synchronize your environment:uv sync --all-extras
- Core data structures are defined in
DATA_MODEL.md. If you alter data structures, updateDATA_MODEL.md. - Data processing scripts are in
scripts/. If these are modified, consider ifassets/data files need regeneration. FollowREADME.mdfor regeneration steps.
- Write clear, concise commit messages.
- Reference issues/features in commit messages or PR descriptions.
- Write clear, maintainable, and well-documented code compatible with Python 3.13.
- If unsure, ask for clarification.
- Ensure all checks (linting, type checking, tests) pass before submitting.
This AGENTS.md is based on the project's migration to uv, Python 3.13, ruff, and ty.