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.16.2 to 0.16.3 #30

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 16, 2023

Bumps beartype from 0.16.2 to 0.16.3.

Release notes

Sourced from beartype's releases.

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.'
    >>> is_bearable(IHazAttr, ICanHazAttr)
    True   # <-- kk, you gots that attr

  • Forward reference issubclass() proxying. The @beartype decorator now supports subscripted forward references (e.g., "type[MuhClass]") to proxy both isinstance() and issubclass() type-checks, resolving issue #289 kindly submitted by Google X extraordinaire @​patrick-kidger (Patrick Kidger). Previously, subscripted forward references erroneously proxied only isinstance() type-checks; this omission prevented these references from correctly resolving stringified type hints of the form type[{UndefinedClass}] (i.e., subscriptions of the PEP 585-compliant type[...] builtin by a forward reference to a class that has yet to be defined). Now, all is full of QA. Praise be to the Kidger: e.g.,

    from beartype import beartype         # .-- this really hot ASCII art
                                          # |   arrow means this works now
    @beartype                             # v
    def dance_beartype_dance(i_dont_wanna: 'type[YoullDanceAndLikeIt]'):
        pass
    class YoullDanceAndLikeIt(...): ...

  • Readable forward reference exceptions. The @beartype decorator now raises human-readable exceptions involving forward references. Previously, forward reference proxies insanely presented themselves as unreadable private @​beartype classes like beartype._check.forward._fwdref._BeartypeForwardRefIndexable. Now, forward reference proxies quietly pretend they're just the classes they proxy. They're not, but you're no longer supposed to know. Sure... okay. Look. This is a bald-faced lie, but @​beartype is okay with lying to your face git blame when doing so is in your best interests. Specifically, forward reference proxies now additionally proxy both:

    • The fully-qualified names of the modules declaring the classes to which they refer.
    • The unqualified basenames of those classes.
  • Class redecoration eliding. The @beartype decorator now efficiently protects itself against redecoration. Previously, @beartype uselessly allowed classes already decorated by @beartype to be redecorated by @beartype. Now, @beartype usefully ignores attempts to redecorate classes: e.g.,

    @beartype  # <-- this now reduces to a noop
    @beartype  # <-- this still does nice stuff
    class MuhRedecoratedClass(...): ...

... (truncated)

Commits
  • aa31743 Beartype 0.16.3 released.
  • 76e609d typing(|_extensions).Annotated[object, beartype.vale.Is*, ...].
  • 4928e1c beartype.claw docos x 6.
  • 1a81a30 beartype.claw docos x 5.
  • ad0757c Forward reference issubclass() proxying x 2.
  • e4ca4ca Forward reference issubclass() proxying x 1.
  • d2ed487 beartype.claw docos x 4.
  • 0ac4c5c Hot reloading x 2.
  • f946da7 Hot reloading x 1.
  • 98405fb beartype.claw docos x 3.
  • 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.16.2 to 0.16.3.
- [Release notes](https://github.com/beartype/beartype/releases)
- [Changelog](https://github.com/beartype/beartype/blob/main/doc/RELEASE.rst)
- [Commits](beartype/beartype@v0.16.2...v0.16.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Oct 16, 2023
@github-actions
Copy link

github-actions bot commented Oct 16, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 4 0 0.15s
✅ COPYPASTE jscpd yes no 6.78s
✅ JSON eslint-plugin-jsonc 1 0 0 0.92s
✅ JSON prettier 1 0 0 0.72s
✅ JSON v8r 1 0 1.66s
✅ MARKDOWN markdownlint 1 0 0 0.31s
✅ MARKDOWN markdown-link-check 1 0 0.75s
✅ MARKDOWN markdown-table-formatter 1 0 0 0.23s
✅ PYTHON bandit 226 0 4.84s
✅ PYTHON black 226 0 0 4.17s
✅ PYTHON flake8 226 0 3.42s
✅ PYTHON isort 226 0 0 0.48s
✅ PYTHON mypy 226 0 4.13s
✅ PYTHON pylint 226 0 73.42s
✅ PYTHON ruff 226 0 0 0.08s
✅ REPOSITORY checkov yes no 8.89s
✅ REPOSITORY gitleaks yes no 2.03s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 10.76s
✅ REPOSITORY secretlint yes no 4.33s
✅ REPOSITORY trivy-sbom yes no 1.03s
✅ REPOSITORY trufflehog yes no 69.2s
✅ YAML prettier 8 0 0 0.76s
✅ YAML v8r 8 0 6.53s
✅ YAML yamllint 8 0 0.48s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@github-actions
Copy link

github-actions bot commented Oct 16, 2023

Test Results

384 tests  ±0   384 ✔️ ±0   3m 33s ⏱️ +27s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit a907b73. ± Comparison against base commit 91279b9.

♻️ This comment has been updated with latest results.

@ISAS-Admin ISAS-Admin closed this Oct 16, 2023
@ISAS-Admin ISAS-Admin deleted the dependabot/pip/beartype-0.16.3 branch October 16, 2023 22:15
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 16, 2023

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant