Getting started
Development setup
The project is a monorepo with multiple Python packages underpython_modules/. Each package has its own pyproject.toml managed by uv.
Running tests before submitting
All four test suites must pass:Code style
- Python — code is formatted with ruff. Run
uv run ruff format .anduv run ruff check .before committing. - Type annotations — all public functions should have type annotations. Run
uv run mypy src/to check. - Docstrings — module-level docstrings explain the role of the module. Function docstrings where the behaviour is non-obvious.
Where to make changes
| Area | Location | Notes |
|---|---|---|
| Core server + handlers | python_modules/proxy-hopper/src/proxy_hopper/ | |
| Config models | proxy_hopper/config/models.py | Pydantic v2 — TargetConfig, IpPool, IpRequest, ProxyProvider |
| Config loader | proxy_hopper/config/loader.py | YAML → ProxyHopperConfig; pool IP resolution |
| Auth logic | proxy_hopper/auth/ | __init__.py for token logic; admin.py for FastAPI admin app |
| Pool domain store | proxy_hopper/pool_store.py | IPPoolStore — owns key naming for pool/quarantine/failures |
| Repository | proxy_hopper/repository.py | ProxyRepository — runtime CRUD + pub/sub + cascade for targets/pools/providers |
| GraphQL API | proxy_hopper/graphql/ | Strawberry schema — queries, mutations, types, inputs |
| Memory backend | proxy_hopper/backend/memory.py | MemoryBackend — implements the Backend ABC in-process |
| Redis backend | python_modules/proxy-hopper-redis/ | RedisBackend — separate package |
| Integration test utils | python_modules/proxy-hopper-testserver/ | |
| Documentation | proxy-hopper-docs/ | Mintlify MDX |
| Helm chart | charts/proxy-hopper/ | |
| Docker examples | examples/docker-compose/ |
Adding a new config field
- Add the field to the appropriate Pydantic model in
config/models.py - Update
config/normalization.pyif the field uses camelCase in YAML - Update Config Reference in the docs
- Add a test in
tests/test_config.py - If it’s a server field, add the corresponding env var to Environment Variables
Writing integration tests
Useproxy-hopper-testserver to write end-to-end tests against the real server stack:
Pull request process
- Create a branch from
next - Make your changes with tests
- Ensure all test suites pass
- Update documentation if you changed behaviour or added a feature
- Open a PR against
mainwith a clear description of what and why - Address any review comments
Reporting bugs
Open an issue on GitHub with:- Proxy Hopper version (
docker inspect ghcr.io/cams-data/proxy-hopper:latest | jq '.[0].Config.Labels') - Your config (with credentials redacted)
- Steps to reproduce
- Expected vs actual behaviour
- Relevant log output (use
--log-level DEBUG)