File tree Expand file tree Collapse file tree 4 files changed +33
-4
lines changed Expand file tree Collapse file tree 4 files changed +33
-4
lines changed Original file line number Diff line number Diff line change
1
+
2
+ TyperCommand TyperCommand
3
+ BaseCommand TyperCommand (rich) --help (rich)
4
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5
+ modules 550 592 745 746
6
+ time 0.16 0.17 0.24 0.22
7
+ imports 0.10 0.12 0.16 0.17
8
+
Original file line number Diff line number Diff line change
1
+
2
+ polls
3
+ polls polls --help shell
4
+ polls --help polls shell (typer (typer completion
5
+ (tutorial) (tutorial) (typer) completi… w/rich) w/rich) (rich)
6
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7
+ modules 573 551 615 606 768 747 755
8
+ time 0.15 0.15 0.17 0.20 0.24 0.22 0.27
9
+ imports 0.11 0.10 0.12 0.12 0.16 0.15 0.15
10
+
Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ improvements <https://github.com/django-commons/django-typer/issues/170>`_ are m
37
37
38
38
.. only :: latex
39
39
40
- .. image :: _static/img/minimal_profile.svg
41
- :width: 80%
40
+ .. literalinclude :: _static/img/minimal_profile.txt
42
41
43
42
The second benchmark shows the same stats for the :ref: `polls example code <building_commands >`.
44
43
These benchmarks compare the :class: `~django.core.management.BaseCommand ` native implementation
@@ -54,5 +53,4 @@ using :pypi:`django-typer` is minimal. On the order of a few 10s of milliseconds
54
53
55
54
.. only :: latex
56
55
57
- .. image :: _static/img/polls_profile.svg
58
- :width: 80%
56
+ .. literalinclude :: _static/img/polls_profile.txt
Original file line number Diff line number Diff line change @@ -420,6 +420,13 @@ def minimal_table():
420
420
Path (__file__ ).parent .parent / "doc/source/_static/img/minimal_profile.svg"
421
421
).write_text (svg , encoding = "utf-8" )
422
422
423
+ console .print (table )
424
+
425
+ svg = console .export_text () # export as a string
426
+ (
427
+ Path (__file__ ).parent .parent / "doc/source/_static/img/minimal_profile.txt"
428
+ ).write_text (svg , encoding = "utf-8" )
429
+
423
430
def polls_table ():
424
431
console = Console (record = True , width = 100 )
425
432
@@ -532,6 +539,12 @@ def polls_table():
532
539
Path (__file__ ).parent .parent / "doc/source/_static/img/polls_profile.svg"
533
540
).write_text (svg , encoding = "utf-8" )
534
541
542
+ console .print (table )
543
+ svg = console .export_text () # export as a string
544
+ (
545
+ Path (__file__ ).parent .parent / "doc/source/_static/img/polls_profile.txt"
546
+ ).write_text (svg , encoding = "utf-8" )
547
+
535
548
minimal_table ()
536
549
polls_table ()
537
550
You can’t perform that action at this time.
0 commit comments