Skip to content

Require zstd support for both Keepa clients - #237

Merged
akaszynski merged 7 commits into
mainfrom
feat/required-zstd
Oct 5, 2026
Merged

akaszynski merged 7 commits into
mainfrom
feat/required-zstd

Conversation

@akaszynski

@akaszynski akaszynski commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Both Keepa clients now request zstd responses and install the codec support as a required dependency. JSON queries, raw synchronous responses, and graph-image downloads use the HTTP libraries' native decoding while retaining gzip, deflate, and uncompressed response support.

Require Requests >=2.32.5, urllib3[zstd] >=2.7.0, and aiohttp >=3.14.0. Python 3.10–3.13 receive backports.zstd through the urllib3 extra; Python 3.14+ uses compression.zstd. Runtime testing rejected aiohttp 3.13.1 because it fails on concatenated zstd frames; aiohttp 3.14.0 includes that fix. Async graph downloads also now read the complete eight-byte PNG signature before validating it, allowing signatures split across decompressed chunks.

Validation:

  • Hosted standard CI passed on Python 3.10 and 3.14 at final integrated head 2e23c11: 146 passed, three existing expected-failure tests passed, and 98.46% coverage on each. Verified the logs include all 38 compression socket tests and both live zstd assertions. Documentation passed too.
  • Full suite on Python 3.13: 146 passed, three existing expected-failure tests passed, 98.46% coverage, no skips. Six existing historical-date warnings.
  • 38 tests through a real local HTTP server, redirecting only the request destination while retaining real Requests/aiohttp networking and decoders. Cover zstd/gzip/deflate/plain JSON, chunked responses, unknown-size and concatenated zstd frames, raw responses, PNG downloads, malformed data, API errors, and token retries.
  • All 38 socket tests plus two live Keepa token-endpoint tests passed on Python 3.10 and 3.14 with both minimum and latest transport dependencies (40 tests per configuration). Live tests assert Content-Encoding: zstd and successfully decode the response; the token endpoint is free.
  • Pre-commit checks, wheel/sdist build, wheel dependency metadata validation, and Sphinx HTML build with warnings treated as errors passed.
  • A fresh Python 3.10 installation of the core package, without optional extras, negotiated and decoded live zstd token responses through both clients.
  • The full suite also passed with all pending dependency updates together: Requests 2.33.0, urllib3 2.8.0, idna 3.15, Pygments 2.20.0, pytest 9.0.3, and pytest-asyncio 1.4.0 (146 passed, three existing expected-failure tests passed, 98.46% coverage).

Compression is part of the library and its normal test suite. The existing Python 3.10/3.14 full-suite jobs run all 38 compression socket tests and the live Keepa zstd negotiation assertions, retain the 85% coverage gate, and gate releases. There is no separate compression CI job. Both clients request zstd by default, and its codec support is a core installation dependency.

@akaszynski
akaszynski enabled auto-merge (squash) October 5, 2026 21:52
@akaszynski
akaszynski merged commit 5a204de into main Oct 5, 2026
5 checks passed
@akaszynski
akaszynski deleted the feat/required-zstd branch October 5, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant