rich-click 1.9.0.dev0__tar.gz → 1.9.0.dev2__tar.gz

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.
Files changed (45) hide show
  1. {rich_click-1.9.0.dev0/src/rich_click.egg-info → rich_click-1.9.0.dev2}/PKG-INFO +12 -9
  2. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/README.md +10 -7
  3. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/pyproject.toml +3 -2
  4. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/__init__.py +4 -1
  5. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/_compat_click.py +3 -3
  6. rich_click-1.9.0.dev2/src/rich_click/cli.py +568 -0
  7. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/decorators.py +25 -19
  8. rich_click-1.9.0.dev2/src/rich_click/decorators.pyi +828 -0
  9. rich_click-1.9.0.dev2/src/rich_click/patch.py +72 -0
  10. rich_click-1.9.0.dev2/src/rich_click/rich_box.py +52 -0
  11. rich_click-1.9.0.dev2/src/rich_click/rich_click.py +214 -0
  12. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/rich_command.py +94 -56
  13. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/rich_context.py +8 -0
  14. rich_click-1.9.0.dev2/src/rich_click/rich_help_configuration.py +444 -0
  15. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/rich_help_formatter.py +44 -95
  16. rich_click-1.9.0.dev2/src/rich_click/rich_help_rendering.py +998 -0
  17. rich_click-1.9.0.dev2/src/rich_click/rich_panel.py +746 -0
  18. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/rich_parameter.py +9 -3
  19. rich_click-1.9.0.dev2/src/rich_click/rich_theme.py +817 -0
  20. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/utils.py +1 -1
  21. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2/src/rich_click.egg-info}/PKG-INFO +12 -9
  22. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click.egg-info/SOURCES.txt +3 -0
  23. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click.egg-info/requires.txt +1 -1
  24. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/tests/test_config.py +74 -2
  25. rich_click-1.9.0.dev2/tests/test_misc.py +61 -0
  26. rich_click-1.9.0.dev2/tests/test_no_rich_imports.py +141 -0
  27. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/tests/test_rich_click_cli.py +67 -64
  28. rich_click-1.9.0.dev0/src/rich_click/cli.py +0 -265
  29. rich_click-1.9.0.dev0/src/rich_click/patch.py +0 -65
  30. rich_click-1.9.0.dev0/src/rich_click/rich_click.py +0 -164
  31. rich_click-1.9.0.dev0/src/rich_click/rich_help_configuration.py +0 -295
  32. rich_click-1.9.0.dev0/src/rich_click/rich_help_rendering.py +0 -730
  33. rich_click-1.9.0.dev0/src/rich_click/rich_panel.py +0 -522
  34. rich_click-1.9.0.dev0/tests/test_misc.py +0 -37
  35. rich_click-1.9.0.dev0/tests/test_no_rich_imports.py +0 -61
  36. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/LICENSE +0 -0
  37. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/setup.cfg +0 -0
  38. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/__main__.py +0 -0
  39. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/py.typed +0 -0
  40. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click/rich_group.py +0 -0
  41. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click.egg-info/dependency_links.txt +0 -0
  42. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click.egg-info/entry_points.txt +0 -0
  43. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/src/rich_click.egg-info/top_level.txt +0 -0
  44. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/tests/test_deprecations.py +0 -0
  45. {rich_click-1.9.0.dev0 → rich_click-1.9.0.dev2}/tests/test_exit_code.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rich-click
3
- Version: 1.9.0.dev0
3
+ Version: 1.9.0.dev2
4
4
  Summary: Format click help output nicely with rich
5
5
  Author-email: Phil Ewels <phil@ewels.co.uk>
6
6
  Maintainer-email: Phil Ewels <phil@ewels.co.uk>, Daniel Reeves <xdanielreeves@gmail.com>
@@ -64,7 +64,7 @@ Requires-Dist: mike>=2.1.3; extra == "docs"
64
64
  Requires-Dist: mkdocs[docs]>=1.6.1; extra == "docs"
65
65
  Requires-Dist: mkdocs-github-admonitions-plugin>=0.1.1; extra == "docs"
66
66
  Requires-Dist: mkdocs-glightbox>=0.4; extra == "docs"
67
- Requires-Dist: mkdocs-include-markdown-plugin>=7.1.6; python_version >= "3.9" and extra == "docs"
67
+ Requires-Dist: mkdocs-include-markdown-plugin>=7.1.7; python_version >= "3.9" and extra == "docs"
68
68
  Requires-Dist: mkdocs-material[imaging]~=9.5.18; extra == "docs"
69
69
  Requires-Dist: mkdocs-material-extensions>=1.3.1; extra == "docs"
70
70
  Requires-Dist: mkdocs-rss-plugin>=1.15; extra == "docs"
@@ -95,7 +95,8 @@ Dynamic: license-file
95
95
 
96
96
  ---
97
97
 
98
- **rich-click** is a shim around [Click](https://click.palletsprojects.com/) that renders help output nicely using [Rich](https://github.com/Textualize/rich).
98
+ <!--include-start-->
99
+ **rich-click** is a wrapper around [Click](https://click.palletsprojects.com/) that renders help output nicely using [Rich](https://github.com/Textualize/rich).
99
100
 
100
101
  - Click is a _"Python package for creating beautiful command line interfaces"_.
101
102
  - Rich is a _"Python library for rich text and beautiful formatting in the terminal"_.
@@ -107,13 +108,13 @@ Click, formatted with Rich, with minimal customization required.
107
108
 
108
109
  - 🌈 Rich command-line formatting of click help and error messages
109
110
  - 😌 Same API as Click: usage is simply `import rich_click as click`
110
- - 💫 Nice styles by default
111
+ - 🎨 Over 100 themes that can be set by developers and end-users (`export RICH_CLICK_THEME=...`)
111
112
  - 💻 CLI tool to run on _other people's_ tools (prefix the command with `rich-click`)
112
113
  - 📦 Export help text as HTML or SVG
113
114
  - 🎁 Group commands and options into named panels
114
115
  - ❌ Well formatted error messages
115
- - 🔢 Easily give custom sort order for options and commands
116
- - 🎨 Extensive customization of styling and behaviour possible
116
+ - 💫 Extensive customization
117
+ - 🤖 IDE autocomplete of Click decorators for smooth developer experience.
117
118
 
118
119
  ## Installation
119
120
 
@@ -121,8 +122,6 @@ Click, formatted with Rich, with minimal customization required.
121
122
  pip install rich-click
122
123
  ```
123
124
 
124
- [Read the docs](https://ewels.github.io/rich-click#installation) for all supported installation methods.
125
-
126
125
  ## Examples
127
126
 
128
127
  ### Simple Example
@@ -150,7 +149,11 @@ _Screenshot from [`examples/11_hello.py`](examples/11_hello.py)_
150
149
 
151
150
  ### More complex example
152
151
 
153
- ![`python examples/03_groups_sorting.py`](docs/images/command_groups.svg)
152
+ **rich-click** has a ton of customization options that let you compose help text however you'd like.
153
+
154
+ Below is a more complex example of what **rich-click** is capable of, utilizing **themes** and **panels**:
155
+
156
+ ![`python examples/03_groups_sorting.py --help`](docs/images/command_groups.svg)
154
157
 
155
158
  _Screenshot from [`examples/03_groups_sorting.py`](examples/03_groups_sorting.py)_
156
159
 
@@ -21,7 +21,8 @@
21
21
 
22
22
  ---
23
23
 
24
- **rich-click** is a shim around [Click](https://click.palletsprojects.com/) that renders help output nicely using [Rich](https://github.com/Textualize/rich).
24
+ <!--include-start-->
25
+ **rich-click** is a wrapper around [Click](https://click.palletsprojects.com/) that renders help output nicely using [Rich](https://github.com/Textualize/rich).
25
26
 
26
27
  - Click is a _"Python package for creating beautiful command line interfaces"_.
27
28
  - Rich is a _"Python library for rich text and beautiful formatting in the terminal"_.
@@ -33,13 +34,13 @@ Click, formatted with Rich, with minimal customization required.
33
34
 
34
35
  - 🌈 Rich command-line formatting of click help and error messages
35
36
  - 😌 Same API as Click: usage is simply `import rich_click as click`
36
- - 💫 Nice styles by default
37
+ - 🎨 Over 100 themes that can be set by developers and end-users (`export RICH_CLICK_THEME=...`)
37
38
  - 💻 CLI tool to run on _other people's_ tools (prefix the command with `rich-click`)
38
39
  - 📦 Export help text as HTML or SVG
39
40
  - 🎁 Group commands and options into named panels
40
41
  - ❌ Well formatted error messages
41
- - 🔢 Easily give custom sort order for options and commands
42
- - 🎨 Extensive customization of styling and behaviour possible
42
+ - 💫 Extensive customization
43
+ - 🤖 IDE autocomplete of Click decorators for smooth developer experience.
43
44
 
44
45
  ## Installation
45
46
 
@@ -47,8 +48,6 @@ Click, formatted with Rich, with minimal customization required.
47
48
  pip install rich-click
48
49
  ```
49
50
 
50
- [Read the docs](https://ewels.github.io/rich-click#installation) for all supported installation methods.
51
-
52
51
  ## Examples
53
52
 
54
53
  ### Simple Example
@@ -76,7 +75,11 @@ _Screenshot from [`examples/11_hello.py`](examples/11_hello.py)_
76
75
 
77
76
  ### More complex example
78
77
 
79
- ![`python examples/03_groups_sorting.py`](docs/images/command_groups.svg)
78
+ **rich-click** has a ton of customization options that let you compose help text however you'd like.
79
+
80
+ Below is a more complex example of what **rich-click** is capable of, utilizing **themes** and **panels**:
81
+
82
+ ![`python examples/03_groups_sorting.py --help`](docs/images/command_groups.svg)
80
83
 
81
84
  _Screenshot from [`examples/03_groups_sorting.py`](examples/03_groups_sorting.py)_
82
85
 
@@ -54,7 +54,7 @@ optional-dependencies.docs = [
54
54
  "mkdocs[docs]>=1.6.1",
55
55
  "mkdocs-github-admonitions-plugin>=0.1.1",
56
56
  "mkdocs-glightbox>=0.4",
57
- "mkdocs-include-markdown-plugin>=7.1.6; python_version>='3.9'",
57
+ "mkdocs-include-markdown-plugin>=7.1.7; python_version>='3.9'",
58
58
  "mkdocs-material[imaging]~=9.5.18",
59
59
  "mkdocs-material-extensions>=1.3.1",
60
60
  "mkdocs-rss-plugin>=1.15",
@@ -115,7 +115,7 @@ lint.isort.lines-after-imports = 2
115
115
  indent = 4
116
116
 
117
117
  [tool.pytest.ini_options]
118
- addopts = "-s -rP -vv --showlocals --cov --cov-report term"
118
+ addopts = "-s -rP -v --showlocals --cov --cov-report term"
119
119
  pythonpath = [ "tests", "src" ]
120
120
  testpaths = [ "tests" ]
121
121
 
@@ -123,6 +123,7 @@ testpaths = [ "tests" ]
123
123
  python_version = "3.8"
124
124
  scripts_are_modules = true
125
125
  strict = true
126
+ follow_imports = true
126
127
  exclude = [
127
128
  '.*?live_style_editor\.py$',
128
129
  ]
@@ -8,7 +8,7 @@ customization required.
8
8
  from __future__ import annotations
9
9
 
10
10
 
11
- __version__ = "1.9.0.dev0"
11
+ __version__ = "1.9.0.dev2"
12
12
 
13
13
  # Import the entire click API here.
14
14
  # We need to manually import these instead of `from click import *` to force
@@ -85,6 +85,9 @@ from rich_click.rich_context import RichContext as RichContext
85
85
  from rich_click.rich_context import get_current_context as get_current_context
86
86
  from rich_click.rich_help_configuration import RichHelpConfiguration as RichHelpConfiguration
87
87
  from rich_click.rich_help_formatter import RichHelpFormatter as RichHelpFormatter
88
+ from rich_click.rich_panel import RichCommandPanel as RichCommandPanel
89
+ from rich_click.rich_panel import RichOptionPanel as RichOptionPanel
90
+ from rich_click.rich_panel import RichPanel as RichPanel
88
91
  from rich_click.rich_parameter import RichArgument as RichArgument
89
92
  from rich_click.rich_parameter import RichOption as RichOption
90
93
  from rich_click.rich_parameter import RichParameter as RichParameter
@@ -16,9 +16,9 @@ except Exception:
16
16
  CLICK_IS_BEFORE_VERSION_9X = False
17
17
  CLICK_IS_VERSION_80 = False
18
18
  else:
19
- _major = int(click_version.split(".")[0]) # type: ignore[attr-defined]
20
- _minor = int(click_version.split(".")[1]) # type: ignore[attr-defined]
21
- _patch = int(click_version.split(".")[2]) # type: ignore[attr-defined]
19
+ _major = int(click_version.split(".")[0]) # type: ignore[attr-defined,unused-ignore]
20
+ _minor = int(click_version.split(".")[1]) # type: ignore[attr-defined,unused-ignore]
21
+ _patch = int(click_version.split(".")[2]) # type: ignore[attr-defined,unused-ignore]
22
22
 
23
23
  CLICK_IS_BEFORE_VERSION_821 = (_major, _minor, _patch) < (8, 2, 1)
24
24
  CLICK_IS_BEFORE_VERSION_82 = (_major, _minor) < (8, 2)