First off, thank you for considering contributing to the Chainlit Community repository! It's people like you that make Chainlit such a great tool. This document provides guidelines and steps for contributing. Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
We use uv for package management.
With uv installed, follow these steps to set up your development environment:
- Install pre-commit hooks:
uv run pre-commit install --install-hooksThis will enable automatic formatting, syntax checking and fixups for your contributions. - Install dependencies:
uv sync --all-packages
Our CI system (GitHub Actions) automatically runs:
- Formatting checks (Ruff)
- Linting (Ruff)
- Type checking (Pyright)
- Unit tests (pytest) for the latest Chainlit release as well as current
main, across all supported Python versions - Dependency validation
Verify locally before pushing:
./scripts/ci.sh # Runs full test suiteWe enforce strict quality controls:
- Formatting:
uv run ruff format . # Auto-format code
- Linting:
uv run ruff check . # Validate code standards
- Type Checking:
uv run pyright # Static type analysis
Pre-commit hooks automatically:
- Format code with Ruff
- Check linting rules
- Validate package structures
Hooks run on every commit - no need to manually format!
- Copy (
cp -r) the package similar to what you want to create, e.g.:cp -r packages/data_layers/sqlalchemy packages/data_layers/bananadb - Rename references to previous data layer in filenames,
pyproject.tomlandREADME.md. - Add the package to
membersin[tool.uv.workspace]in the rootpyproject.toml:[tool.uv.workspace] members = [ ... "packages/data_layers/bananadb", ... ]
- Feel free to open issues to report bugs, suggest improvements, or propose new features.
- Before opening an issue, please check if a similar issue already exists.
- When reporting a bug, include as much detail as possible, including steps to reproduce, expected behavior, and actual behavior.
- Fork the repository and create your branch from
main. - If you've added code that should be tested, add tests.
- Ensure your code passes all tests and linting.
- Update the documentation, if necessary.
- Issue the pull request!
- We use Ruff for code formatting and linting. The commit hooks automatically run
ruff check .andruff format .when you commit, but we recommend setting up Ruff and Pyright in your editor. - Follow PEP 8 style guide for Python code.
- Use type hints wherever possible.
- Write descriptive variable and function names.
- Install Ruff & Pyright extensions
- Enable "format on save"
- Set line length to 120 (matches Ruff config)
- Install extensions:
- Add to settings.json:
{ "[python]": { "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true }, "ruff.importStrategy": "fromEnvironment", "python.analysis.typeCheckingMode": "strict" }
All components maintain full test coverage of their public APIs. When contributing:
- Add tests for new functionality in
src/tests/ - Preserve existing test patterns
- Validate against multiple Chainlit versions:
uv run pytest --chainlit-version=2.0.4,latest,main
- Be respectful and considerate in all communications.
- Adhere to the Chainlit Code of Conduct in all project-related interactions.
- Provide constructive feedback on pull requests.
- Help review other contributors' work.
- Share knowledge and assist others when possible.
- Focus on the goals of the project and avoid scope creep.
Remember, contributions to this repository should align with its goals and not replicate core Chainlit functionality. If you're unsure whether your contribution fits, feel free to open an issue for discussion first.
Thank you for contributing to Chainlit Community! Your efforts help make Chainlit better for everyone.