Skip to content

fix: remove functools.cache from methods receiving Launchpad Entry objects#123

Merged
rtibbles merged 2 commits into
mainfrom
fix/launchpad-cache-unhashable
Apr 1, 2026
Merged

fix: remove functools.cache from methods receiving Launchpad Entry objects#123
rtibbles merged 2 commits into
mainfrom
fix/launchpad-cache-unhashable

Conversation

@rtibbles

@rtibbles rtibbles commented Apr 1, 2026

Copy link
Copy Markdown
Member

Summary

copy-to-series crashes with TypeError: unhashable type: 'Entry' because several methods use @functools.cache but receive Launchpad Entry objects (PPAs, sources) which aren't hashable.

This never surfaced before because copy-to-series was silently finding no packages (wrong series bug). Now that it actually finds packages, it hits the cache decorator.

Removed @functools.cache from get_published_sources, get_builds_for_source, get_source_packages, and get_usable_sources. These are only called once per workflow run, so caching provides no benefit.

References

  • Fixes copy_to_other_distributions failure in build_debian.yml

Reviewer guidance

Pure deletion of 4 @functools.cache decorators. The @functools.cached_property decorators on lp, owner, proposed_ppa, release_ppa are fine (no unhashable args). get_series is also fine (takes a string).

AI usage

Claude Code identified the root cause from the traceback and removed the problematic cache decorators.

rtibbles and others added 2 commits March 31, 2026 18:14
…jects

Launchpad Entry objects are not hashable, so functools.cache raises
TypeError when copy-to-series actually finds packages to copy (which
it now does since the dynamic series detection fix). These methods
are only called once per workflow run, so caching isn't needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests used __wrapped__ to bypass functools.cache, which no longer
exists after removing the decorator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rtibbles rtibbles merged commit 877bb31 into main Apr 1, 2026
14 checks passed
@rtibbles rtibbles deleted the fix/launchpad-cache-unhashable branch April 1, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant