-
Is your feature request related to a problem? Please describeThis might be a bit of a corner case, but I'd like to start and stop my app via a Describe the solution you'd likeThis would be easy to change, by refactoring it into an regular function and a cli wrapper with the click decorators. So, basically how it's done for Describe alternatives you've consideredWhat already worked in principle was to start the app as a subprocess with EDIT: Still, I think the refactoring wouldn't hurt :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The trick is to get the path to your current running python executable via You may specify the path to the
Yep, that's a proven fact :). Using |
Beta Was this translation helpful? Give feedback.
-
Adding a few examples of how we do it Line 38 in db5b17c Line 46 in db5b17c |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response and the examples! I blanked on the option to use |
Beta Was this translation helpful? Give feedback.
The trick is to get the path to your current running python executable via
sys.executable
or manual path, instead of using the global python.You may specify the path to the
wave
executable, something likesubprocess.run(['venv', 'bin', 'wave', 'run', 'app'])
or run it likepython -m uvicorn --host 0.0.0.0 --port 8000 app.py:main
(also within subprocess) which shall be the equivalent towave run
.