Command line interface

This tooling is a bit sparse right now. Perhaps other useful helpers will be identified in the future.

qts

qts [OPTIONS] COMMAND [ARGS]...

mypy

qts mypy [OPTIONS] COMMAND [ARGS]...

args

Generate arguments to be passed to mypy so it can understand which code should be active. If applications or other libraries use the same conditions in their code then this will work for them as well. The output can be directly injected in some shells such as is done below in bash.

$ mypy $(qts mypy args --wrapper pyside6) my_file.py

The module import selection code in qts itself can act as a reference.

 1import qts
 2
 3
 4if qts.wrapper is None:
 5    raise qts.NoWrapperSelectedError()
 6elif qts.is_pyqt_5_wrapper:
 7    from PyQt5.QtCore import *
 8elif qts.is_pyqt_6_wrapper:
 9    from PyQt6.QtCore import *
10elif qts.is_pyside_5_wrapper:
11    from PySide2.QtCore import *
12elif qts.is_pyside_6_wrapper:
13    from PySide6.QtCore import *
14else:
15    raise qts.InvalidWrapperError(wrapper=qts.wrapper)
qts mypy args [OPTIONS]

Options

--wrapper <wrapper_name>
Options

PyQt5 | PyQt6 | PySide2 | PySide6

--delimiter <delimiter>

Defaults to a space for TTYs and a newline otherwise.