covalence 0.1.0.dev3__tar.gz → 0.1.0.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/Cargo.lock +19 -19
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/Cargo.toml +17 -17
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/PKG-INFO +54 -8
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/README.md +53 -7
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/README.md +53 -7
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/src/lib.rs +98 -0
- covalence-0.1.0.dev4/crates/python/src/streams/download.rs +295 -0
- covalence-0.1.0.dev4/crates/python/src/streams/mod.rs +20 -0
- covalence-0.1.0.dev4/crates/python/src/streams/upload/tests.rs +241 -0
- covalence-0.1.0.dev4/crates/python/src/streams/upload.rs +215 -0
- covalence-0.1.0.dev4/crates/python/tests/test_bounded_io.py +935 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/python/covalence/THIRD-PARTY-LICENSES.md +17 -17
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/python/covalence/_native.pyi +63 -1
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/tests/blob.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/tests/common/mod.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/blob/trait/tests/fact.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/kv/tests/kv.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/memory/tests/memory.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/sqlite/tests/sqlite.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/cas/trait/tests/trait.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/memory/tests/memory.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/src/read.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/src/write.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/tests/aws.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/s3/tests/kv.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/kv/trait/tests/atomic.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/dasl.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/fact.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/git.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/multicodec.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/o256.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/src/storage.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/cid.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/fact.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/git.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/o256.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/shattered/1.bin +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/shattered/2.bin +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/cid/tests/shattered/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/src/drisl.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/src/event.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/src/json.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/codec.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/events.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fact.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/LICENSE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/cid.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/concat.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/floats.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/indefinite.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/integer_range.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/map_keys.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/numeric_reduction.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/short_form.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/simple.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/tags.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures/utf8.json +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/fixtures.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/json.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/vectors/README.md +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/vectors/cid-vectors.jsonl +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/vectors/dasl-vectors.jsonl +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/dasl/tests/vectors.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/data/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/data/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/data/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/data/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/data/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/error/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/error/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/error/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/error/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/error/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/python/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/python/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/python/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/python/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/python/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/rand/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/rand/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/rand/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/rand/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/rand/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/serde/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/serde/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/serde/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/serde/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/serde/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/sqlite/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/sqlite/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/sqlite/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/sqlite/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/lib/sqlite/src/lib.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/Cargo.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/LICENSE-APACHE +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/LICENSE-CC0 +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/LICENSE-MIT +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/about.md.hbs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/about.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/src/errors.rs +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/tests/test_api.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/tests/test_docs.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/tests/test_package.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/tests/test_stubs.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/crates/python/tests/typed_usage.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/pyproject.toml +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/python/covalence/__init__.py +0 -0
- {covalence-0.1.0.dev3 → covalence-0.1.0.dev4}/python/covalence/py.typed +0 -0
|
@@ -779,7 +779,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
|
|
779
779
|
|
|
780
780
|
[[package]]
|
|
781
781
|
name = "covalence-blob-trait"
|
|
782
|
-
version = "0.1.0-dev.
|
|
782
|
+
version = "0.1.0-dev.4"
|
|
783
783
|
dependencies = [
|
|
784
784
|
"covalence-lib-cid",
|
|
785
785
|
"covalence-lib-data",
|
|
@@ -788,7 +788,7 @@ dependencies = [
|
|
|
788
788
|
|
|
789
789
|
[[package]]
|
|
790
790
|
name = "covalence-cas-kv"
|
|
791
|
-
version = "0.1.0-dev.
|
|
791
|
+
version = "0.1.0-dev.4"
|
|
792
792
|
dependencies = [
|
|
793
793
|
"blake3",
|
|
794
794
|
"covalence-cas-trait",
|
|
@@ -810,7 +810,7 @@ dependencies = [
|
|
|
810
810
|
|
|
811
811
|
[[package]]
|
|
812
812
|
name = "covalence-cas-memory"
|
|
813
|
-
version = "0.1.0-dev.
|
|
813
|
+
version = "0.1.0-dev.4"
|
|
814
814
|
dependencies = [
|
|
815
815
|
"covalence-cas-trait",
|
|
816
816
|
"covalence-lib-cid",
|
|
@@ -821,7 +821,7 @@ dependencies = [
|
|
|
821
821
|
|
|
822
822
|
[[package]]
|
|
823
823
|
name = "covalence-cas-sqlite"
|
|
824
|
-
version = "0.1.0-dev.
|
|
824
|
+
version = "0.1.0-dev.4"
|
|
825
825
|
dependencies = [
|
|
826
826
|
"covalence-cas-trait",
|
|
827
827
|
"covalence-lib-cid",
|
|
@@ -836,7 +836,7 @@ dependencies = [
|
|
|
836
836
|
|
|
837
837
|
[[package]]
|
|
838
838
|
name = "covalence-cas-trait"
|
|
839
|
-
version = "0.1.0-dev.
|
|
839
|
+
version = "0.1.0-dev.4"
|
|
840
840
|
dependencies = [
|
|
841
841
|
"covalence-lib-cid",
|
|
842
842
|
"covalence-lib-dasl",
|
|
@@ -847,7 +847,7 @@ dependencies = [
|
|
|
847
847
|
|
|
848
848
|
[[package]]
|
|
849
849
|
name = "covalence-kv-memory"
|
|
850
|
-
version = "0.1.0-dev.
|
|
850
|
+
version = "0.1.0-dev.4"
|
|
851
851
|
dependencies = [
|
|
852
852
|
"covalence-kv-trait",
|
|
853
853
|
"covalence-lib-dasl",
|
|
@@ -857,7 +857,7 @@ dependencies = [
|
|
|
857
857
|
|
|
858
858
|
[[package]]
|
|
859
859
|
name = "covalence-kv-s3"
|
|
860
|
-
version = "0.1.0-dev.
|
|
860
|
+
version = "0.1.0-dev.4"
|
|
861
861
|
dependencies = [
|
|
862
862
|
"aws-config",
|
|
863
863
|
"aws-credential-types",
|
|
@@ -881,7 +881,7 @@ dependencies = [
|
|
|
881
881
|
|
|
882
882
|
[[package]]
|
|
883
883
|
name = "covalence-kv-trait"
|
|
884
|
-
version = "0.1.0-dev.
|
|
884
|
+
version = "0.1.0-dev.4"
|
|
885
885
|
dependencies = [
|
|
886
886
|
"covalence-lib-dasl",
|
|
887
887
|
"covalence-lib-data",
|
|
@@ -890,7 +890,7 @@ dependencies = [
|
|
|
890
890
|
|
|
891
891
|
[[package]]
|
|
892
892
|
name = "covalence-lib-cid"
|
|
893
|
-
version = "0.1.0-dev.
|
|
893
|
+
version = "0.1.0-dev.4"
|
|
894
894
|
dependencies = [
|
|
895
895
|
"blake3",
|
|
896
896
|
"covalence-lib-data",
|
|
@@ -905,14 +905,14 @@ dependencies = [
|
|
|
905
905
|
|
|
906
906
|
[[package]]
|
|
907
907
|
name = "covalence-lib-cli"
|
|
908
|
-
version = "0.1.0-dev.
|
|
908
|
+
version = "0.1.0-dev.4"
|
|
909
909
|
dependencies = [
|
|
910
910
|
"clap",
|
|
911
911
|
]
|
|
912
912
|
|
|
913
913
|
[[package]]
|
|
914
914
|
name = "covalence-lib-dasl"
|
|
915
|
-
version = "0.1.0-dev.
|
|
915
|
+
version = "0.1.0-dev.4"
|
|
916
916
|
dependencies = [
|
|
917
917
|
"blake3",
|
|
918
918
|
"covalence-lib-cid",
|
|
@@ -927,7 +927,7 @@ dependencies = [
|
|
|
927
927
|
|
|
928
928
|
[[package]]
|
|
929
929
|
name = "covalence-lib-data"
|
|
930
|
-
version = "0.1.0-dev.
|
|
930
|
+
version = "0.1.0-dev.4"
|
|
931
931
|
dependencies = [
|
|
932
932
|
"arrayvec",
|
|
933
933
|
"bytes",
|
|
@@ -939,7 +939,7 @@ dependencies = [
|
|
|
939
939
|
|
|
940
940
|
[[package]]
|
|
941
941
|
name = "covalence-lib-error"
|
|
942
|
-
version = "0.1.0-dev.
|
|
942
|
+
version = "0.1.0-dev.4"
|
|
943
943
|
dependencies = [
|
|
944
944
|
"miette",
|
|
945
945
|
"snafu",
|
|
@@ -947,14 +947,14 @@ dependencies = [
|
|
|
947
947
|
|
|
948
948
|
[[package]]
|
|
949
949
|
name = "covalence-lib-python"
|
|
950
|
-
version = "0.1.0-dev.
|
|
950
|
+
version = "0.1.0-dev.4"
|
|
951
951
|
dependencies = [
|
|
952
952
|
"pyo3",
|
|
953
953
|
]
|
|
954
954
|
|
|
955
955
|
[[package]]
|
|
956
956
|
name = "covalence-lib-rand"
|
|
957
|
-
version = "0.1.0-dev.
|
|
957
|
+
version = "0.1.0-dev.4"
|
|
958
958
|
dependencies = [
|
|
959
959
|
"getrandom 0.3.4",
|
|
960
960
|
"rand",
|
|
@@ -962,21 +962,21 @@ dependencies = [
|
|
|
962
962
|
|
|
963
963
|
[[package]]
|
|
964
964
|
name = "covalence-lib-serde"
|
|
965
|
-
version = "0.1.0-dev.
|
|
965
|
+
version = "0.1.0-dev.4"
|
|
966
966
|
dependencies = [
|
|
967
967
|
"serde",
|
|
968
968
|
]
|
|
969
969
|
|
|
970
970
|
[[package]]
|
|
971
971
|
name = "covalence-lib-sqlite"
|
|
972
|
-
version = "0.1.0-dev.
|
|
972
|
+
version = "0.1.0-dev.4"
|
|
973
973
|
dependencies = [
|
|
974
974
|
"rusqlite",
|
|
975
975
|
]
|
|
976
976
|
|
|
977
977
|
[[package]]
|
|
978
978
|
name = "covalence-python"
|
|
979
|
-
version = "0.1.0-dev.
|
|
979
|
+
version = "0.1.0-dev.4"
|
|
980
980
|
dependencies = [
|
|
981
981
|
"blake3",
|
|
982
982
|
"covalence-blob-trait",
|
|
@@ -997,7 +997,7 @@ dependencies = [
|
|
|
997
997
|
|
|
998
998
|
[[package]]
|
|
999
999
|
name = "covalence-tools-glu"
|
|
1000
|
-
version = "0.1.0-dev.
|
|
1000
|
+
version = "0.1.0-dev.4"
|
|
1001
1001
|
dependencies = [
|
|
1002
1002
|
"covalence-lib-cli",
|
|
1003
1003
|
"covalence-lib-error",
|
|
@@ -3,7 +3,7 @@ members = ["crates/lib/error", "crates/lib/serde", "crates/lib/data", "crates/li
|
|
|
3
3
|
resolver = "3"
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.1.0-dev.
|
|
6
|
+
version = "0.1.0-dev.4"
|
|
7
7
|
edition = "2024"
|
|
8
8
|
rust-version = "1.98"
|
|
9
9
|
license = "CC0-1.0 OR MIT OR Apache-2.0"
|
|
@@ -17,22 +17,22 @@ miette = "7.6.0"
|
|
|
17
17
|
sha2 = "0.11.0"
|
|
18
18
|
snafu = "0.9.2"
|
|
19
19
|
# Published crates, at the workspace version so the set moves together.
|
|
20
|
-
covalence-blob-trait = { path = "crates/blob/trait", version = "=0.1.0-dev.
|
|
21
|
-
covalence-cas-kv = { path = "crates/cas/kv", version = "=0.1.0-dev.
|
|
22
|
-
covalence-cas-memory = { path = "crates/cas/memory", version = "=0.1.0-dev.
|
|
23
|
-
covalence-cas-sqlite = { path = "crates/cas/sqlite", version = "=0.1.0-dev.
|
|
24
|
-
covalence-cas-trait = { path = "crates/cas/trait", version = "=0.1.0-dev.
|
|
25
|
-
covalence-kv-memory = { path = "crates/kv/memory", version = "=0.1.0-dev.
|
|
26
|
-
covalence-kv-s3 = { path = "crates/kv/s3", version = "=0.1.0-dev.
|
|
27
|
-
covalence-kv-trait = { path = "crates/kv/trait", version = "=0.1.0-dev.
|
|
28
|
-
covalence-lib-cid = { path = "crates/lib/cid", version = "=0.1.0-dev.
|
|
29
|
-
covalence-lib-cli = { path = "crates/lib/cli", version = "=0.1.0-dev.
|
|
30
|
-
covalence-lib-dasl = { path = "crates/lib/dasl", version = "=0.1.0-dev.
|
|
31
|
-
covalence-lib-data = { path = "crates/lib/data", version = "=0.1.0-dev.
|
|
32
|
-
covalence-lib-error = { path = "crates/lib/error", version = "=0.1.0-dev.
|
|
33
|
-
covalence-lib-rand = { path = "crates/lib/rand", version = "=0.1.0-dev.
|
|
34
|
-
covalence-lib-serde = { path = "crates/lib/serde", version = "=0.1.0-dev.
|
|
35
|
-
covalence-lib-sqlite = { path = "crates/lib/sqlite", version = "=0.1.0-dev.
|
|
20
|
+
covalence-blob-trait = { path = "crates/blob/trait", version = "=0.1.0-dev.4" }
|
|
21
|
+
covalence-cas-kv = { path = "crates/cas/kv", version = "=0.1.0-dev.4" }
|
|
22
|
+
covalence-cas-memory = { path = "crates/cas/memory", version = "=0.1.0-dev.4" }
|
|
23
|
+
covalence-cas-sqlite = { path = "crates/cas/sqlite", version = "=0.1.0-dev.4" }
|
|
24
|
+
covalence-cas-trait = { path = "crates/cas/trait", version = "=0.1.0-dev.4" }
|
|
25
|
+
covalence-kv-memory = { path = "crates/kv/memory", version = "=0.1.0-dev.4" }
|
|
26
|
+
covalence-kv-s3 = { path = "crates/kv/s3", version = "=0.1.0-dev.4" }
|
|
27
|
+
covalence-kv-trait = { path = "crates/kv/trait", version = "=0.1.0-dev.4" }
|
|
28
|
+
covalence-lib-cid = { path = "crates/lib/cid", version = "=0.1.0-dev.4" }
|
|
29
|
+
covalence-lib-cli = { path = "crates/lib/cli", version = "=0.1.0-dev.4" }
|
|
30
|
+
covalence-lib-dasl = { path = "crates/lib/dasl", version = "=0.1.0-dev.4" }
|
|
31
|
+
covalence-lib-data = { path = "crates/lib/data", version = "=0.1.0-dev.4" }
|
|
32
|
+
covalence-lib-error = { path = "crates/lib/error", version = "=0.1.0-dev.4" }
|
|
33
|
+
covalence-lib-rand = { path = "crates/lib/rand", version = "=0.1.0-dev.4" }
|
|
34
|
+
covalence-lib-serde = { path = "crates/lib/serde", version = "=0.1.0-dev.4" }
|
|
35
|
+
covalence-lib-sqlite = { path = "crates/lib/sqlite", version = "=0.1.0-dev.4" }
|
|
36
36
|
|
|
37
37
|
[workspace.lints.rust]
|
|
38
38
|
unsafe_code = "forbid"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: covalence
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev4
|
|
4
4
|
License-File: LICENSE-APACHE
|
|
5
5
|
License-File: LICENSE-CC0
|
|
6
6
|
License-File: LICENSE-MIT
|
|
@@ -35,7 +35,7 @@ True
|
|
|
35
35
|
## Install
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
pip install covalence==0.1.0.
|
|
38
|
+
pip install covalence==0.1.0.dev4
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
- Pre-releases need an exact pin like this one, or `pip install --pre`.
|
|
@@ -72,6 +72,11 @@ pip install covalence==0.1.0.dev3
|
|
|
72
72
|
- `Cid.of` hashes with `"blake3"` and `"raw"` by default.
|
|
73
73
|
- `Cid.of_file(path)` is the raw BLAKE3 `Cid` of a file, as `Cas.put_file`
|
|
74
74
|
returns it, without storing it or reading the file into memory.
|
|
75
|
+
- `Cid.of_fileobj(file, max_bytes=..., expected_length=...)` hashes an
|
|
76
|
+
already-open, seekable binary file object once from offset zero, without
|
|
77
|
+
storing it or holding it in memory. It uses the same bounded reader as
|
|
78
|
+
`Cas.put_fileobj`, and leaves the caller's source open at EOF on success.
|
|
79
|
+
Keep that source unchanged and exclusively owned until it returns.
|
|
75
80
|
|
|
76
81
|
## Values
|
|
77
82
|
|
|
@@ -174,10 +179,29 @@ pip install covalence==0.1.0.dev3
|
|
|
174
179
|
case `StoreError` reports that failure with the source as its `__cause__`.
|
|
175
180
|
- `Cas.get_file(cid, path)` writes the block to a file and returns its
|
|
176
181
|
length, or `None` if missing.
|
|
177
|
-
- `
|
|
182
|
+
- `Cas.put_fileobj(file, max_bytes=..., expected_length=...)` stores a
|
|
183
|
+
caller-owned, seekable binary file object. It reads from offset zero twice,
|
|
184
|
+
checks the complete source on both passes even when deduplicating, and
|
|
185
|
+
leaves it open at EOF on success. The caller must keep the source unchanged
|
|
186
|
+
and exclusively owned until it returns; the method creates no snapshot.
|
|
187
|
+
`max_bytes` caps the accepted source length; `expected_length`, if given,
|
|
188
|
+
must match it exactly. A length violation raises `ValueError` before a new
|
|
189
|
+
block is published. A pass may read one extra byte to check the end.
|
|
190
|
+
- `Cas.get_to(cid, writer, max_bytes=..., expected_length=...)` writes to a
|
|
191
|
+
caller-owned binary file object and returns the length, or `None` if missing.
|
|
192
|
+
It checks all bytes against the CID, caps the bytes the writer accepts, and
|
|
193
|
+
checks the optional exact length. It handles short writes and never seeks,
|
|
194
|
+
flushes or closes the writer. A failure may leave partial or unchecked bytes
|
|
195
|
+
there: write to private staging and publish only after a successful return.
|
|
196
|
+
- These limits govern source length and output bytes, not the memory a backend
|
|
197
|
+
uses before reading or writing. Python callback transfers are at most 1 MiB.
|
|
198
|
+
- `put_file`, `put_fileobj`, `put_from`, `get_file` and `get_to` stream on `Cas.kv` over `Kv.s3`,
|
|
178
199
|
holding up to 16 parts of 8 MiB (128 MiB) at a time, or as many as
|
|
179
|
-
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
180
|
-
the block in memory.
|
|
200
|
+
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
201
|
+
Other stores, including `Cas.kv(Kv.memory())`, hold the block in memory.
|
|
202
|
+
- A create-only write can reuse a block without checking its stored bytes.
|
|
203
|
+
Returning a CID does not freshly verify an existing block: use a checked
|
|
204
|
+
read, such as `get_to`, when that guarantee is needed.
|
|
181
205
|
- `put_file` reads the file twice, to hash it and to store it, and stores the
|
|
182
206
|
bytes it hashed. If they changed in between it raises `IntegrityError`,
|
|
183
207
|
and if the file got shorter `OSError`, storing nothing either way. Bytes
|
|
@@ -188,6 +212,28 @@ pip install covalence==0.1.0.dev3
|
|
|
188
212
|
was. The new file has the permissions of the file it replaces, or those
|
|
189
213
|
the umask gives a new file.
|
|
190
214
|
|
|
215
|
+
Use an already-open file without exposing its path:
|
|
216
|
+
|
|
217
|
+
```pycon
|
|
218
|
+
>>> import io
|
|
219
|
+
>>> source = io.BytesIO(b"hello")
|
|
220
|
+
>>> cid = cas.put_fileobj(source, max_bytes=5, expected_length=5)
|
|
221
|
+
>>> sink = io.BytesIO()
|
|
222
|
+
>>> cas.get_to(cid, sink, max_bytes=5, expected_length=5)
|
|
223
|
+
5
|
|
224
|
+
>>> sink.getvalue()
|
|
225
|
+
b'hello'
|
|
226
|
+
>>> Cid.of_fileobj(sink, max_bytes=5, expected_length=5) == cid
|
|
227
|
+
True
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
An integer file descriptor can be wrapped with `os.fdopen(os.dup(fd), "wb",
|
|
232
|
+
buffering=0)` for downloads, or `"rb"` for uploads. Close that wrapper when
|
|
233
|
+
finished; the original descriptor remains open. Duplicates share a file
|
|
234
|
+
position, so the caller must also keep the original descriptor exclusively
|
|
235
|
+
owned during the operation.
|
|
236
|
+
|
|
191
237
|
## Blobs and facts
|
|
192
238
|
|
|
193
239
|
- `Blob` is bytes read whole or by range:
|
|
@@ -259,16 +305,16 @@ stub; this package writes its stub by hand and checks it against `__doc__`:
|
|
|
259
305
|
later) for manylinux_2_28 x86_64 and aarch64 and macOS arm64, and an sdist,
|
|
260
306
|
and runs `tests/` against each wheel. Pull requests and pushes keep them as
|
|
261
307
|
workflow artifacts. A release tag must match the workspace version, such as
|
|
262
|
-
`0.1.0-dev.
|
|
308
|
+
`0.1.0-dev.4`; the files carry its PEP 440 form, `0.1.0.dev4`:
|
|
263
309
|
|
|
264
310
|
- `v<version>` attaches them to that GitHub release. In the public
|
|
265
311
|
`hiloopai/covalence` repository it also publishes them to PyPI, and
|
|
266
312
|
`.github/workflows/crates.yml` publishes the crates to crates.io.
|
|
267
313
|
- `python-v<version>` only attaches them to the GitHub release.
|
|
268
314
|
|
|
269
|
-
To publish `0.1.0-dev.
|
|
315
|
+
To publish `0.1.0-dev.4`:
|
|
270
316
|
|
|
271
317
|
```sh
|
|
272
|
-
git tag v0.1.0-dev.
|
|
318
|
+
git tag v0.1.0-dev.4 && git push origin v0.1.0-dev.4
|
|
273
319
|
```
|
|
274
320
|
|
|
@@ -21,7 +21,7 @@ True
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
23
|
```sh
|
|
24
|
-
pip install covalence==0.1.0.
|
|
24
|
+
pip install covalence==0.1.0.dev4
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
- Pre-releases need an exact pin like this one, or `pip install --pre`.
|
|
@@ -58,6 +58,11 @@ pip install covalence==0.1.0.dev3
|
|
|
58
58
|
- `Cid.of` hashes with `"blake3"` and `"raw"` by default.
|
|
59
59
|
- `Cid.of_file(path)` is the raw BLAKE3 `Cid` of a file, as `Cas.put_file`
|
|
60
60
|
returns it, without storing it or reading the file into memory.
|
|
61
|
+
- `Cid.of_fileobj(file, max_bytes=..., expected_length=...)` hashes an
|
|
62
|
+
already-open, seekable binary file object once from offset zero, without
|
|
63
|
+
storing it or holding it in memory. It uses the same bounded reader as
|
|
64
|
+
`Cas.put_fileobj`, and leaves the caller's source open at EOF on success.
|
|
65
|
+
Keep that source unchanged and exclusively owned until it returns.
|
|
61
66
|
|
|
62
67
|
## Values
|
|
63
68
|
|
|
@@ -160,10 +165,29 @@ pip install covalence==0.1.0.dev3
|
|
|
160
165
|
case `StoreError` reports that failure with the source as its `__cause__`.
|
|
161
166
|
- `Cas.get_file(cid, path)` writes the block to a file and returns its
|
|
162
167
|
length, or `None` if missing.
|
|
163
|
-
- `
|
|
168
|
+
- `Cas.put_fileobj(file, max_bytes=..., expected_length=...)` stores a
|
|
169
|
+
caller-owned, seekable binary file object. It reads from offset zero twice,
|
|
170
|
+
checks the complete source on both passes even when deduplicating, and
|
|
171
|
+
leaves it open at EOF on success. The caller must keep the source unchanged
|
|
172
|
+
and exclusively owned until it returns; the method creates no snapshot.
|
|
173
|
+
`max_bytes` caps the accepted source length; `expected_length`, if given,
|
|
174
|
+
must match it exactly. A length violation raises `ValueError` before a new
|
|
175
|
+
block is published. A pass may read one extra byte to check the end.
|
|
176
|
+
- `Cas.get_to(cid, writer, max_bytes=..., expected_length=...)` writes to a
|
|
177
|
+
caller-owned binary file object and returns the length, or `None` if missing.
|
|
178
|
+
It checks all bytes against the CID, caps the bytes the writer accepts, and
|
|
179
|
+
checks the optional exact length. It handles short writes and never seeks,
|
|
180
|
+
flushes or closes the writer. A failure may leave partial or unchecked bytes
|
|
181
|
+
there: write to private staging and publish only after a successful return.
|
|
182
|
+
- These limits govern source length and output bytes, not the memory a backend
|
|
183
|
+
uses before reading or writing. Python callback transfers are at most 1 MiB.
|
|
184
|
+
- `put_file`, `put_fileobj`, `put_from`, `get_file` and `get_to` stream on `Cas.kv` over `Kv.s3`,
|
|
164
185
|
holding up to 16 parts of 8 MiB (128 MiB) at a time, or as many as
|
|
165
|
-
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
166
|
-
the block in memory.
|
|
186
|
+
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
187
|
+
Other stores, including `Cas.kv(Kv.memory())`, hold the block in memory.
|
|
188
|
+
- A create-only write can reuse a block without checking its stored bytes.
|
|
189
|
+
Returning a CID does not freshly verify an existing block: use a checked
|
|
190
|
+
read, such as `get_to`, when that guarantee is needed.
|
|
167
191
|
- `put_file` reads the file twice, to hash it and to store it, and stores the
|
|
168
192
|
bytes it hashed. If they changed in between it raises `IntegrityError`,
|
|
169
193
|
and if the file got shorter `OSError`, storing nothing either way. Bytes
|
|
@@ -174,6 +198,28 @@ pip install covalence==0.1.0.dev3
|
|
|
174
198
|
was. The new file has the permissions of the file it replaces, or those
|
|
175
199
|
the umask gives a new file.
|
|
176
200
|
|
|
201
|
+
Use an already-open file without exposing its path:
|
|
202
|
+
|
|
203
|
+
```pycon
|
|
204
|
+
>>> import io
|
|
205
|
+
>>> source = io.BytesIO(b"hello")
|
|
206
|
+
>>> cid = cas.put_fileobj(source, max_bytes=5, expected_length=5)
|
|
207
|
+
>>> sink = io.BytesIO()
|
|
208
|
+
>>> cas.get_to(cid, sink, max_bytes=5, expected_length=5)
|
|
209
|
+
5
|
|
210
|
+
>>> sink.getvalue()
|
|
211
|
+
b'hello'
|
|
212
|
+
>>> Cid.of_fileobj(sink, max_bytes=5, expected_length=5) == cid
|
|
213
|
+
True
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
An integer file descriptor can be wrapped with `os.fdopen(os.dup(fd), "wb",
|
|
218
|
+
buffering=0)` for downloads, or `"rb"` for uploads. Close that wrapper when
|
|
219
|
+
finished; the original descriptor remains open. Duplicates share a file
|
|
220
|
+
position, so the caller must also keep the original descriptor exclusively
|
|
221
|
+
owned during the operation.
|
|
222
|
+
|
|
177
223
|
## Blobs and facts
|
|
178
224
|
|
|
179
225
|
- `Blob` is bytes read whole or by range:
|
|
@@ -245,15 +291,15 @@ stub; this package writes its stub by hand and checks it against `__doc__`:
|
|
|
245
291
|
later) for manylinux_2_28 x86_64 and aarch64 and macOS arm64, and an sdist,
|
|
246
292
|
and runs `tests/` against each wheel. Pull requests and pushes keep them as
|
|
247
293
|
workflow artifacts. A release tag must match the workspace version, such as
|
|
248
|
-
`0.1.0-dev.
|
|
294
|
+
`0.1.0-dev.4`; the files carry its PEP 440 form, `0.1.0.dev4`:
|
|
249
295
|
|
|
250
296
|
- `v<version>` attaches them to that GitHub release. In the public
|
|
251
297
|
`hiloopai/covalence` repository it also publishes them to PyPI, and
|
|
252
298
|
`.github/workflows/crates.yml` publishes the crates to crates.io.
|
|
253
299
|
- `python-v<version>` only attaches them to the GitHub release.
|
|
254
300
|
|
|
255
|
-
To publish `0.1.0-dev.
|
|
301
|
+
To publish `0.1.0-dev.4`:
|
|
256
302
|
|
|
257
303
|
```sh
|
|
258
|
-
git tag v0.1.0-dev.
|
|
304
|
+
git tag v0.1.0-dev.4 && git push origin v0.1.0-dev.4
|
|
259
305
|
```
|
|
@@ -21,7 +21,7 @@ True
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
23
|
```sh
|
|
24
|
-
pip install covalence==0.1.0.
|
|
24
|
+
pip install covalence==0.1.0.dev4
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
- Pre-releases need an exact pin like this one, or `pip install --pre`.
|
|
@@ -58,6 +58,11 @@ pip install covalence==0.1.0.dev3
|
|
|
58
58
|
- `Cid.of` hashes with `"blake3"` and `"raw"` by default.
|
|
59
59
|
- `Cid.of_file(path)` is the raw BLAKE3 `Cid` of a file, as `Cas.put_file`
|
|
60
60
|
returns it, without storing it or reading the file into memory.
|
|
61
|
+
- `Cid.of_fileobj(file, max_bytes=..., expected_length=...)` hashes an
|
|
62
|
+
already-open, seekable binary file object once from offset zero, without
|
|
63
|
+
storing it or holding it in memory. It uses the same bounded reader as
|
|
64
|
+
`Cas.put_fileobj`, and leaves the caller's source open at EOF on success.
|
|
65
|
+
Keep that source unchanged and exclusively owned until it returns.
|
|
61
66
|
|
|
62
67
|
## Values
|
|
63
68
|
|
|
@@ -160,10 +165,29 @@ pip install covalence==0.1.0.dev3
|
|
|
160
165
|
case `StoreError` reports that failure with the source as its `__cause__`.
|
|
161
166
|
- `Cas.get_file(cid, path)` writes the block to a file and returns its
|
|
162
167
|
length, or `None` if missing.
|
|
163
|
-
- `
|
|
168
|
+
- `Cas.put_fileobj(file, max_bytes=..., expected_length=...)` stores a
|
|
169
|
+
caller-owned, seekable binary file object. It reads from offset zero twice,
|
|
170
|
+
checks the complete source on both passes even when deduplicating, and
|
|
171
|
+
leaves it open at EOF on success. The caller must keep the source unchanged
|
|
172
|
+
and exclusively owned until it returns; the method creates no snapshot.
|
|
173
|
+
`max_bytes` caps the accepted source length; `expected_length`, if given,
|
|
174
|
+
must match it exactly. A length violation raises `ValueError` before a new
|
|
175
|
+
block is published. A pass may read one extra byte to check the end.
|
|
176
|
+
- `Cas.get_to(cid, writer, max_bytes=..., expected_length=...)` writes to a
|
|
177
|
+
caller-owned binary file object and returns the length, or `None` if missing.
|
|
178
|
+
It checks all bytes against the CID, caps the bytes the writer accepts, and
|
|
179
|
+
checks the optional exact length. It handles short writes and never seeks,
|
|
180
|
+
flushes or closes the writer. A failure may leave partial or unchecked bytes
|
|
181
|
+
there: write to private staging and publish only after a successful return.
|
|
182
|
+
- These limits govern source length and output bytes, not the memory a backend
|
|
183
|
+
uses before reading or writing. Python callback transfers are at most 1 MiB.
|
|
184
|
+
- `put_file`, `put_fileobj`, `put_from`, `get_file` and `get_to` stream on `Cas.kv` over `Kv.s3`,
|
|
164
185
|
holding up to 16 parts of 8 MiB (128 MiB) at a time, or as many as
|
|
165
|
-
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
166
|
-
the block in memory.
|
|
186
|
+
`Kv.s3(..., concurrency=n)` says; blocks over 78 GiB go up in larger parts.
|
|
187
|
+
Other stores, including `Cas.kv(Kv.memory())`, hold the block in memory.
|
|
188
|
+
- A create-only write can reuse a block without checking its stored bytes.
|
|
189
|
+
Returning a CID does not freshly verify an existing block: use a checked
|
|
190
|
+
read, such as `get_to`, when that guarantee is needed.
|
|
167
191
|
- `put_file` reads the file twice, to hash it and to store it, and stores the
|
|
168
192
|
bytes it hashed. If they changed in between it raises `IntegrityError`,
|
|
169
193
|
and if the file got shorter `OSError`, storing nothing either way. Bytes
|
|
@@ -174,6 +198,28 @@ pip install covalence==0.1.0.dev3
|
|
|
174
198
|
was. The new file has the permissions of the file it replaces, or those
|
|
175
199
|
the umask gives a new file.
|
|
176
200
|
|
|
201
|
+
Use an already-open file without exposing its path:
|
|
202
|
+
|
|
203
|
+
```pycon
|
|
204
|
+
>>> import io
|
|
205
|
+
>>> source = io.BytesIO(b"hello")
|
|
206
|
+
>>> cid = cas.put_fileobj(source, max_bytes=5, expected_length=5)
|
|
207
|
+
>>> sink = io.BytesIO()
|
|
208
|
+
>>> cas.get_to(cid, sink, max_bytes=5, expected_length=5)
|
|
209
|
+
5
|
|
210
|
+
>>> sink.getvalue()
|
|
211
|
+
b'hello'
|
|
212
|
+
>>> Cid.of_fileobj(sink, max_bytes=5, expected_length=5) == cid
|
|
213
|
+
True
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
An integer file descriptor can be wrapped with `os.fdopen(os.dup(fd), "wb",
|
|
218
|
+
buffering=0)` for downloads, or `"rb"` for uploads. Close that wrapper when
|
|
219
|
+
finished; the original descriptor remains open. Duplicates share a file
|
|
220
|
+
position, so the caller must also keep the original descriptor exclusively
|
|
221
|
+
owned during the operation.
|
|
222
|
+
|
|
177
223
|
## Blobs and facts
|
|
178
224
|
|
|
179
225
|
- `Blob` is bytes read whole or by range:
|
|
@@ -245,15 +291,15 @@ stub; this package writes its stub by hand and checks it against `__doc__`:
|
|
|
245
291
|
later) for manylinux_2_28 x86_64 and aarch64 and macOS arm64, and an sdist,
|
|
246
292
|
and runs `tests/` against each wheel. Pull requests and pushes keep them as
|
|
247
293
|
workflow artifacts. A release tag must match the workspace version, such as
|
|
248
|
-
`0.1.0-dev.
|
|
294
|
+
`0.1.0-dev.4`; the files carry its PEP 440 form, `0.1.0.dev4`:
|
|
249
295
|
|
|
250
296
|
- `v<version>` attaches them to that GitHub release. In the public
|
|
251
297
|
`hiloopai/covalence` repository it also publishes them to PyPI, and
|
|
252
298
|
`.github/workflows/crates.yml` publishes the crates to crates.io.
|
|
253
299
|
- `python-v<version>` only attaches them to the GitHub release.
|
|
254
300
|
|
|
255
|
-
To publish `0.1.0-dev.
|
|
301
|
+
To publish `0.1.0-dev.4`:
|
|
256
302
|
|
|
257
303
|
```sh
|
|
258
|
-
git tag v0.1.0-dev.
|
|
304
|
+
git tag v0.1.0-dev.4 && git push origin v0.1.0-dev.4
|
|
259
305
|
```
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
mod errors;
|
|
2
|
+
mod streams;
|
|
2
3
|
|
|
3
4
|
use std::{
|
|
4
5
|
collections::hash_map::DefaultHasher,
|
|
@@ -305,6 +306,32 @@ impl PyCid {
|
|
|
305
306
|
Ok(Self { inner: cid.into() })
|
|
306
307
|
}
|
|
307
308
|
|
|
309
|
+
/// The raw BLAKE3 CID of a seekable binary file object, without storing it.
|
|
310
|
+
///
|
|
311
|
+
/// - Reads once from offset zero, requesting at most 1 MiB at once,
|
|
312
|
+
/// without holding the complete file in memory.
|
|
313
|
+
/// - `max_bytes` bounds the accepted source length. If given,
|
|
314
|
+
/// `expected_length` must not exceed it and must match the source exactly.
|
|
315
|
+
/// A length violation raises ValueError. Reads at most one extra byte
|
|
316
|
+
/// to check the end.
|
|
317
|
+
/// - Calls `seek(0)` and `read(n)`. `seek` must return zero; `read` must
|
|
318
|
+
/// return bytes or bytearray, at most `n` bytes. Short reads are allowed;
|
|
319
|
+
/// empty bytes end the source. Source exceptions propagate unchanged.
|
|
320
|
+
/// - Never closes the source. On success its position is at EOF.
|
|
321
|
+
/// The caller must keep it unchanged and exclusively owned until this
|
|
322
|
+
/// returns. This does not create a filesystem snapshot.
|
|
323
|
+
#[staticmethod]
|
|
324
|
+
#[pyo3(signature = (file, *, max_bytes, expected_length = None))]
|
|
325
|
+
fn of_fileobj(
|
|
326
|
+
py: Python<'_>,
|
|
327
|
+
file: Py<PyAny>,
|
|
328
|
+
max_bytes: u64,
|
|
329
|
+
expected_length: Option<u64>,
|
|
330
|
+
) -> PyResult<Self> {
|
|
331
|
+
let cid = streams::hash_fileobj(py, file, max_bytes, expected_length)?;
|
|
332
|
+
Ok(Self { inner: cid.into() })
|
|
333
|
+
}
|
|
334
|
+
|
|
308
335
|
/// The CID with the same hash and digest and the raw codec.
|
|
309
336
|
fn to_raw(&self) -> Self {
|
|
310
337
|
Self::new_cid(Multicodec::RAW, self.inner.hash(), self.inner.digest())
|
|
@@ -1002,6 +1029,39 @@ impl PyCas {
|
|
|
1002
1029
|
Ok(PyCid { inner: key.into() })
|
|
1003
1030
|
}
|
|
1004
1031
|
|
|
1032
|
+
/// Store a seekable binary file object and return its raw BLAKE3 CID.
|
|
1033
|
+
///
|
|
1034
|
+
/// - Reads from offset zero twice, to hash and store the same source.
|
|
1035
|
+
/// The caller must keep the source unchanged and exclusively owned
|
|
1036
|
+
/// until this returns. This does not create a filesystem snapshot.
|
|
1037
|
+
/// - `max_bytes` bounds the accepted source length. If given,
|
|
1038
|
+
/// `expected_length` must not exceed it and must match the source exactly.
|
|
1039
|
+
/// A length violation raises ValueError before a new block is published.
|
|
1040
|
+
/// Reads at most one extra byte per pass to check the end.
|
|
1041
|
+
/// - Calls `seek(0)` and `read(n)`, requesting at most 1 MiB at once.
|
|
1042
|
+
/// `seek` must return zero; `read` must return bytes or bytearray,
|
|
1043
|
+
/// at most `n` bytes. Short reads are allowed; empty bytes end the source.
|
|
1044
|
+
/// - Checks both complete passes, even if the store reuses a block.
|
|
1045
|
+
/// Changed bytes raise IntegrityError. Reusing a block does not verify
|
|
1046
|
+
/// the bytes already stored there; use a checked read when that is needed.
|
|
1047
|
+
/// - Never closes the source. On success its position is at EOF.
|
|
1048
|
+
/// Source exceptions propagate unchanged; if storage cleanup also fails,
|
|
1049
|
+
/// raises StoreError with the source exception as its `__cause__`.
|
|
1050
|
+
/// - The byte limit does not bound backend memory. `Cas.kv` over `Kv.s3`
|
|
1051
|
+
/// streams with its configured concurrency; other stores may hold the
|
|
1052
|
+
/// complete block in memory.
|
|
1053
|
+
#[pyo3(signature = (file, *, max_bytes, expected_length = None))]
|
|
1054
|
+
fn put_fileobj(
|
|
1055
|
+
&self,
|
|
1056
|
+
py: Python<'_>,
|
|
1057
|
+
file: Py<PyAny>,
|
|
1058
|
+
max_bytes: u64,
|
|
1059
|
+
expected_length: Option<u64>,
|
|
1060
|
+
) -> PyResult<PyCid> {
|
|
1061
|
+
let key = streams::upload(py, self.inner.as_ref(), file, max_bytes, expected_length)?;
|
|
1062
|
+
Ok(PyCid { inner: key.into() })
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1005
1065
|
/// Store a block identified by `cid` from `chunks` and return its raw BLAKE3 CID.
|
|
1006
1066
|
///
|
|
1007
1067
|
/// For bytes that arrive in pieces, such as a request body, without
|
|
@@ -1087,6 +1147,44 @@ impl PyCas {
|
|
|
1087
1147
|
Ok(len)
|
|
1088
1148
|
}
|
|
1089
1149
|
|
|
1150
|
+
/// Write a block to a binary file object, checking its CID and byte limits.
|
|
1151
|
+
///
|
|
1152
|
+
/// Returns the written length, or None if missing.
|
|
1153
|
+
///
|
|
1154
|
+
/// - `max_bytes` bounds bytes accepted by `writer.write`. If given,
|
|
1155
|
+
/// `expected_length` must not exceed it and must match the block exactly.
|
|
1156
|
+
/// A length violation raises ValueError.
|
|
1157
|
+
/// - Calls `write(bytes)` with at most 1 MiB at once. It must return an
|
|
1158
|
+
/// integer from one to the offered length. Short writes are allowed.
|
|
1159
|
+
/// Never seeks, flushes or closes the writer.
|
|
1160
|
+
/// - A successful return checks all bytes against `cid`. On failure the
|
|
1161
|
+
/// writer may contain a partial or unchecked block; use private staging
|
|
1162
|
+
/// and publish it only after success. Writer exceptions propagate unchanged.
|
|
1163
|
+
/// If backend cleanup also fails, raises StoreError with the writer
|
|
1164
|
+
/// exception as its `__cause__`.
|
|
1165
|
+
/// - The byte limit bounds output, not backend memory. `Cas.kv` over
|
|
1166
|
+
/// `Kv.s3` streams with its configured concurrency; other stores may
|
|
1167
|
+
/// fetch the complete block before writing any bytes.
|
|
1168
|
+
#[pyo3(signature = (cid, writer, *, max_bytes, expected_length = None))]
|
|
1169
|
+
fn get_to(
|
|
1170
|
+
&self,
|
|
1171
|
+
py: Python<'_>,
|
|
1172
|
+
cid: PyRef<'_, PyCid>,
|
|
1173
|
+
writer: Py<PyAny>,
|
|
1174
|
+
max_bytes: u64,
|
|
1175
|
+
expected_length: Option<u64>,
|
|
1176
|
+
) -> PyResult<Option<u64>> {
|
|
1177
|
+
let cid = cid.key()?;
|
|
1178
|
+
streams::download(
|
|
1179
|
+
py,
|
|
1180
|
+
self.inner.as_ref(),
|
|
1181
|
+
&cid,
|
|
1182
|
+
writer,
|
|
1183
|
+
max_bytes,
|
|
1184
|
+
expected_length,
|
|
1185
|
+
)
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1090
1188
|
/// The bytes under `cid`, checked against it, or None if missing.
|
|
1091
1189
|
fn get<'py>(
|
|
1092
1190
|
&self,
|