Skip to content

Support ETag-validated resume and raw downloads (1.14.0) - #82

Merged
iskandr merged 1 commit into
masterfrom
feature/resume-etag-raw-downloads
Sep 28, 2026
Merged

iskandr merged 1 commit into
masterfrom
feature/resume-etag-raw-downloads

Conversation

@iskandr

@iskandr iskandr commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Ensembl downloads cannot currently resume without a published SHA-256, and callers preserving an archive under an arbitrary destination name cannot disable suffix-inferred decompression. Add both capabilities to fetch_file and Cache.fetch in 1.14.0.

  • resume=True accepts expected_size without a hash only when every accepted response supplies a valid strong ETag. Appends use If-Range and require the exact range and matching validator. Missing/weak validators fail; changed representations restart. Complete size-only partials request fresh bytes instead of using the hash-verified publication shortcut.
  • raw=True bypasses gzip/ZIP decompression and HTML conversion regardless of destination name. It works with resume, integrity validation, atomic replacement, progress, provenance, and cache reuse; combining it with decompress=True is an error. Existing calls retain their transformation behavior.

Size-only validation is not cryptographic verification. Existing cache hits remain offline and validate only the supplied expectations. SHA-256-pinned resume still supports servers without strong validators.

Update the API reference, download guide, changelog, and offline example. Downstream pyensembl and Hitlist adoption can use these APIs without reimplementing publication.

Validation:

  • ./lint.sh passes.
  • ./test.sh: 751 passed, 95% coverage (Python 3.9.22).
  • 95 focused raw/resume tests pass on Python 3.12.6, with real localhost HTTP transfers covering interruption, retries, changed/missing/malformed validators, range errors, concurrency, complete partials, and preservation of old destinations.
  • Both offline public API examples pass.

Fixes #80. Fixes #81.

Release verification (2026-09-28): merged as ce2837c; all nine CI configurations and Coveralls passed. ./deploy.sh completed from clean master with lint and 751 tests passing. Datacache 1.14.0 is published; wheel and source-distribution SHA-256 digests match the local build. Reinstalling the PyPI wheel in an isolated environment passed a real interrupted HTTP smoke test covering raw gzip bytes at an arbitrary filename, ETag-only resume, progress, provenance, and offline reuse.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 36477992647

Coverage increased (+0.1%) to 95.435%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 30 of 30 lines across 3 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1862
Covered Lines: 1777
Line Coverage: 95.44%
Coverage Strength: 7.62 hits per line

💛 - Coveralls

1 similar comment
@coveralls

coveralls commented Sep 28, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 36477992647

Coverage increased (+0.1%) to 95.435%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 30 of 30 lines across 3 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1862
Covered Lines: 1777
Line Coverage: 95.44%
Coverage Strength: 7.62 hits per line

💛 - Coveralls

@iskandr
iskandr merged commit ce2837c into master Sep 28, 2026
20 checks passed
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.

Support explicit raw-byte downloads at arbitrary destination names Resumable downloads for sources that publish no SHA-256 (e.g. Ensembl)

2 participants