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

Bump beartype from 0.15.0 to 0.17.0 #134

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 5, 2024

Bumps beartype from 0.15.0 to 0.17.0.

Release notes

Sourced from beartype's releases.

Beartype 0.16.4

This patch release resolves all the bad things that have quietly gone unnoticed by both man and Maine Coon alike... until now. Fellow Ontarian and ML superstar @​MaximilienLC (Maximilien Le Cleï) seriously, what is up with that "ï" quietly called our attention to a bevy (pretty sure that means "alot") of outstanding badness riddling the @​beartype codebase.

This patch release resolves that badness. This means:

  • beartype.claw + methods + PEP 526. Previously, beartype.claw silently failed to type-check PEP 526-compliant annotated variable assignments in methods. Now, beartype.claw does so: e.g.,

    # In "{your_sagacious_package}.__init__":
    from beartype import beartype_this_package
    beartype_this_package()
    In "{your_sagacious_package}...{your_bodacious_module}":
    class SoMuchClass(object):
    def so_much_method(self) -> None:
    # "beartype.claw" now raises an exception on this violation. Yah!
    so_much_local: int = 'You no longer fool @​beartype, local."
        # "beartype.claw" also raises an exception on this violation. Go!
        self.so_much_var: int = 'You too are known to @beartype, variable."

  • @​beartype 0.16.3 inheritance regression. @​beartype's prior stable release (i.e., @​beartype 0.16.3) introduced a critical regression with respect to inheritance and type-checking. Notably, the @beartype decorator silently failed to type-check subclass methods overriding superclass methods under @​beartype 0.16.3. Now, it does. I implore you all to believe that this never happened... Believe!

Much thanks to @​MaximilienLC for his all-seeing eye, which sees all @​beartype's typing failures as plainly as I see the blinding glare off my bald and malding head. (Pretty itsy-bitsy nitty-gritty, innit?)

Beartype 0.16.3

This bug-defying patch release adds official support for hot module reloading, root superclass validators, forward reference issubclass() proxying, readable forward reference exceptions, and class redecoration eliding as well as documenting a medley of topics and APIs first introduced with the beartype.claw subpackage under @​beartype 0.15.0. Where did the time go? Probably playing vidya games, if I'm being openly honest with myself.

@​beartype 0.16.3 almost qualified as a full-blown minor release called @​beartype 0.17.0. In the end, however... you failed, @​beartype 0.16.3! You weren't quite big enough, dizzyingly stupefying enough, or blatantly broken enough to get upgraded to a minor release. It's for the best.

Look. It was Canadian Thanksgiving. It was all I could do to take the roasted turkey leg out of my mouth. Still, there is awesome sauce. This includes:

  • Hot reloading. @​beartype is now robust against hot reloading (i.e., re-importation of previously imported modules containing one or more @​beartype-decorated classes), resolving issue #288 kindly submitted by awfully ingenious Cambridge researcher @​awf (Andrew Fitzgibbon). The @beartype decorator now explicitly (in order):

    1. Detects class redefinition (i.e., redefinition of a previously @beartype-decorated class with the same name in the same module, usually but not necessarily due to hot reloading).
    2. On the first redefinition of any class, clears all caches (i.e., @​beartype-specific internal caches that could possibly contain the prior definition of that redefined class).
  • Root superclass validators. The @beartype decorator now supports beartype validators of the form typing(|_extensions).Annotated[object, beartype.vale.Is*, ...] (i.e., PEP 593-compliant type hints annotating the otherwise ignorable root object superclass by one or more unignorable beartype validators), resolving both issues #290 kindly submitted by Plum maestro @​wesselb (Wessel) and beartype/plum#120 kindly submitted by professional hodge-podger @​hodgespodge. With the fearsome power of root superclass validators, validate that arbitrary objects satisfy various constraints regardless of the actual types of those objects. This is now a thing:

    >>> from beartype.door import is_bearable
    >>> from beartype.typing import Annotated
    >>> from beartype.vale import Is
    >>> ICanHazAttr = Annotated[object, Is[
    ...     lambda value: hasattr(value, 'i_can_haz_attr')]]
    >>> is_bearable('hello', ICanHazAttr)
    False  # <-- y u no got that attr, "str" class!?
    >>> class IHazAttr(object):
    ...     i_can_haz_attr = 'Totally got this one, bro.'

... (truncated)

Commits
  • 7d9051f Beartype 0.17.0: Ultrabear vs. Mecha-Bugbear
  • e75565b PyTorch x 2.
  • c811182 PyTorch x 1.
  • 2fa1f3c pyright 1.1.348 compatibility breakage.
  • 71365a2 beartype.BeartypeConf.violation_type.
  • 828cc18 beartype.door.die_if_unbearable() warning x 5.
  • ae9bee6 beartype.door.die_if_unbearable() warning x 4.
  • d259a99 beartype.door.die_if_unbearable() warning x 3.
  • d0f155d beartype.door.die_if_unbearable() warning x 2.
  • 14ddbe0 beartype.door.die_if_unbearable() warning x 1.
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [beartype](https://github.com/beartype/beartype) from 0.15.0 to 0.17.0.
- [Release notes](https://github.com/beartype/beartype/releases)
- [Changelog](https://github.com/beartype/beartype/blob/main/doc/RELEASE.rst)
- [Commits](beartype/beartype@v0.15.0...v0.17.0)

---
updated-dependencies:
- dependency-name: beartype
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Feb 5, 2024
@kyegomez kyegomez merged commit 2396a4f into master Feb 5, 2024
22 of 43 checks passed
@dependabot dependabot bot deleted the dependabot/pip/beartype-0.17.0 branch February 5, 2024 17:31
kyegomez added a commit that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant