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

Move reactpy.backend.hooks module into reactpy.core.hooks #1210

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

joshbmair
Copy link

@joshbmair joshbmair commented Mar 7, 2024

Description

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

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • 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 joshbmair marked this pull request as ready for review March 7, 2024 06:50
Copy link
Contributor

@Archmonger Archmonger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be merged after resolving my minor nitpick.

src/py/reactpy/reactpy/core/hooks.py Show resolved Hide resolved
Copy link
Contributor

@Archmonger Archmonger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some formatting fixes to pass linting tests.

Also, coverage is failing right now. You'll need to convert the existing tests to use your new hooks, and add # nocov to the top of the deprecated file.

@joshbmair
Copy link
Author

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.

@Archmonger
Copy link
Contributor

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.

@joshbmair
Copy link
Author

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.

@Archmonger
Copy link
Contributor

Archmonger commented Mar 14, 2024

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.

@joshbmair
Copy link
Author

Why do you mean by pin mypy?

@joshbmair
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove reactpy.backend.hooks
2 participants