reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Move `reactpy.backend.hooks` module into `reactpy.core.hooks`

Open joshbmair opened this issue 1 year ago • 6 comments
trafficstars

Description

Fixes #1182 - Moves the hooks in reactpy.backend.hooks into reactpy.core.hooks

Checklist

Please update this checklist as you complete each item:

  • [X] Tests have been developed for bug fixes or new functionality.
  • [X] The changelog has been updated, if necessary.
  • [X] Documentation has been updated, if necessary.
  • [X] GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

joshbmair avatar Mar 07 '24 06:03 joshbmair

I'm having trouble with adding the # nocov comment at the top of backend.hooks. It seems to only be working on the first import line instead of the whole file.

joshbmair avatar Mar 14 '24 01:03 joshbmair

Hmm I thought there was a way to do it for the whole file. Worst case you could add that comment to each individual hook in the file.

Archmonger avatar Mar 14 '24 01:03 Archmonger

I decided to add nocov comments to every import/function. Let me know if there's a more concise way to do it, because I couldn't figure it out.

joshbmair avatar Mar 14 '24 01:03 joshbmair

Still not passing lint: reactpy/core/hooks.py:504: error: Incompatible return value type (got "Sequence[Any] | EllipsisType | None", expected "Sequence[Any] | None") [return-value]****

EDIT: Might be unrelated to your changes? If so, you can pin mypy to the previous version that doesn't break tests.

Archmonger avatar Mar 14 '24 01:03 Archmonger

Why do you mean by pin mypy?

joshbmair avatar Mar 14 '24 22:03 joshbmair

I don't see how my changes could have caused the lint error we're seeing, so I think I'm good to add mypy to the most recent version that doesn't break tests (once I know how to do that).

joshbmair avatar Mar 14 '24 23:03 joshbmair