From e0414ab2ad2b6cebdc628facc79d37d86240d6d9 Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Fri, 7 Mar 2025 16:40:16 +0100
Subject: [PATCH] Upgrade to swh-shard

swh-perfecthash has been renamed ad swh-shard.
---
 docs/winery.rst                           | 2 +-
 requirements-swh.txt                      | 2 +-
 swh/objstorage/backends/winery/roshard.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/winery.rst b/docs/winery.rst
index 660a9e26..272f5c69 100644
--- a/docs/winery.rst
+++ b/docs/winery.rst
@@ -19,7 +19,7 @@ Implementation notes
 
 :py:mod:`swh.objstorage.backends.winery.sharedbase` contains the global objstorage index implementation, which associates every object id  (currently, the SHA256 of the content) to the shard it contains. The list of shards is stored in a table, associating them with a numeric id to save space, and their current :py:class:`swh.objstorage.backends.winery.sharedbase.ShardState`. The name of the shard is used to create a table (for write shards) or a RBD image (for read shards).
 
-:py:mod:`swh.objstorage.backends.winery.roshard` handles read-only shard management: classes handling the lifecycle of the shards pool, the :py:class:`swh.objstorage.backends.winery.roshard.ROShardCreator`, as well as :py:class:`swh.objstorage.backends.winery.roshard.ROShard`, a thin layer on top of :py:mod:`swh.perfecthash` used to access the objects stored inside a read-only shard.
+:py:mod:`swh.objstorage.backends.winery.roshard` handles read-only shard management: classes handling the lifecycle of the shards pool, the :py:class:`swh.objstorage.backends.winery.roshard.ROShardCreator`, as well as :py:class:`swh.objstorage.backends.winery.roshard.ROShard`, a thin layer on top of :py:mod:`swh.shard` used to access the objects stored inside a read-only shard.
 
 :py:mod:`swh.objstorage.backends.winery.rwshard` handles the database-backed write shards for all their lifecycle.
 
diff --git a/requirements-swh.txt b/requirements-swh.txt
index 64a14308..fb0daabe 100644
--- a/requirements-swh.txt
+++ b/requirements-swh.txt
@@ -1,3 +1,3 @@
 swh.core[http] >= 3.0.0
 swh.model >= 0.0.27
-swh.perfecthash >= 1.3.0
+swh.shard >= 1.0.0
diff --git a/swh/objstorage/backends/winery/roshard.py b/swh/objstorage/backends/winery/roshard.py
index 116de1c8..291ddc3c 100644
--- a/swh/objstorage/backends/winery/roshard.py
+++ b/swh/objstorage/backends/winery/roshard.py
@@ -29,7 +29,7 @@ from typing import (
 
 from systemd.daemon import notify
 
-from swh.perfecthash import Shard, ShardCreator
+from swh.shard import Shard, ShardCreator
 
 from . import settings
 from .sharedbase import ShardState, SharedBase
-- 
GitLab