File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Codeflash
2+ on :
3+ pull_request :
4+ paths :
5+ # So that this workflow only runs when code within the target module is modified
6+ - ' pydantic_ai_slim/pydantic_ai/**'
7+ workflow_dispatch :
8+ concurrency :
9+ # Any new push to the PR will cancel the previous run, so that only the latest code is optimized
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+ jobs :
13+ optimize :
14+ name : Optimize new Python code
15+ # Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
16+ if : ${{ github.actor != 'codeflash-ai[bot]' }}
17+ runs-on : ubuntu-latest
18+ env :
19+ CODEFLASH_API_KEY : ${{ secrets.CODEFLASH_API_KEY }}
20+ steps :
21+ - name : 🛎️ Checkout
22+ uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
25+ - name : 🐍 Setup UV
26+ uses : astral-sh/setup-uv@v6
27+ with :
28+ enable-cache : true
29+ - name : 📦 Install Dependencies
30+ run : uv sync --package pydantic-ai-slim
31+ - name : ⚡️Codeflash Optimization
32+ run : uv run codeflash
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ dev = [
9898 " boto3-stubs[bedrock-runtime]" ,
9999 " strict-no-cover>=0.1.1" ,
100100 " pytest-xdist>=3.6.1" ,
101+ " codeflash>=0.15.4"
101102]
102103
103104[tool .hatch .metadata ]
Original file line number Diff line number Diff line change @@ -283,3 +283,10 @@ check-hidden = true
283283# Ignore "formatting" like **L**anguage
284284ignore-regex = ' \*\*[A-Z]\*\*[a-z]+\b'
285285ignore-words-list = ' asend,aci'
286+
287+ [tool .codeflash ]
288+ module-root = " pydantic_ai_slim/pydantic_ai"
289+ tests-root = " tests"
290+ test-framework = " pytest"
291+ ignore-paths = []
292+ formatter-cmds = [" ruff check --exit-zero --fix $file" , " ruff format $file" ]
You can’t perform that action at this time.
0 commit comments