Repository navigation
2.11.0 — one command to start, pytest fixtures and storage snapshots
Quality-of-life release: starting the service no longer needs Docker or a uvicorn command line,
the pytest fixtures ship with the package, and the whole mock storage can be saved to a JSON file
and loaded back. Everything here is additive — no endpoint, response or client method changes
behaviour.
pip install proxy_mock
proxy-mock --port 5000Or with nothing installed permanently: uvx proxy-mock --port 5000.
Highlights
- Console entry point:
proxy-mock --host --port --log-level --mocks, also available as
python -m proxy_mock.--workers > 1is refused with an explanation, because mocks and
traffic live in the memory of a single process - pytest fixtures ship with the package through a
pytest11entry point:proxy_mock(a
client, with mocks and traffic reset after every test) andproxy_mock_url(a session-scoped
instance on a free port).PROXY_MOCK_URLpoints them at an instance that is already running.
The fixture boilerplate previously copied out of the README is no longer needed - JSON snapshots of the storage:
GET /storage/snapshotexports every mock as one document,
POST /storage/snapshot?mode=merge|replaceloads it back, andproxy-mock --mocks file.json
preloads it at startup. The clients gainedexport_mocks()andimport_mocks(). The document
carries"format": 1and aprotocolfield so snapshots stay readable across releases;
binary bodies travel base64-encoded inbody_b64. An invalid snapshot is rejected before
anything is written, so the storage is never left half-loaded - Importing
proxy_mock.clientno longer pulls in FastAPI and uvicorn:create_appis
resolved lazily, so a project that only talks to a running instance stops paying the import
cost of the server
Fixed: two lower bounds that were not safe
Both affect anyone who installed 2.10.1 into an existing project.
fastapi>=0.136allowed versions where a user mock shadows the service endpoints — a mock
configured for/proxy_mockis what that path returns. The first safe version is 0.137.0, and
that is the new boundyarl>=1.8.0was not installable on any supported Python: no wheels for 3.11+, and the
generated C sources no longer compile. The new bound is 1.9.4
Deprecated, removed in 3.0
DELETE /traffic and PATCH /traffic/settings were added first, so every deprecated endpoint has
a replacement available today. The deprecated ones keep working unchanged, but answer with a
Deprecation: true header and a Link to the successor.
| Deprecated | Replacement |
|---|---|
POST /storage/clean |
DELETE /storage |
POST /traffic/clean |
DELETE /traffic |
POST /traffic/settings |
PATCH /traffic/settings |
POST /cache/clean and the cache_time field |
none — response caching is removed in 3.0 |
Project and infrastructure
- A container image is published to GHCR for each release, and now carries a default command, so
it starts without build arguments - CI gained a job that resolves and tests the declared lowest dependency versions (it found
both bounds above on its first run), a smoke test that installs the built wheel into a clean
environment and exercises the console script and the shipped fixtures, and a check that the
image actually serves. GitHub Actions are pinned by commit SHA - Free-threaded interpreters are no longer supported: the service measured slower there,
because its work is CPU-bound. Regular 3.11–3.14 is unaffected - New documentation: ROADMAP.md —
the scope, the non-goals, the dependency budget, and what 2.12 and 3.0 change — plus
CONTRIBUTING.md,SECURITY.mdandAGENTS.md
The full list of changes is in
CHANGELOG.md.