fix: remove functools.cache from methods receiving Launchpad Entry objects#123
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
copy-to-seriescrashes withTypeError: unhashable type: 'Entry'because several methods use@functools.cachebut receive LaunchpadEntryobjects (PPAs, sources) which aren't hashable.This never surfaced before because
copy-to-serieswas silently finding no packages (wrong series bug). Now that it actually finds packages, it hits the cache decorator.Removed
@functools.cachefromget_published_sources,get_builds_for_source,get_source_packages, andget_usable_sources. These are only called once per workflow run, so caching provides no benefit.References
copy_to_other_distributionsfailure in build_debian.ymlReviewer guidance
Pure deletion of 4
@functools.cachedecorators. The@functools.cached_propertydecorators onlp,owner,proposed_ppa,release_ppaare fine (no unhashable args).get_seriesis also fine (takes a string).AI usage
Claude Code identified the root cause from the traceback and removed the problematic cache decorators.