diff --git a/src/agent.py b/src/agent.py index a72fc97..93e1435 100644 --- a/src/agent.py +++ b/src/agent.py @@ -16,7 +16,7 @@ def run_agent(): logging.info("Extracting WATcloud URIs") watcloud_uris = list( # sorting to ensure consistent order for testing - sorted(flatten([get_watcloud_uris(repo.working_dir) for repo in repos])) + sorted(set(flatten([get_watcloud_uris(repo.working_dir) for repo in repos]))) ) logging.info(f"Found {len(watcloud_uris)} WATcloud URIs:") diff --git a/src/watcloud_uri.py b/src/watcloud_uri.py index 991740e..c7be275 100644 --- a/src/watcloud_uri.py +++ b/src/watcloud_uri.py @@ -47,6 +47,12 @@ def __repr__(self) -> str: def __lt__(self, other): return self.sha256 < other.sha256 + def __eq__(self, other): + return self.sha256 == other.sha256 + + def __hash__(self): + return hash(self.sha256) + if __name__ == "__main__": # Example usage uri = WATcloudURI("watcloud://v1/sha256:906f98c1d660a70a6b36ad14c559a9468fe7712312beba1d24650cc379a62360?name=cloud-light.avif")