app
Main typer app.py file for hpcman
Imports all submodules. App is actually started in the __main__.py
file. We turn off auto-completion because it
clutters the help message. We add a -h
option for help messages as well, as the underlying click command does not
support it. rich_markup_mode="rich"
allows us to use rich markup in the help messages (i.e. colors, emojis, etc.).
app is generated from a function so type hinting works properly.
Attributes:
Name | Type | Description |
---|---|---|
app |
typer.Typer
|
The main app object. |
generate_app()
Generate the main app object.
Returns:
Name | Type | Description |
---|---|---|
app |
typer.Typer
|
Main app object with generalized settings. |
Source code in hpcman/app.py
import_submodules(app)
Imports submodules using importlib.
Uses the find_submodules()
function specified in the __init__.py
file.
Returns:
Name | Type | Description |
---|---|---|
app |
typer.Typer
|
Main app object with imported submodules. |
Source code in hpcman/app.py
version()
Print version number and exit.
Uses the get_version()
function specified in the __init__.py
file.
Instead of using a --version
flag, this command will print the version.
Returns:
Type | Description |
---|---|
None
|
None |