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

requirements: update beartype requirement from <0.14.0 to <0.15.0 #2658

Merged
merged 1 commit into from
May 2, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 2, 2023

Updates the requirements on beartype to permit the latest version.

Release notes

Sourced from beartype's releases.

Beartype 0.14.0

This minor release brings exhilarating support for PEP 673 (i.e., typing.Self) and PEP 675 (i.e., typing.LiteralString) as well as substantially improved compatibility with PyPy.

This minor release resolves 2 issues. But first, a brief word from our tenebrous sponsors. They are gentlemanly alchemists who dispense truth and money while despoiling bugs in your codebase. All thumbs up, please!

Beartype Sponsors

A chorus of overwhelming jubilation chimes through the stuffy confines of the Bear Den. 👏 🐻‍❄️ 👏

And now... the time we've waited for. A ribald display of plaintext that manhandles all twelve major meridian lines concurrently.

Compatibility Added

  • PEP 673. @​beartype now deeply type-checks PEP 673 – Self Type (i.e., typing.Self). @​beartype now fully supports typing.Self type hints in @​beartype-decorated classes. Specifically:
    • For each typing.Self type hint annotating something inside the body of a class (e.g., method parameter or return, class variable), @​beartype now reduces that hint to that class.
    • For each typing.Self type hint annotating something outside the body of a class (e.g., function parameter or return, global variable), @​beartype now raises an exception gently advising you to rethink life choices.
  • PEP 675. @​beartype now shallowly type-checks PEP 675 – Arbitrary Literal String Type (i.e., typing.LiteralString). As PEP 675 advises for runtime type-checkers, @​beartype now reduces (i.e., aliases) all typing.LiteralString type hints to the standard str type. Sadly, deeply type-checking literal strings is intractable for runtime type-checkers and is the textbook example of validation that can be performed only by static type-checkers. Type-checking literal strings requires:
    • Efficiently parsing abstract syntax trees (ASTs) at runtime (which is technically feasible, given sufficiently aggressive caching).
    • Correctly transitively inferring literal strings across operations and calls (which requires parsing the entire codebase of the app stack and constructing an in-memory graph of all type relations, which is pragmatically This isn't to say that PEP 675 is bad, however. PEP 675 is actually incredible, reducing the attack surface of database injection attacks at static analysis time with no harmful tradeoffs. And... who knows? With enough intestinal fortitude, handlebar mustaches, and monocled eyepieces, perhaps even @​beartype can surmount this Hill of Thorns. Eventually. Maybe. But probably not.

Compatibility Improved

  • PyPy. This release resolves a significant incompatibility with PyPy, whose implementation of the id() builtin appears to occasionally [read: non-deterministically] return object identifiers that are negative integers. Specifically, @​beartype now guaranteeably generates valid parameter names passed to type-checking wrapper functions regardless of the sign of the id() of the values of those parameters. Doing so resolves issue #232 kindly submitted by @​jvesely (Jan Vesely) who purportedly lives in or around an ancient pork by-product that has calcified into stone -- which is quite impressive, really. Stoneham: it's like Stonehenge, only American and yummy in your tummy. Thanks so much for the heads up, @​jvesely.

Errors Improved

  • Readable violation messages. This release improves the readability of type-checking violation messages raised by @​beartype, en-route to resolving feature request #216 kindly submitted by @​felixchenier (AKA, le maître québécois en assurance qualité). Specifically, @​beartype now prefixes type-checking violation messages with a terse description of the responsible callable (e.g., "Function", "Coroutine factory method") rather than the meaningless prefix "@beartyped". Explicitly detected types of callables include:
    • Coroutine factory functions, instance methods, and class methods.
    • Asynchronous generator factory functions, instance methods, and class methods.
    • Synchronous generator factory functions, instance methods, and class methods.
    • "Normal" synchronous functions, instance methods, and class methods.

Tests Improved

  • Module detection. This release dramatically simplifies the private beartype._util.mod.utilmodtest.is_module_version_at_least() tester to cease deferring to the fragile third-party pkg_resources package -- which now emits DeprecationWarning warnings implicitly coerced by pytest into test failures. Begone, foul pkg_resources!

API Changed

  • Added:
    • A new public PEP 673-specific beartype.roar.BeartypeDecorHintPep673Exception exception subclass.

(Plucky puppies in a saggy rucksack!)

Commits

You can trigger a rebase of this PR 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 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)

Updates the requirements on [beartype](https://github.com/beartype/beartype) to permit the latest version.
- [Release notes](https://github.com/beartype/beartype/releases)
- [Changelog](https://github.com/beartype/beartype/blob/main/doc/RELEASE.rst)
- [Commits](beartype/beartype@v0.1.0...v0.14.0)

---
updated-dependencies:
- dependency-name: beartype
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the deps Dependency update label May 2, 2023
@github-actions
Copy link

github-actions bot commented May 2, 2023

This PR causes the following changes to the html docs (ubuntu-latest-3.7-x64):

No differences!

...

See CI logs for the full diff.

@jvesely
Copy link
Collaborator

jvesely commented May 2, 2023

@dependabot squash and merge

@dependabot dependabot bot merged commit 764948f into devel May 2, 2023
@dependabot dependabot bot deleted the dependabot/pip/devel/beartype-lt-0.15.0 branch May 2, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps Dependency update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant