diff --git a/pins/rsconnect/fs.py b/pins/rsconnect/fs.py index f16a34d9..2f519c95 100644 --- a/pins/rsconnect/fs.py +++ b/pins/rsconnect/fs.py @@ -3,7 +3,6 @@ from collections.abc import Sequence from dataclasses import asdict, dataclass, field, fields from pathlib import Path -from typing import ClassVar from fsspec import AbstractFileSystem @@ -108,7 +107,7 @@ class BundleFilePath(BundlePath): class RsConnectFs(AbstractFileSystem): - protocol: ClassVar[str | tuple[str, ...]] = "rsc" + protocol = "rsc" def __init__(self, server_url, **kwargs): if isinstance(server_url, RsConnectApi): diff --git a/pins/tests/test_versions.py b/pins/tests/test_versions.py index 6432108b..a731c7c3 100644 --- a/pins/tests/test_versions.py +++ b/pins/tests/test_versions.py @@ -51,3 +51,12 @@ def test_version_from_files(bytes_): assert v.hash == digest assert v.created == EXAMPLE_DATE + + +def test_version_from_files_multiple(): + files = [BytesIO(b"123"), BytesIO(b"456")] + v = Version.from_files(files, EXAMPLE_DATE) + + combined = xxhash.xxh64(b"123").hexdigest() + xxhash.xxh64(b"456").hexdigest() + assert v.hash == xxhash.xxh64(combined.encode("utf-8")).hexdigest() + assert v.created == EXAMPLE_DATE diff --git a/pins/versions.py b/pins/versions.py index c05babcf..d618e8b8 100644 --- a/pins/versions.py +++ b/pins/versions.py @@ -109,7 +109,7 @@ def from_files( combined_hashes = "".join(hashes) # Create an xxh64 hash of the combined string - hashes = [xxh64(combined_hashes).hexdigest()] + hashes = [xxh64(combined_hashes.encode("utf-8")).hexdigest()] return cls(created, hashes[0])