fetch#

JLAP consumer.

Classes#

HashWriter

Base class for raw binary I/O.

Functions#

hash()

Ordinary hash.

process_jlap_response(response[, pos, iv])

fetch_jlap(url[, pos, etag, iv, ignore_etag, session])

request_jlap(url[, pos, etag, ignore_etag, session])

Return the part of the remote .jlap file we are interested in.

format_hash(hash)

Abbreviate hash for formatting.

find_patches(patches, have, want)

apply_patches(data, apply)

withext(url, ext)

timeme(message)

build_headers(json_path, state)

Caching headers for a path and state.

download_and_hash(hasher, url, json_path, session, state)

Download url if it doesn't exist, passing bytes through hasher.update().

_is_http_error_most_400_codes(→ bool)

Determine whether the HTTPError is an HTTP 400 error code (except for 416).

request_url_jlap_state(→ dict | None)

Attributes#

DIGEST_SIZE

JLAP_KEY

HEADERS

NOMINAL_HASH

ON_DISK_HASH

LATEST

STORE_HEADERS

DIGEST_SIZE = 32#
JLAP_KEY = 'jlap'#
HEADERS = 'headers'#
NOMINAL_HASH = 'blake2_256_nominal'#
ON_DISK_HASH = 'blake2_256'#
LATEST = 'latest'#
STORE_HEADERS#
hash()#

Ordinary hash.

exception Jlap304NotModified#

Bases: Exception

Common base class for all non-exit exceptions.

exception JlapSkipZst#

Bases: Exception

Common base class for all non-exit exceptions.

exception JlapPatchNotFound#

Bases: LookupError

Base class for lookup errors.

process_jlap_response(response: conda.gateways.connection.Response, pos=0, iv=b'')#
fetch_jlap(url, pos=0, etag=None, iv=b'', ignore_etag=True, session=None)#
request_jlap(url, pos=0, etag=None, ignore_etag=True, session: conda.gateways.connection.Session | None = None)#

Return the part of the remote .jlap file we are interested in.

format_hash(hash)#

Abbreviate hash for formatting.

find_patches(patches, have, want)#
apply_patches(data, apply)#
withext(url, ext)#
timeme(message)#
build_headers(json_path: pathlib.Path, state: conda.gateways.repodata.RepodataState)#

Caching headers for a path and state.

class HashWriter(backing, hasher)#

Bases: io.RawIOBase

Base class for raw binary I/O.

write(b: bytes)#
close()#

Flush and close the IO object.

This method has no effect if the file is already closed.

download_and_hash(hasher, url, json_path: pathlib.Path, session: conda.gateways.connection.Session, state: conda.gateways.repodata.RepodataState | None, is_zst=False, dest_path: pathlib.Path | None = None)#

Download url if it doesn't exist, passing bytes through hasher.update().

json_path: Path of old cached data (ignore etag if not exists). dest_path: Path to write new data.

_is_http_error_most_400_codes(e: requests.HTTPError) bool#

Determine whether the HTTPError is an HTTP 400 error code (except for 416).

request_url_jlap_state(url, state: conda.gateways.repodata.RepodataState, full_download=False, *, session: conda.gateways.connection.Session, cache: conda.gateways.repodata.RepodataCache, temp_path: pathlib.Path) dict | None#