Repository navigation
Fix deduplication of tasks with distinct callables - #1103
Open
wozhenbang2004 wants to merge 5 commits into
Open
wozhenbang2004 wants to merge 5 commits into
wozhenbang2004 wants to merge 5 commits into
Conversation
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.
Fixes #536.
Tasks from different modules or factory calls can have identical code objects while using different globals, closures or defaults.
invoke one.clean two.cleanthen runs only the first task.Compare the wrapped callables after checking task names. References to the same callable still deduplicate, and custom callable equality is preserved. Distinct function objects now compare unequal even when their code matches; collections containing those tasks also reflect that distinction.
This follows @mrdecav's approach in #482. The code-object fallback originated in 5a11e20 alongside the Collection equality tests. Those tests now reuse the same callables while retaining the name, task and subcollection assertions. New regressions cover distinct closures/defaults, collection equality and actual task execution.
On Python 3.12 / Linux,
inv testpasses with 977 passed and 11 existing skips;inv typecheck,inv sites, the changed files' Black/flake8 checks, and sdist/wheel builds pass. The same disk-backed CLI cases fail with the base wheel and pass with the fixed wheel, including both modules' cleanup effects. The CI sudo/stress and downstream jobs, and other Python versions, were not run locally.