Make it easier to debug functions in IDEs
See original GitHub issueCurrently, it is super hard to configure the local debug of the functions in PyCharm, moreover, I found it impossible without hacking the cli.py
.
Here is a way to do it in PyCharm now:
- Add main function to the
cli.py
:if __name__ == '__main__': cli(sys.argv[1:])
- Create PyCharm Python config and choose
functions_framework\cli.py
as a script. - Pass required params as
Parameters
in the configuration, e.g.--port 8088 --signature-type http
, etc. - Make sure to set the working directory to the project root (so that the functions framework is able to load the entry point function).
- Run the created configurations and use PyCharm debugger.
What we can to make life easier:
- Create
__main__.py
in the functions_framework module and allow running the module as the CLI. Or, add the main function to thecli.py
itself, maybe worth having both. - Create well-structured documentation about debugging functions locally with popular IDEs (PyCharm, VSCode, others?)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Debugging in IDEs
Eclipse includes a debugging interface that makes many debugging tasks simple. Example 2: Try This: Eclipse Debugger. Launch the Eclipse IDE ...
Read more >How does the debug function for IDEs work?
Typically one runs one's program in debug mode, which executes it but attaches to the process with the debugger. Then one can set...
Read more >Why is debugging better in an IDE? [closed]
My general opinion is that IDE debuggers are absolutely, amazingly wonderful for managed languages like Java or C#, are fairly useful for C++, ......
Read more >How to Debug Java Code Faster with Eclipse
1. A breakpoint is a point in code where the program execution pauses during debugging. This allows the programmer to inspect code and...
Read more >Code completion - IDEs & Debugging - milliams.com
They're not magic and can't write the code for you but they will make it easier to remember the names of functions and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
nvm - found it:
Hi @yuri-sergiichuk, can you try this branch and let me know if it works for you?
You should be able to install it with: