Ravenports generated: 27 Oct 2023 17:09
[ravenports.git] / bucket_B5 / python-django-rich
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-django-rich
4 VERSION=                1.8.0
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
7 SDESC[v11]=             Extensions for using Rich with Django (3.11)
8 SDESC[v12]=             Extensions for using Rich with Django (3.12)
9 HOMEPAGE=               https://github.com/adamchainz/django-rich
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/45/e4/1066e09a562333f587598ae20e5991beb07751ed94f350c8aae21a476b67
14 DISTFILE[1]=            django_rich-1.8.0-py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               django_rich-1.8.0.dist-info
25
26 GENERATED=              yes
27
28 [PY311].RUN_DEPENDS_ON=                 python-Django:single:v11
29                                         python-rich:single:v11
30 [PY311].USES_ON=                        python:v11,wheel
31
32 [PY312].RUN_DEPENDS_ON=                 python-Django:single:v12
33                                         python-rich:single:v12
34 [PY312].USES_ON=                        python:v12,wheel
35
36 [FILE:2587:descriptions/desc.single]
37 ===========
38 django-rich
39 ===========
40
41    :alt: pre-commit
42
43 Extensions for using [Rich] with Django.
44
45 Requirements
46 ------------
47
48 Python 3.8 to 3.12 supported.
49
50 Django 3.2 to 5.0 supported.
51
52 ----
53
54 **Want to work smarter and faster?**
55 Check out my book [Boost Your Django DX] which covers many ways to improve
56 your development experience.
57 I wrote django-rich whilst working on the book!
58
59 ----
60
61 Installation
62 ------------
63
64 1. Install with **pip**:
65
66    .. code-block:: sh
67
68        python -m pip install django-rich
69
70 None of django-rich’s features are activated by default.
71 Follow the documentation below to use them.
72
73 Reference
74 ---------
75
76 ``django_rich.management.RichCommand``
77 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
79 A subclass of Django’s |BaseCommand|__ class that sets its
80 ``self.console`` to a Rich |Console|__.
81 The Console uses the command’s stdout argument, which defaults to
82 ``sys.stdout``.
83 Colourization is enabled or disabled according to Django’s ``--no-color
84 and --force-color`` flags.
85
86 .. |BaseCommand| replace:: BaseCommand
87 __
88 https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand
89
90 .. |Console| replace:: Console
91 __ https://rich.readthedocs.io/en/stable/console.html
92
93 You can use ``self.console`` like so:
94
95 .. code-block:: python
96
97     from django_rich.management import RichCommand
98
99     class Command(RichCommand):
100         def handle(self, *args, **options):
101             self.console.print("[bold red]Alert![/bold red]")
102
103 You can customize the construction of the Console by overriding the
104 make_rich_console class attribute.
105 This should be a callable that returns a Console, such as a
106 |functools.partial|__.
107 For example, to disable the default-on markup and highlighting flags:
108
109 .. |functools.partial| replace:: ``functools.partial``
110 __ https://docs.python.org/3/library/functools.html#functools.partial
111
112 .. code-block:: python
113
114     from functools import partial
115
116     from django_rich.management import RichCommand
117     from rich.console import Console
118
119     class Command(RichCommand):
120         make_rich_console = partial(Console, markup=False, highlight=False)
121
122         def handle(self, *args, **options):
123             ...
124
125 ``django_rich.test.RichRunner``
126 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127
128 A subclass of Django's |DiscoverRunner|__ with colourized outputs and [nice
129 traceback rendering].
130
131 .. image::
132 https://raw.githubusercontent.com/adamchainz/django-rich/main/img/RichRunner.png
133
134 .. |DiscoverRunner| replace:: DiscoverRunner
135 __
136 https://docs.djangoproject.com/en/stable/topics/testing/advanced/#defining-a-test-runner
137
138
139 [FILE:113:distinfo]
140 3016daddfa68428e633b9fd0f26245c7ab88a301bb6373d0423f5c328ec36673         7082 django_rich-1.8.0-py3-none-any.whl
141