Skip to content

Test: Implement automatic configuration for FastAPI #19548

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
3 tasks done
paulacamargo25 opened this issue Jul 25, 2022 · 0 comments
Closed
3 tasks done

Test: Implement automatic configuration for FastAPI #19548

paulacamargo25 opened this issue Jul 25, 2022 · 0 comments

Comments

@paulacamargo25
Copy link

paulacamargo25 commented Jul 25, 2022

Refs: #19452

Complexity: 3

Create Issue


Automatically detect a FastAPI application and run it with the correct Debug Configuration.

Steps

  1. Open a FastAPI Project if you already have one or you can also create one following the steps in the FastAPI Tutorial.
  2. Head over to the Run And Debug tab, and click on Show all automatic debug configurations.

Screen Shot 2022-07-25 at 2 09 44 PM

  1. A window will open with a list of options, choose Python.
  2. You should now see a list of debug options, and there should be the FastAPI option. Click it and the application should run.

Verification

  1. Make sure that the application has been executed correctly, you can put some breakpoints, to test that the debugging works.
  2. If you repeat the steps and instead of clicking the option, you click the wheel, it should open the launch.json file with the configuration prefilled. Make sure this is correct and can be debugged.
  3. Another form to show the automatic configuration is typing 'debug ' (with a space) in Quick open (⌘P) or by triggering the Debug: Select and Start Debugging command. Test that the Django Debugging recognition works here too.

Notes

FastAPI application detection works by looking for the main.py and app.py files in the root or in a subdirectory just one level lower and looking for them to have the declaration of a fastAPI application app = FastAPI(. So you can try moving the python file and changing the name, and check that the detection still works.

@paulacamargo25 paulacamargo25 added this to the July 2022 milestone Jul 25, 2022
@ghost ghost assigned lszomoru, minsa110 and lramos15 Jul 26, 2022
@lramos15 lramos15 removed their assignment Jul 26, 2022
@lszomoru lszomoru removed their assignment Jul 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants