Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.62 KB

File metadata and controls

60 lines (41 loc) · 1.62 KB

Contributing to optimadetosql

Thank you for your interest in contributing! This document covers the essential setup and workflows.

Development Setup

Requires Python >= 3.11.

pip install -e ".[dev]"

This installs the package in editable mode along with dev dependencies: pytest, mypy, and ruff.

Running Tests

pytest

All tests live under tests/. Tests are organized by module:

  • test_translator.py -- core translation logic
  • test_mapper.py -- DynamicMapper and MapperRegistry
  • test_response.py -- response builder and helpers
  • test_behaviors.py -- individual behavior classes
  • test_behaviors_integration.py -- end-to-end behavior + translation tests

Linting and Type Checking

ruff check .
mypy optimadetosql

Please run both before submitting changes.

Code Style

  • Python 3.11+ features are welcome (e.g., X | Y union syntax, type[X] generics).
  • Avoid legacy typing module aliases (Dict, Optional, Tuple) -- use built-in generics.
  • All Rule.apply() methods must have full type annotations matching the base class signature.
  • Private names start with _; only public names should appear in __all__.

Pull Requests

  1. Fork the repository and create a branch from master.
  2. Make focused changes with clear commit messages.
  3. Add or update tests as needed.
  4. Run pytest, ruff check ., and mypy optimadetosql before pushing.
  5. Open a PR with a description of the change and its motivation.

Reporting Issues

Please include:

  • Python version
  • Steps to reproduce
  • Expected vs actual behavior
  • Relevant code snippets or error output