unitsauce 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unitsauce-0.1.1.dist-info/METADATA +163 -0
- {unitsauce-0.1.0.dist-info → unitsauce-0.1.1.dist-info}/RECORD +5 -5
- unitsauce-0.1.0.dist-info/METADATA +0 -48
- {unitsauce-0.1.0.dist-info → unitsauce-0.1.1.dist-info}/WHEEL +0 -0
- {unitsauce-0.1.0.dist-info → unitsauce-0.1.1.dist-info}/entry_points.txt +0 -0
- {unitsauce-0.1.0.dist-info → unitsauce-0.1.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: unitsauce
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: AI-powered test failure analysis and fix suggestions
|
|
5
|
+
Author: Zan Starasinic
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/zanstarasinic/unitsauce
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: anthropic
|
|
11
|
+
Requires-Dist: python-dotenv
|
|
12
|
+
Requires-Dist: art
|
|
13
|
+
Requires-Dist: rich
|
|
14
|
+
Requires-Dist: pytest
|
|
15
|
+
Requires-Dist: pytest-json-report
|
|
16
|
+
|
|
17
|
+
# UnitSauce
|
|
18
|
+
|
|
19
|
+
AI-powered test failure analysis and auto-fix for Python projects.
|
|
20
|
+
|
|
21
|
+
UnitSauce analyzes failing tests, identifies bugs in your code changes, and generates fixes using Claude AI. Works as a CLI tool or GitHub Action.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Automatic failure detection** — Runs pytest and identifies failing tests
|
|
28
|
+
- **AI-powered analysis** — Uses Claude to understand the bug from git diff
|
|
29
|
+
- **Smart fixes** — Generates minimal code or test fixes
|
|
30
|
+
- **Verification** — Confirms the fix actually works before reporting
|
|
31
|
+
- **PR comments** — Posts fix suggestions directly to your pull request
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### CLI Usage
|
|
38
|
+
```bash
|
|
39
|
+
pip install unitsauce
|
|
40
|
+
```
|
|
41
|
+
```bash
|
|
42
|
+
# Auto-detect whether to fix code or test
|
|
43
|
+
unitsauce /path/to/project
|
|
44
|
+
|
|
45
|
+
# Force fix code only
|
|
46
|
+
unitsauce /path/to/project --mode code
|
|
47
|
+
|
|
48
|
+
# Force fix test only
|
|
49
|
+
unitsauce /path/to/project --mode test
|
|
50
|
+
|
|
51
|
+
# Output as markdown
|
|
52
|
+
unitsauce /path/to/project --output markdown
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### GitHub Action
|
|
56
|
+
|
|
57
|
+
Add to your workflow (`.github/workflows/test.yml`):
|
|
58
|
+
```yaml
|
|
59
|
+
name: Tests
|
|
60
|
+
on:
|
|
61
|
+
pull_request:
|
|
62
|
+
|
|
63
|
+
permissions:
|
|
64
|
+
pull-requests: write
|
|
65
|
+
|
|
66
|
+
jobs:
|
|
67
|
+
test:
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
with:
|
|
72
|
+
fetch-depth: 2
|
|
73
|
+
|
|
74
|
+
- uses: actions/setup-python@v5
|
|
75
|
+
with:
|
|
76
|
+
python-version: '3.11'
|
|
77
|
+
|
|
78
|
+
- name: Install dependencies
|
|
79
|
+
run: pip install pytest
|
|
80
|
+
|
|
81
|
+
- name: Run tests
|
|
82
|
+
run: pytest
|
|
83
|
+
|
|
84
|
+
- name: UnitSauce Analysis
|
|
85
|
+
if: failure()
|
|
86
|
+
uses: zanstarasinic/unitsauce@main
|
|
87
|
+
env:
|
|
88
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
89
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
### CLI Options
|
|
97
|
+
|
|
98
|
+
| Option | Description | Default |
|
|
99
|
+
|--------|-------------|---------|
|
|
100
|
+
| `--mode` | `auto`, `code`, or `test` | `auto` |
|
|
101
|
+
| `--output` | `console`, `markdown`, or `json` | `console` |
|
|
102
|
+
|
|
103
|
+
### Environment Variables
|
|
104
|
+
|
|
105
|
+
| Variable | Required | Description |
|
|
106
|
+
|----------|----------|-------------|
|
|
107
|
+
| `ANTHROPIC_API_KEY` | Yes | Your Anthropic API key |
|
|
108
|
+
| `GITHUB_TOKEN` | For PR comments | Provided automatically by GitHub Actions |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Requirements
|
|
113
|
+
|
|
114
|
+
- Python 3.10+
|
|
115
|
+
- Git repository
|
|
116
|
+
- Anthropic API key
|
|
117
|
+
- pytest
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## How It Works
|
|
122
|
+
|
|
123
|
+
1. Detects failures — Runs pytest and collects failing tests
|
|
124
|
+
2. Analyzes changes — Gets git diff to see what changed
|
|
125
|
+
3. Identifies affected code — Maps failures to modified functions
|
|
126
|
+
4. Generates fix — Sends context to Claude, gets minimal fix
|
|
127
|
+
5. Verifies — Applies fix, runs test again to confirm
|
|
128
|
+
6. Reports — Shows diff or posts PR comment
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Example PR Comment
|
|
133
|
+
```
|
|
134
|
+
UnitSauce Analysis
|
|
135
|
+
|
|
136
|
+
Found 1 failing test(s), fixed 1.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
test_calculator.py::test_add
|
|
141
|
+
|
|
142
|
+
Error: assert 6 == 5
|
|
143
|
+
|
|
144
|
+
Fixed by: Updating test in test_calculator.py
|
|
145
|
+
|
|
146
|
+
- assert add(2, 3) == 5
|
|
147
|
+
+ assert add(2, 3) == 6
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Local Development
|
|
153
|
+
```bash
|
|
154
|
+
git clone https://github.com/zanstarasinic/unitsauce.git
|
|
155
|
+
cd unitsauce
|
|
156
|
+
pip install -e .
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|
|
@@ -7,8 +7,8 @@ unitsauce/models.py,sha256=l40OcAAoFrysma83A1vpbUi_5uD2Yh5TmGfGzd_AgWc,1001
|
|
|
7
7
|
unitsauce/output.py,sha256=wLnFEBq0o2Qms0FMOF6Fu7MLWTTBCw-zqFzdMupc7Aw,3447
|
|
8
8
|
unitsauce/prompts.py,sha256=2xaOEkYrXB-XawdJGoJOryaZjGX9YHQPF0bapnfsS8U,1708
|
|
9
9
|
unitsauce/utils.py,sha256=-XnwUGgsydBalq4GtSV0GJ63PeiPkf6jZBCs2BykxWw,476
|
|
10
|
-
unitsauce-0.1.
|
|
11
|
-
unitsauce-0.1.
|
|
12
|
-
unitsauce-0.1.
|
|
13
|
-
unitsauce-0.1.
|
|
14
|
-
unitsauce-0.1.
|
|
10
|
+
unitsauce-0.1.1.dist-info/METADATA,sha256=Fa6YQWSrRLymu31e-varQ4xvo8UHDHGl4HUp6w0D5is,3425
|
|
11
|
+
unitsauce-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
unitsauce-0.1.1.dist-info/entry_points.txt,sha256=QFdjrO3Rj2jkNqfwe0aY8JT5gYbHOWPPkvwxAsVynu8,50
|
|
13
|
+
unitsauce-0.1.1.dist-info/top_level.txt,sha256=44KP-G6eKDbMYc6daSbp1vcEDez-Q99MEWNqGL3Tx5E,10
|
|
14
|
+
unitsauce-0.1.1.dist-info/RECORD,,
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: unitsauce
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: AI-powered test failure analysis and fix suggestions
|
|
5
|
-
Author: Zan Starasinic
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/zanstarasinic/unitsauce
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
Requires-Dist: anthropic
|
|
11
|
-
Requires-Dist: python-dotenv
|
|
12
|
-
Requires-Dist: art
|
|
13
|
-
Requires-Dist: rich
|
|
14
|
-
Requires-Dist: pytest
|
|
15
|
-
Requires-Dist: pytest-json-report
|
|
16
|
-
|
|
17
|
-
# UnitSauce
|
|
18
|
-
|
|
19
|
-
AI-powered test fixer for Python projects.
|
|
20
|
-
|
|
21
|
-
## What it does
|
|
22
|
-
|
|
23
|
-
Analyzes failing tests, identifies bugs in recent code changes, and suggests fixes using Claude.
|
|
24
|
-
|
|
25
|
-
## Install
|
|
26
|
-
```bash
|
|
27
|
-
pip install -r requirements.txt
|
|
28
|
-
cp .env.example .env
|
|
29
|
-
# Add your Anthropic API key to .env
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
```bash
|
|
34
|
-
python main.py /path/to/your/project
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
The tool will:
|
|
38
|
-
1. Run pytest and detect failures
|
|
39
|
-
2. Analyze git diff to find recent changes
|
|
40
|
-
3. Ask if you want to fix the code or update the test
|
|
41
|
-
4. Generate and apply a fix
|
|
42
|
-
5. Verify the fix works
|
|
43
|
-
|
|
44
|
-
## Requirements
|
|
45
|
-
|
|
46
|
-
- Python 3.10+
|
|
47
|
-
- Anthropic API key
|
|
48
|
-
- Project must be a git repository
|
|
File without changes
|
|
File without changes
|
|
File without changes
|