Skip to content

Uvicorn is imported in common backend module #999

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

Closed
rmorshea opened this issue May 25, 2023 · 2 comments · Fixed by #1006
Closed

Uvicorn is imported in common backend module #999

rmorshea opened this issue May 25, 2023 · 2 comments · Fixed by #1006
Labels
priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release
Milestone

Comments

@rmorshea
Copy link
Collaborator

Current Situation

Currently Uvicorn gets imported in reactpy.backend._common. This is a problem because not all backends require uvicorn (e.g. Flask). Thus you can get an import error.

Proposed Actions

Make uvicorn a common dependency or import it in a try block.

@rmorshea rmorshea added type-bug priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release labels May 25, 2023
@rmorshea rmorshea added this to the 1.0.1 milestone May 25, 2023
@rmorshea
Copy link
Collaborator Author

I think this has happened before. We might consider just making this a common dependency.

@Archmonger
Copy link
Contributor

Archmonger commented May 25, 2023

I don't think it should be a common dependency, solely because reactpy can be installed without specifying any backends.

But I do think Uvicorn should be our default webserver for all reactpy.run calls, assuming a backend was specified during install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. release-patch Warrents a patch release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants