Skip to content

Commit cc60a21

Browse files
Add contributor workflow guide
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 6dec52a commit cc60a21

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributing to Hyperbrowser Python SDK
2+
3+
Thanks for contributing! This guide keeps local development and CI behavior aligned.
4+
5+
## Prerequisites
6+
7+
- Python `>=3.9`
8+
- `pip`
9+
10+
## Local setup
11+
12+
```bash
13+
python -m pip install -e . pytest ruff build
14+
```
15+
16+
Or with Make:
17+
18+
```bash
19+
make install
20+
```
21+
22+
## Development workflow
23+
24+
1. Create a focused branch.
25+
2. Make a single logical change.
26+
3. Run relevant tests first (targeted), then full checks before opening a PR.
27+
4. Keep commits small and descriptive.
28+
29+
## Commands
30+
31+
### Linting and formatting
32+
33+
```bash
34+
python -m ruff check .
35+
python -m ruff format --check .
36+
```
37+
38+
Or:
39+
40+
```bash
41+
make lint
42+
make format-check
43+
```
44+
45+
### Tests
46+
47+
```bash
48+
python -m pytest -q
49+
```
50+
51+
Or:
52+
53+
```bash
54+
make test
55+
```
56+
57+
### Full local CI parity
58+
59+
```bash
60+
make ci
61+
```
62+
63+
This runs lint, format checks, compile checks, tests, and package build.
64+
65+
## Testing guidance
66+
67+
- Add tests for any bug fix or behavior change.
68+
- Keep sync/async behavior in parity where applicable.
69+
- Prefer deterministic unit tests over network-dependent tests.
70+
71+
## Code quality conventions
72+
73+
- Prefer explicit error messages with `HyperbrowserError`.
74+
- Preserve `original_error` for wrapped runtime failures.
75+
- Avoid mutating user-provided input payloads.
76+
- Keep sync and async manager APIs aligned.
77+
78+
## Pull request checklist
79+
80+
- [ ] Lint and format checks pass.
81+
- [ ] Tests pass locally.
82+
- [ ] New behavior is covered by tests.
83+
- [ ] Public API changes are documented in `README.md` (if applicable).

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ make check
247247
make ci
248248
```
249249

250+
Contributor workflow details are available in [CONTRIBUTING.md](CONTRIBUTING.md).
251+
250252
## Examples
251253

252254
Ready-to-run examples are available in `examples/`:

0 commit comments

Comments
 (0)