Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- Before opening an issue, please search existing issues -->

## Issue Type
- [ ] 🐛 Bug Report
- [ ] 💡 Feature Request
- [ ] 📚 Documentation Issue
- [ ] 🛠️ Development Discussion

## Environment
- Chainlit Community Version:
- Python Version:
- OS:
- Package Affected:

## For Bug Reports
### Description
<!-- Clear description of the unexpected behavior -->

### Steps to Reproduce
1.
2.
3.

### Expected vs Actual Behavior
<!-- What should happen vs what actually happens -->

### Relevant Logs/Screenshots
<!-- Attach any relevant logs or screenshots -->

## For Feature Requests
### Motivation
<!-- Why should this feature be implemented? -->

### Proposed Solution
<!-- Brief description of suggested implementation -->

### Alternative Solutions
<!-- Any alternative approaches considered -->

### Impact
<!-- Who benefits from this feature and how? -->

## Additional Context
<!-- Add any other context about the problem here -->

## Contribution Guidelines
- I agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md)
- I've read the [CONTRIBUTING.md](CONTRIBUTING.md)
- This issue is not a duplicate of existing issues

> 💡 For general questions, please use our [Discord community](https://discord.gg/k73SQ3FyUh)
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- Thank you for contributing to Chainlit Community! -->

## Description

<!-- Clearly describe what this PR changes and why -->

## Related Issue

<!-- Link to the GitHub issue this addresses (if applicable) -->

Fixes #

## Type of Change

- [ ] 🐛 Bug fix
- [ ] ✨ New feature
- [ ] ♻️ Refactoring
- [ ] 📚 Documentation update
- [ ] 🚀 CI/CD improvement
- [ ] ⚠️ Security fix

## Checklist

- [ ] ✅ Added/updated tests for changes
- [ ] ✅ Verified CI tests pass locally (`./scripts/ci.sh`)
- [ ] ✅ Updated package documentation (README.md)
- [ ] ✅ Considered Chainlit version compatibility
- [ ] ✅ Followed [Code of Conduct](CODE_OF_CONDUCT.md)

## Breaking Changes

<!-- Does this PR contain breaking changes? -->

- [ ] Yes (Please describe)
- [ ] No

## Additional Notes

<!-- Add any context about the implementation here -->
109 changes: 88 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Contributing to Chainlit Community

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.
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.

## Table of Contents

Expand All @@ -17,6 +19,7 @@ First off, thank you for considering contributing to the Chainlit Community repo

### Requirements

- [Python](https://python.org/) 3.10-3.12
- [uv](https://docs.astral.sh/uv/getting-started/installation/)

### Setting up
Expand All @@ -27,7 +30,53 @@ With uv installed, follow these steps to set up your development environment:

1. Install pre-commit hooks: `uv run pre-commit install --install-hooks`
This will enable automatic formatting, syntax checking and fixups for your contributions.
1. Done!
1. Install dependencies: `uv sync --all-packages`

## 🛠 Development Workflow

### CI Integration

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:

```bash
./scripts/ci.sh # Runs full test suite
```

### Code Quality

We enforce strict quality controls:

1. **Formatting**:
```bash
uv run ruff format . # Auto-format code
```
1. **Linting**:
```bash
uv run ruff check . # Validate code standards
```
1. **Type Checking**:
```bash
uv run pyright # Static type analysis
```

### Commit Hooks

Pre-commit hooks automatically:

- Format code with Ruff
- Check linting rules
- Validate package structures

Hooks run on every commit - no need to manually format!

### Adding packages

Expand All @@ -48,7 +97,8 @@ With uv installed, follow these steps to set up your development environment:

- 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.
- When reporting a bug, include as much detail as possible, including steps to reproduce, expected behavior, and
actual behavior.

### Pull Requests

Expand All @@ -60,31 +110,47 @@ With uv installed, follow these steps to set up your development environment:

## Coding Standards

- We use [Ruff](https://github.com/astral-sh/ruff) for code formatting and linting. Run `ruff check .` and `ruff format .` before committing.
- We use [Ruff](https://github.com/astral-sh/ruff) for code formatting and linting. The commit hooks automatically run
`ruff check .` and `ruff format .` when you commit, but we recommend setting up Ruff and Pyright in your editor.
- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for Python code.
- Use type hints wherever possible.
- Write descriptive variable and function names.
- Comment your code where necessary, but strive to make it self-documenting.
- For type checking, we use [Pyright](https://github.com/microsoft/pyright).

We strongly recommend setting up Ruff and Pyright in your text editor or IDE. This will help catch potential issues early in the development process.
## Editor Setup

### General Recommendations

- Install Ruff & Pyright extensions
- Enable "format on save"
- Set line length to 120 (matches Ruff config)

### VS Code Specific

1. Install extensions:
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
- [Pyright](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
1. Add to settings.json:
```json
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
},
"ruff.importStrategy": "fromEnvironment",
"python.analysis.typeCheckingMode": "strict"
}
```

## CI/Testing

- Write unit tests for all new code using pytest.
- Aim for at least 80% test coverage for any new code.
- Run the full ci suite locally suite before submitting a pull request:
```
./scripts/ci.sh
```
- Tests should be written to work against both the latest Chainlit release and the main branch.
All components maintain full test coverage of their public APIs. When contributing:

## Documentation

- Update the documentation for any new features or changes to existing functionality.
- Place all documentation in the `docs` folder.
- Use clear, concise language and provide examples where appropriate.
- If you're adding a new feature, include a usage example.
- Add tests for new functionality in `src/tests/`
- Preserve existing test patterns
- Validate against multiple Chainlit versions:
```bash
uv run pytest --chainlit-version=2.0.4,latest,main
```

## Community Expectations

Expand All @@ -95,6 +161,7 @@ We strongly recommend setting up Ruff and Pyright in your text editor or IDE. Th
- 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.
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.
Loading