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
24 changes: 15 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@ jobs:
uv sync --all-extras --dev
shell: bash

- name: Load Cached Pre-Commit Dependencies
id: cached-pre-commit-dependencies
- name: Install prek
run: |
# Install prek using uv (recommended method)
uv tool install prek
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Load Cached Prek Dependencies
id: cached-prek-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/prek/
key: prek|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Execute Pre-Commit
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
- name: Execute Prek
run: prek run --show-diff-on-failure --color=always --all-files

coverage:
needs: validate
Expand Down Expand Up @@ -119,7 +125,7 @@ jobs:
shell: bash

- name: Upload Coverage to DeepSource
if: always()
if: always() && secrets.DEEPSOURCE_DSN != '' && needs.test-pr.result == 'success'
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
Expand Down Expand Up @@ -214,7 +220,7 @@ jobs:

coverage-pr:
needs: test-pr
if: github.event_name == 'pull_request' && always()
if: github.event_name == 'pull_request' && needs.test-pr.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -227,7 +233,7 @@ jobs:
name: coverage-pr-${{ github.sha }}

- name: Upload Coverage to DeepSource
if: always()
if: always() && secrets.DEEPSOURCE_DSN != '' && needs.test-pr.result == 'success'
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ tasks:
desc: "Install dependencies with uv"
cmds:
- uv sync --all-extras --all-packages
- pre-commit install && pre-commit install -hook-type commit-msg
- prek install && prek install --hook-type commit-msg

update:
desc: "Update the dependencies"
cmds:
- uv run uv-bump
- cd benchmarks && uv run uv-bump && cd -
- uv sync --all-extras --all-packages --upgrade
- pre-commit autoupdate
- prek autoupdate

test:
desc: "Run tests with pytest"
Expand All @@ -32,7 +32,7 @@ tasks:
lint:
desc: "Lint code with ruff and docs with markdownlint"
cmds:
- pre-commit run --all-files
- prek run --all-files

docs:build:
desc: "Build documentation"
Expand Down
7 changes: 4 additions & 3 deletions ai-rulez.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,10 @@ rules:
- Fix linting issues: `ruff check --fix`
- Type check: `mypy`

### Pre-commit
- Install hooks: `pre-commit install && pre-commit install --hook-type commit-msg`
- Run manually: `pre-commit run --all-files`
### Prek
- Install prek: `uv tool install prek`
- Install hooks: `prek install && prek install --hook-type commit-msg`
- Run manually: `prek run --all-files`

### Documentation
- Build docs: `uv run mkdocs build --clean --strict`
Expand Down
14 changes: 9 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ Thank you for contributing to Kreuzberg!
uv sync --all-extras --dev
```

1. **Install pre-commit hooks**:
1. **Install prek and hooks**:

```bash
pre-commit install && pre-commit install --hook-type commit-msg
# Install prek using uv (recommended)
uv tool install prek

# Install git hooks
prek install && prek install --hook-type commit-msg
```

## Development
Expand All @@ -42,8 +46,8 @@ uv run ruff check # Lint
uv run ruff check --fix # Auto-fix issues
uv run mypy # Type check

# Pre-commit
uv run pre-commit run --all-files # Run all checks manually
# Prek
prek run --all-files # Run all checks manually

# Documentation
uv run mkdocs serve # Serve docs locally
Expand All @@ -70,7 +74,7 @@ Use [Conventional Commits](https://www.conventionalcommits.org/):

- Python 3.10-3.13 supported
- System dependencies (optional): Tesseract, Pandoc
- Pre-commit runs automatically on commit
- Prek runs automatically on commit
- Join our [Discord](https://discord.gg/pXxagNK2zN) for help

## License
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ scripts.kreuzberg-mcp = "kreuzberg._mcp.server:main"
dev = [
"covdefaults>=2.3.0",
"mypy>=1.18.2",
"pre-commit>=4.3.0",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"pytest-mock>=3.15.1",
Expand Down
69 changes: 0 additions & 69 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.