2.5 KiB
2.5 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a Python CLI client for the trygo webapp built with a hybrid development environment using both uv and Nix. The project has dual entry points: hello (hello_world package) and taco (trygo_py_cliclient.cli package).
Development Commands
Core Commands (via justfile)
just test- Run full test suite (ruff check + mypy + pytest)just fmt- Format code using nix fmt (includes ruff, nixfmt, etc.)just update-snapshots- Update test snapshots using syrupyjust build- Build the Python module (currently placeholder)just check- Run nix flake check for Nix environment validation
Direct Tool Commands
uv run pytest- Run tests with coverageuv run ruff check src tests- Lint codeuv run mypy src- Type checkinguv run pytest --snapshot-update- Update test snapshots
Architecture
Package Structure
src/hello_world/- Hello world demonstration packagesrc/trygo_py_cliclient/- Main CLI client packagecli/- Command-line interface and argument parsingconfig/- Configuration management with TOML support
Configuration System
- Uses dataclasses for type-safe configuration (
src/trygo_py_cliclient/config/config.py) - TOML-based configuration files (
config.toml) - Supports logging configuration and general application settings
Development Environment
The project supports both uv and Nix environments:
- uv mode: Standard Python toolchain with uv for dependency management
- Nix mode: Reproducible environment with integrated formatting tools
- Environment detection via
DO_NIX_CUSTOMenvironment variable
Testing
- pytest with syrupy for snapshot testing
- Coverage reporting enabled (50% minimum)
- Test configuration in pyproject.toml with XML and HTML output
Code Quality
- ruff for linting and formatting (tab indentation style)
- mypy for type checking
- flake8 for additional linting
- treefmt.nix for comprehensive formatting in Nix environment
Entry Points
hellocommand maps tohello_world:maintacocommand maps totrygo_py_cliclient.cli:main
Configuration Files
pyproject.toml- Python project configuration and dependenciesconfig.toml- Application runtime configurationflake.nix- Nix development environmenttreefmt.nix- Code formatting configurationjustfile- Development task automation