|
1 | | -# Contributing |
| 1 | +# Contributing to scrapegraph-py |
2 | 2 |
|
3 | 3 | ## Setup |
4 | 4 |
|
5 | 5 | ```bash |
6 | 6 | uv sync |
7 | 7 | ``` |
8 | 8 |
|
| 9 | +## Development |
| 10 | + |
| 11 | +```bash |
| 12 | +uv build # build to dist/ |
| 13 | +uv run ruff check . # lint |
| 14 | +``` |
| 15 | + |
9 | 16 | ## Before committing |
10 | 17 |
|
| 18 | +Run all checks: |
| 19 | + |
11 | 20 | ```bash |
12 | | -uv run ruff check src/ tests/ # lint |
13 | | -uv run ruff format src/ tests/ # format |
14 | | -uv run pytest tests/test_client.py -v # tests |
| 21 | +uv run ruff format src/ tests/ # auto-fix formatting |
| 22 | +uv run ruff check src/ tests/ # check for errors |
| 23 | +uv run pytest tests/test_client.py -v # unit tests |
15 | 24 | ``` |
16 | 25 |
|
17 | | -Or all at once: |
| 26 | +## Testing |
18 | 27 |
|
19 | 28 | ```bash |
20 | | -uv run ruff check src/ tests/ && uv run ruff format src/ tests/ && uv run pytest tests/test_client.py -v |
| 29 | +uv run pytest tests/test_client.py -v # unit tests only |
| 30 | +uv run pytest tests/test_integration.py -v # live API tests (requires SGAI_API_KEY) |
21 | 31 | ``` |
22 | 32 |
|
23 | | -CI will reject PRs that fail lint or format checks. |
| 33 | +For integration tests, set `SGAI_API_KEY` in your environment or `.env` file. |
24 | 34 |
|
25 | | -## Running integration tests |
| 35 | +## Commit messages |
26 | 36 |
|
27 | | -Requires `SGAI_API_KEY` env var: |
| 37 | +Use conventional commits: |
28 | 38 |
|
29 | | -```bash |
30 | | -uv run pytest tests/test_integration.py -v |
31 | | -``` |
| 39 | +- `feat:` new feature |
| 40 | +- `fix:` bug fix |
| 41 | +- `refactor:` code change (no new feature, no bug fix) |
| 42 | +- `chore:` maintenance (deps, config) |
| 43 | +- `test:` add/update tests |
| 44 | +- `docs:` documentation |
| 45 | + |
| 46 | +## Pull requests |
| 47 | + |
| 48 | +1. Fork and create a branch from `main` |
| 49 | +2. Make changes |
| 50 | +3. Run all checks (see above) |
| 51 | +4. Submit PR to `main` |
| 52 | + |
| 53 | +## License |
| 54 | + |
| 55 | +MIT - contributions are licensed under the same license. |
0 commit comments