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

Add a REPL to the CLI #2859

Merged
merged 18 commits into from
Dec 13, 2023
Merged

Add a REPL to the CLI #2859

merged 18 commits into from
Dec 13, 2023

Conversation

ahopkins
Copy link
Member

This comes from a request in the forums: https://community.sanicframework.org/t/sanic-implement-shell-like-flask-shell/1234

The actual implementation adds a --repl flag to the CLI. By default, --dev will also enable it.

image

The way it works is by opening a Python REPL in the main process. It will also enable a client for easy access to calling the app. But, one thing that it might confuse people is that altering the app instance in the main will obviously not make it available in the HTTP client. So there probably needs to be some kind of warnings. Also there should be some safety re: TTY, etc.

@ahopkins
Copy link
Member Author

This pull request has been mentioned on Sanic Community Discussion. There might be relevant details there:

https://community.sanicframework.org/t/sanic-implement-shell-like-flask-shell/1234/5

Copy link

codecov bot commented Nov 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6d28dc2) 88.240% compared to head (d4ebc6d) 88.104%.

Additional details and impacted files
@@              Coverage Diff              @@
##              main     #2859       +/-   ##
=============================================
- Coverage   88.240%   88.104%   -0.137%     
=============================================
  Files           93        93               
  Lines         7305      7305               
  Branches      1254      1254               
=============================================
- Hits          6446      6436       -10     
- Misses         600       606        +6     
- Partials       259       263        +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahopkins ahopkins marked this pull request as ready for review December 5, 2023 12:18
@ahopkins ahopkins requested review from a team as code owners December 5, 2023 12:18
@ahopkins ahopkins merged commit 25212fc into main Dec 13, 2023
26 checks passed
@ahopkins ahopkins deleted the repl branch December 13, 2023 05:50
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.

2 participants