-
-
Notifications
You must be signed in to change notification settings - Fork 473
Description
What is the problem or limitation you are having?
briefcase dev is the documented way to run a Briefcase app; however, the only way to debug an app with briefcase dev is to set a breakpoint() and use pdb. This is less than ideal, as modern IDEs provide built-in debuggers and test runners.
Describe the solution you'd like
Add documentation how to configure VSCode, PyCharm, and other common IDEs so that their native "run" and "test" mechanisms reproduce what briefcase dev does.
The tl;dr is that you need to:
- Add every directory mentioned in
sourcesto the PYTHONPATH - Set the working directory to the user's home directory
- Remove the project directory (the directory that contains pyproject.toml
from the PYTHONPATH (it's usually the first entry insys.path`) - Run the app name as a module (i.e., the equivalent of
python -m myapp)
To run in test mode, you also need to add all the directories mentioned in test_sources, plus change the runtime module to tests.myapp.
Specifics can be found by reverse engineering src/briefcase/commands/dev.py.
We should document the specific instructions for configuring common IDEs (at present, I'd say that means VSCode and PyCharm); but we should also document the generic requirements so that any other IDE user knows what is needed.
Describe alternatives you've considered
Continue to encourage briefcase dev and breakpoint().
Additional context
Documenting manual configuration is a stop-gap measure. Longer term, it would be desirable to capture these instructions as a Briefcase plugin for VSCode and PyCharm.