Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace include_special_cased_deps flag with should_traverse_deps_predicate #19272

Merged
merged 20 commits into from
Jun 13, 2023

Commits on Jun 8, 2023

  1. Add ShouldTraverseDepsPredicate

    This will replace the `include_special_cased_deps` flag
    cognifloyd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    c95aa60 View commit details
    Browse the repository at this point in the history
  2. Handle SpecialCasedDependencies in ShouldTraverseDepsPredicate

    This will replace the `include_special_cased_deps` flag
    cognifloyd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    c2c6f26 View commit details
    Browse the repository at this point in the history
  3. Replace include_special_cased_deps=True flag with `should_traverse_…

    …deps_predicate=always_traverse`
    cognifloyd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    ef7a09f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e30672c View commit details
    Browse the repository at this point in the history
  5. fmt

    cognifloyd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    941c3c2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c1c9252 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c1ed5a2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    39e5bde View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    434a8fb View commit details
    Browse the repository at this point in the history
  10. comment typo

    cognifloyd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    945b50b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    869b91f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f0a808c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a77b046 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. Configuration menu
    Copy the full SHA
    412e994 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. Turn ShouldTraverseDepsPredicate into a dataclass

    closure functions have a useless hash. The hash of a function does not
    account for any closure vars, including unhashable mutable vars,
    so that hash is not reliable.
    Plus, every instance of a closure will have a different id, so there cannot be
    any reuse of anything cached based on the function's hash.
    
    Using a frozen dataclass bypasses these issues. We include the class's __call__ function
    as a field in the parent dataclass so that it is part of
    the __hash__ function generated by the
    @DataClass decorator. Using the class's __call__ is more stable than using an instance's function.
    cognifloyd committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    0b91c76 View commit details
    Browse the repository at this point in the history
  2. cleanup test

    cognifloyd committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    57660a6 View commit details
    Browse the repository at this point in the history
  3. Add test for frozen ShouldTraverseDepsPredicate subclasses

    This tests 2 things:
    - that subclasses without an @DataClass decorator are still frozen
    - that mypy says the types of _callable and __call__ are compatible
    
    For the mypy issue, I tried using Self instead of Any, but Self resolved to ShouldTraverseDepsPredicate which did not match SkipDepsTagOrTraverse for some reason.
    cognifloyd committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    d0364f5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b856127 View commit details
    Browse the repository at this point in the history
  5. Improve comment on _callable

    Co-authored-by: Joshua Cannon <joshdcannon@gmail.com>
    cognifloyd and thejcannon committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    7ce2bce View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6a28cd6 View commit details
    Browse the repository at this point in the history