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.13.0 to <0.14.0 #2625

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 9, 2023

Updates the requirements on beartype to permit the latest version.

Release notes

Sourced from beartype's releases.

Beartype 0.13.0

This minor release delivers pulse-quickening support for pandera (pandas) type hints, PEP 484, PEP 585, PEP 591, PEP 647, PEP 3119, and pseudo-callables. This release resolves 12 issues and merges 2 pull requests. But first: a quiet word from our wondrous sponsors. They are monocled QA wizards who serve justice while crushing bugs for humanity. High fives, please!

Beartype Sponsors

Thunderous applause echoes through the cavernous confines of the Bear Den. 👏 🐻‍❄️ 👏

And now... the moment we've waited for. A heinous display of plaintext that assaults all five senses simultaneously.

Compatibility Added

  • Pandera (pandas) type hints (i.e., ad-hoc PEP-noncompliant type hints validating pandas DataFrame objects, produced by subscripting factories published by the pandera.typing subpackage and validated only by user-defined callables decorated by the ad-hoc PEP-noncompliant @pandera.check_types runtime type-checking decorator), resolving feature request #227 kindly submitted by @​ulfaslakprecis (Ulf Aslak) the Big Boss Typer. @​beartype now:
    • Transparently supports pandera's PEP-noncompliant @pandera.check_types decorator for deeply runtime type-checking arbitrary pandas objects.
    • Always performs a rudimentary O(1) isinstance()-based type-check for each pandera type hint. Doing so substantially improves usability in common use cases, including:
      • Callables annotated by one or more pandera type hints that are correctly decorated by @​beartype but incorrectly not decorated by the pandera-specific @pandera.check_types decorator.
      • (Data)classes annotated by one or more pandera type hints.
      • Pandera type hints passed as the second argument to statement-level @​beartype type-checkers – including:
        • beartype.door.is_bearable().
        • beartype.door.die_if_unbearable().
    • Implements a non-trivial trie data structure to efficiently detect all type hints produced by subscriptable factories in the pandera.typing submodule. Let us pretend this never happened, @​ulfaslakprecis.
  • PEP 484- and 585-compliant generator constraints. This release relaxes prior constraints erroneously imposed by @​beartype prohibiting both asynchronous and synchronous generator callables from being annotated as returning unsubscripted standard abstract base classes (ABCs) defined by the collections.abc module. Now, @​beartype permits:
    • Asynchronous generator callables to be annotated as returning the unsubscripted collections.abc.AsyncGenerator type.
    • Synchronous generator callables to be annotated as returning the unsubscripted collections.abc.Generator type.
  • PEP 591 (i.e., typing.Final[...] type hints), partially resolving issue #223 kindly submitted by the acronym known only as @​JWCS (Jude). @​beartype now trivially reduces all typing.Final[{hint}] type hints to merely {hint} (e.g., typing.Final[int] to int). In other words, @​beartype no longer raises exceptions when confronted with final type hints and instead at least tries to do the right thing. This still isn't quite what everyone wants @​beartype to do here; ideally, @​beartype should also raise exceptions on detecting attempts to redefine instance and class variables annotated as Final[...]. Doing so is definitely feasible and exactly what @​beartype should eventually do – but also non-trivial, because whatever @​beartype eventually does needs to preserve compatibility with all implementations of the @dataclass decorator across all versions of Python now and forever. Cue that head-throbbing migraine. It's comin'! Oh, I can feel it!
  • PEP 647 (i.e., typing.TypeGuard[...] type hints), resolving feature request #221 kindly submitted by Google X researcher extraordinaire @​patrick-kidger. @​beartype now trivially reduces all typing.TypeGuard[...] type hints to the builtin bool type.

Compatibility Improved

  • PEP 3119. @​beartype now detects both non-isinstanceable classes (i.e., classes whose metaclasses define PEP 3119-compliant __instancecheck__() dunder methods unconditionally raising TypeError exceptions) and non-issubclassable classes (i.e., classes whose metaclasses define PEP 3119-compliant __subclasscheck__() dunder methods unconditionally raising TypeError exceptions) more narrowly for safety, resolving issue #220 kindly submitted by extraordinary Google X researcher @​patrick-kidger (Patrick Kidger). Notably, @​beartype now only accepts TypeError exceptions as connoting non-isinstanceability and non-issubclassability. Previously, @​beartype broadly treated any class raising any exception whatsoever when passed as the second parameter to isinstance() and issubclass() as non-isinstanceable and non-issubclassable. Sadly, doing so erroneously raises false positives for isinstanceable and issubclassable metaclasses that have yet to be fully "initialized" at the early time the @beartype decorator performs this detection.

Features Added

  • Pseudo-callable monkey-patching support. @beartype now supports pseudo-callables (i.e., otherwise uncallable objects masquerading as callable by defining the __call__() dunder method), resolving feature request #211 kindly submitted by Google X typing guru @​patrick-kidger (Patrick Kidger). When passed a pseudo-callable whose __call__() method is annotated by one or more type hints, @beartype runtime type-checks that method in the standard way.

Documentation Revised

  • Literally everything, also known as the release that migrated README.rst -> Read the Docs (RtD), resolving both issue #203 kindly submitted by @​LittleBigGene (AKA the dynamo of the cell) and ancient issue #8 kindly submitted by @​felix-hilden (AKA the Finnish computer vision art genius that really made all of this possible). Readable documentation slowly emerges from the primordial soup of @​beartype's shameless past for which we cannot be blamed. @​leycec was young and "spirited" back then. This release:
    • Coerces our prior monolithic slab of unreadable README.rst documentation into a website graciously hosted by Read the Docs (RtD) subdividing that prior documentation into well-structured pages, resolving issue #203 kindly submitted by @​LittleBigGene (AKA the dynamo of the cell).
    • Documents most previously undocumented public APIs in the @​beartype codebase. Although a handful of public APIs remain undocumented (notably, the beartype.peps submodule), these undocumented APIs are assumed to either be sufficiently unpopular or non-useful to warrant investing additional scarce resources here.
    • Updates our installation instructions to note @​beartype's recent availability as official packages in the official package repositories of various Linux distributions. Truly, this can only be the final mark of pride. These include:
      • Gentoo Linux's Portage tree.
      • Arch Linux's Arch User Repository (AUR).
    • Improves the Python code sample embedded in the "Are We on the Worst Timeline?" subsection of our Beartype Errors chapter. Thanks to @​JWCS for their related pull request (PR) #210, which strongly inspired this bald-faced improvement to the usability of our beartype.typing API.
    • Circumvents multiple long-standing upstream issues in the PyData Sphinx theme regarding empty left sidebars via the requisite _templates/sidebar-nav-bs.html template hack shamelessly copy-pasted into literally every project requiring this theme. This includes @​beartype, because why not spew boilerplate that nobody understands everywhere? Sadly, doing so requires pinning to a maximum obsolete version of this theme that will surely die soon. And this is why I facepalm. These issues include:
    • Truncates our README.rst documentation to a placeholder stub that just directs everyone to RtD instead.

... (truncated)

Commits
  • 516a5d8 Beartype 0.13.0 released.
  • 48b040a Document @​beartype + pandera integration.
  • 3d552ab PEP 647 x 6.
  • bc32d63 Pandera type hint shallow type-checking x 3.
  • 507671e Pandera type hint shallow type-checking x 2.
  • 2920a59 Pandera type hint shallow type-checking x 1.
  • 7c8dfe7 Ignore Pandera type hints x 3.
  • 4499c51 Test coverage marginally improved.
  • fba824e Ignore Pandera type hints x 2.
  • 0430574 Ignore Pandera type hints x 1.
  • Additional commits viewable in compare view

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)

@dependabot dependabot bot added the deps Dependency update label Apr 9, 2023
@github-actions
Copy link

github-actions bot commented Apr 9, 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 Apr 9, 2023

@dependabot rebase

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.13.0)

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

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/pip/devel/beartype-lt-0.14.0 branch from bd41339 to 5fd0fe5 Compare April 9, 2023 21:38
@github-actions
Copy link

github-actions bot commented Apr 9, 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 Apr 10, 2023

@dependabot squash and merge

@dependabot dependabot bot merged commit 243fa61 into devel Apr 10, 2023
@dependabot dependabot bot deleted the dependabot/pip/devel/beartype-lt-0.14.0 branch April 10, 2023 01:01
kmantel added a commit to kmantel/PsyNeuLink that referenced this pull request Apr 14, 2023
* origin/devel:
  tests: remove asserts using zip loops where possible
  tests: replace all unaffected assert np.allclose with np.testing.assert_allclose
  tests: replace assert np.allclose with np.testing.assert_allclose where tolerance fails
  tests: test_gating_with_composition: fix allclose
  tests: test_log: fix allclose shape
  tests: test_rpy.py test_multilayer: fix allclose
  tests: test_reset_run_2darray: fix allclose
  tests: test_transfer_mech_array_var_normal_array_noise: fix allclose
  tests: test_single_array: fix allclose
  tests: test_connect_outer_composition_to_only_input_node_in_inner_comp_option2: fix allclose
  tests: test_AGTUtility_valid: fix allclose
  tests: test_target_dict_spec_single_trial_scalar_and_lists_rl: fix allclose
  tests: test_transfer_mech_func: fix allclose
  tests: test_input_specification_multiple_nested_compositions: fix allclose
  tests: test_input_not_provided_to_run: fix allclose
  tests: test_example_11: fix allclose
  tests: test_buffer_standalone: fix allclose
  tests: test_assign_value: fix allclose
  tests: TestRunInputSpecifications::test_2_mechanisms_input_5: fix allclose
  tests: test_integrator_multiple_input: fix allclose
  tests: tests_output_port_variable_spec_composition: fix allclose
  tests: test_output_ports: fix allclose
  tests: test_LCAMechanism_threshold: fix allclose
  tests: test_user_def_func_numpy: match 2d output to 2d input
  tests: test_linear_combination_function_in_mechanism: fix allclose
  tests: test_connect_compositions_with_simple_states: fix allclose
  tests: TestInputSpecifications test_run_2_mechanisms_reuse_input: fix allclose
  tests: TestRun test_run_2_mechanisms_reuse_input: fix allclose
  tests: TestRunInputSpecifications test_run_2_mechanisms_reuse_input: fix allclose
  tests: test_nested_transfer_mechanism_composition_parallel shape mismatch
  Fix test_ddm_mechanism TestInputPorts
  Fix test_reset_run_array
  Fix TestReduce
  Fix test_reset_state_integrator_mechanism
  Fix more execute tests.
  Fix more composition.run() tests.
  Fix test_four_level_nested_transfer_mechanism_composition_parallel
  Fix test_processing_mechanism_function
  tests: allclose changes
  Fix log tests
  tests: allclose changes
  Fix expected 3D outputs
  Fix test_run_no_inputs
  tests: allclose changes
  tests: allclose changes
  tests: allclose changes
  Fix expected results shape
  tests: test_nested_composition_run_trials_inputs: undo disable test parametrizations
  tests: allclose changes
  tests: test_documentation_models: reenable parametrizations
  github-actions: Add job running --benchmark-enable
  tests/AudodiffComposition: Add helper function to return the first set of learning results
  github-actions: Run all tests with --fp-precision=fp32
  tests/Autodiff: Check for execution mode PyTorch in test_optimizer specs
  tests/control: FP32 should only be used in compiled tests
  tests/xor_training_identicalness: Convert to use autodiff_mode
  tests/MemoryFunction: Prefer np.testing.assert_equal to assert np.all(==)
  test/AutodiffComposition: Use np.testing.assert_equal instead of assert np.all(==)
  requirements: update beartype requirement from <0.13.0 to <0.14.0 (PrincetonUniversity#2625)
  requirements: update pytest requirement from <7.2.3 to <7.3.1 (PrincetonUniversity#2627)
  requirements: Drop grpcio-tools
  requirements: Add protobuf to dependency list
  {dev,tutorial}_requirements: Use sharp inequality for jupyter upper bound
  dev_requirements: Use sharp inequality of pytest-profiling upper bound
  requirements: Sort alphabetically
  requirements: Use sharp inequality for leabra-psyneulink upper bound
  requirements: Fix dill dependency upper bound
  requirements: Use sharp inequality for bear type upper bound
  Tentative learning branch (PrincetonUniversity#2623)
  tests/llvm/multiple_executions: Use np.testing.assert_allclose to check resutls (PrincetonUniversity#2621)
  requirements: update pandas requirement from <1.5.4 to <2.0.1 (PrincetonUniversity#2619)
  Add back rate validation in constructor.
  Add back validation I added for offset.
  Remove validation I added for offset.
  Add validate methods as kmantel suggests
  requirements: update pillow requirement from <9.5.0 to <9.6.0 (PrincetonUniversity#2618)
  Remove typecheck-decorator requirment.
  Fix some annotations.
  requirements: update networkx requirement from <3.1 to <3.2 (PrincetonUniversity#2620)
  Nback (PrincetonUniversity#2617)
  Fix/contentaddressablememory empty entry (PrincetonUniversity#2616)
  Fix some annotations on learning methods.
  Fix some issues with merge of composition.
  Fix type annotation on _get_port_value_labels
  Remove check_user_specified in places.
  Replace typecheck decorator with beartype
  Add typecheck decorator back temporarily
  llvm: Add human readable name to _node_wrapper instances
  llvm: Use WeakRefDictionary for node wrappers
  llvm/builder_context: Use proxy object for _node_wrapper owning composition
  remove redefinition of ENTROPY keyword
  Raise KeyError on MechanismList.__seitem__
  fix some lgtm errors
  remove unused imports
  revert ci testing changes completely for now.
  Fix codestyle errors.
  Revert back to testing on Python 3.9.
  Fix specifcation of Python 3.10 in ci workflow
  Fixes for Python 3.7
  Enable tests for python 3.10 in CI.
  Add beartype for runtime type checking.
  Replace typecheck import with beartype
  Removed all the tc.optional typecheck annotations
  replaced all typecheck enums with Literal
  Replace is_function_type with static type
  Replace is_pref_set with static type
  Replace parameter_spec with static type.
  Remove dead code in parameter_spec
  ran some regexes to replace easy type hints
  fix for some tests that expect runtime type checks
  Comment out all typecheck decorations.
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