tests: add typing annotations to lttng_live_server.py
Add typing annotations throughout lttng_live_server.py, such that
pyright passes cleanly in strict mode.
Specify in a comment in lttng_live_server.py to run in strict mode, but
disable these two warnings:
- reportTypeCommentUsage: we need to use the comment form to support
Python 3.4
- reportMissingTypeStubs: it would complain about not having a stub
file for the utils module (although it can inspect utils.py just
fine)
Note that the sessions_filename variable near the bottom is marked as a
string, even though it's currently an optional argument (so it should be
`str | None`). But the rest of the code treats it as non-optional.
This is corrected in a subsequent patch that makes the sessions filename
mandatory.
Change the way lttng_live_server.py is launched to use run_python, to
have access to Python modules in tests/utils/python, to have access to
jsonw.py and possible the typing module shim for Python 3.4.
Change-Id: I842f4c696eea7c99932876af26c195bf99d5cfff
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10869
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.058256 seconds and 4 git commands to generate.