| 1 |
"""`pyvista report` CLI.""" |
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
from functools import wraps |
| 6 |
from typing import get_type_hints |
| 7 |
|
| 8 |
import pyvista as pv |
| 9 |
from pyvista import Report |
| 10 |
|
| 11 |
from .app import app |
| 12 |
from .utils import HELP_FORMATTER |
| 13 |
|
| 14 |
# Assign annotations to be able to use the Report class using |
| 15 |
# cyclopts when __future__ annotations are enabled. See https://github.com/BrianPugh/cyclopts/issues/570 |
| 16 |
Report.__init__.__annotations__ = get_type_hints(Report.__init__) |
| 17 |
|
| 18 |
|
| 19 |
@app.command( |
| 20 |
usage=f'Usage: [bold]{pv.__name__} report [ARGS]', |
| 21 |
help_formatter=HELP_FORMATTER, |
| 22 |
help='Generate a PyVista software environment report.', |
| 23 |
) |
| 24 |
@wraps(Report) |
| 25 |
def _report(*args, **kwargs) -> Report: |
| 26 |
return Report(*args, **kwargs) |