transcrypto 1.7.0__py3-none-any.whl → 1.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
transcrypto/profiler.py CHANGED
@@ -24,11 +24,13 @@ from collections import abc
24
24
  import typer
25
25
  from rich import console as rich_console
26
26
 
27
+ from transcrypto.cli import clibase
28
+
27
29
  from . import __version__, base, dsa, modmath
28
30
 
29
31
 
30
32
  @dataclasses.dataclass(kw_only=True, slots=True, frozen=True)
31
- class ProfilerConfig(base.CLIConfig):
33
+ class ProfilerConfig(clibase.CLIConfig):
32
34
  """CLI global context, storing the configuration."""
33
35
 
34
36
  serial: bool
@@ -62,6 +64,7 @@ def Run() -> None:
62
64
  invoke_without_command=True, # have only one; this is the "constructor"
63
65
  help='Profile TransCrypto library performance.',
64
66
  )
67
+ @clibase.CLIErrorGuard
65
68
  def Main( # documentation is help/epilog/args # noqa: D103
66
69
  *,
67
70
  ctx: typer.Context, # global context
@@ -121,7 +124,7 @@ def Main( # documentation is help/epilog/args # noqa: D103
121
124
  if version:
122
125
  typer.echo(__version__)
123
126
  raise typer.Exit(0)
124
- console, verbose, color = base.InitLogging(
127
+ console, verbose, color = clibase.InitLogging(
125
128
  verbose,
126
129
  color=color,
127
130
  include_process=False, # decide if you want process names in logs
@@ -156,7 +159,7 @@ def Main( # documentation is help/epilog/args # noqa: D103
156
159
  'Finished in 40.07 min'
157
160
  ),
158
161
  )
159
- @base.CLIErrorGuard
162
+ @clibase.CLIErrorGuard
160
163
  def Primes(*, ctx: typer.Context) -> None: # documentation is help/epilog/args # noqa: D103
161
164
  config: ProfilerConfig = ctx.obj # get application global config
162
165
  config.console.print(
@@ -186,7 +189,7 @@ def Primes(*, ctx: typer.Context) -> None: # documentation is help/epilog/args
186
189
  'Finished in 4.12 s'
187
190
  ),
188
191
  )
189
- @base.CLIErrorGuard
192
+ @clibase.CLIErrorGuard
190
193
  def DSA(*, ctx: typer.Context) -> None: # documentation is help/epilog/args # noqa: D103
191
194
  config: ProfilerConfig = ctx.obj # get application global config
192
195
  config.console.print(
@@ -206,10 +209,10 @@ def DSA(*, ctx: typer.Context) -> None: # documentation is help/epilog/args # n
206
209
  help='Emit Markdown docs for the CLI (see README.md section "Creating a New Version").',
207
210
  epilog='Example:\n\n\n\n$ poetry run profiler markdown > profiler.md\n\n<<saves CLI doc>>',
208
211
  )
209
- @base.CLIErrorGuard
212
+ @clibase.CLIErrorGuard
210
213
  def Markdown() -> None: # documentation is help/epilog/args # noqa: D103
211
- console: rich_console.Console = base.Console()
212
- console.print(base.GenerateTyperHelpMarkdown(app, prog_name='profiler'))
214
+ console: rich_console.Console = clibase.Console()
215
+ console.print(clibase.GenerateTyperHelpMarkdown(app, prog_name='profiler'))
213
216
 
214
217
 
215
218
  def _PrimeProfiler(