cmdkit 2.7.3__tar.gz → 2.7.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmdkit
3
- Version: 2.7.3
3
+ Version: 2.7.5
4
4
  Summary: A command-line utility toolkit for Python.
5
5
  Home-page: https://cmdkit.readthedocs.io
6
6
  License: Apache-2.0
@@ -16,9 +16,10 @@ Classifier: Programming Language :: Python :: 3.9
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
19
20
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
20
- Requires-Dist: pyyaml (>=5.3.1)
21
- Requires-Dist: toml (>=0.10.1)
21
+ Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
22
+ Requires-Dist: toml (>=0.10.2,<0.11.0)
22
23
  Project-URL: Documentation, https://cmdkit.readthedocs.io
23
24
  Project-URL: Repository, https://github.com/glentner/cmdkit
24
25
  Description-Content-Type: text/x-rst
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cmdkit"
3
- version = "2.7.3"
3
+ version = "2.7.5"
4
4
  description = "A command-line utility toolkit for Python."
5
5
  readme = "README.rst"
6
6
  license = "Apache-2.0"
@@ -20,35 +20,37 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.10",
21
21
  "Programming Language :: Python :: 3.11",
22
22
  "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
23
24
  "License :: OSI Approved :: Apache Software License",
24
25
  ]
25
26
 
26
27
  [tool.poetry.dependencies]
27
28
  python = ">=3.8,<4.0"
28
- toml = {version = ">=0.10.1", optional = true}
29
- pyyaml = {version = ">=5.3.1", optional = true}
29
+ toml = {version = "^0.10.2", optional = true}
30
+ pyyaml = {version = "^6.0.1", optional = true}
30
31
 
31
32
  [tool.poetry.group.docs.dependencies]
32
- sphinx = ">=3.2.1"
33
- pydata-sphinx-theme = ">=0.4.1"
34
- sphinx-sitemap = "^2.5.0"
33
+ sphinx = "^7.2.6"
34
+ sphinx-sitemap = "^2.5.1"
35
35
  sphinx-autobuild = "^2021.3.14"
36
- sphinxext-opengraph = "^0.8.2"
37
36
  sphinx-copybutton = "^0.5.2"
37
+ sphinxext-opengraph = "^0.9.1"
38
38
  sphinxcontrib-details-directive = "^0.1.0"
39
- sphinx-toolbox = "^3.4.0"
39
+ sphinx-toolbox = "^3.5.0"
40
+ pydata-sphinx-theme = "^0.15.1"
40
41
  enum-tools = {extras = ["sphinx"], version = "^0.10.0"}
41
42
 
42
43
  [tool.poetry.group.dev.dependencies]
43
- toml = ">=0.10.1"
44
- pyyaml = ">=5.3.1"
45
- pytest = ">=6.1.1"
46
- pytest-cov = ">=2.10.1"
47
- hypothesis = ">=5.18.0"
48
- pylint = ">=2.6.0"
49
- mypy = ">=0.790"
50
- ipython = ">=7.18.1"
51
- sphinx-autobuild = ">=2020.9.1"
44
+ toml = "^0.10.2"
45
+ pyyaml = "^6.0.1"
46
+ pytest = "^7.4.4"
47
+ pytest-cov = "^4.1.0"
48
+ hypothesis = "^6.92.6"
49
+ ruff = "^0.1.11"
50
+ pyright = "^1.1.345"
51
+ pynvim = "^0.5.0"
52
+ ipython = "^8.20.0"
53
+ sphinx-autobuild = "^2021.3.14"
52
54
 
53
55
  [build-system]
54
56
  requires = ["poetry-core>=1.0.0"]
@@ -99,8 +99,9 @@ def colorize_usage(text: str) -> str:
99
99
  return _apply_formatters(text,
100
100
  _format_headers,
101
101
  _format_options,
102
- _format_special_args,
103
- _format_special_marker,
102
+ _format_special_device,
103
+ _format_special_metavars,
104
+ _format_special_reserved_names,
104
105
  _format_single_quoted_string,
105
106
  _format_double_quoted_string,
106
107
  _format_backtick_string,
@@ -127,28 +128,32 @@ NOT_QUOTED = (
127
128
 
128
129
  def _format_headers(text: str) -> str:
129
130
  """Add rich ANSI formatting to section headers."""
130
- names = ['Usage', 'Commands', 'Arguments', 'Modes', 'Options', 'Files']
131
- return re.sub(r'(?P<name>' + '|'.join(names) + r'):' + NOT_QUOTED, bold(r'\g<name>:'), text)
131
+ return re.sub(r'^(?P<name>[A-Z][a-z]+):' + NOT_QUOTED, bold(r'\g<name>:'),
132
+ text, flags=re.MULTILINE)
132
133
 
133
134
 
134
135
  def _format_options(text: str) -> str:
135
136
  """Add rich ANSI formatting to option syntax."""
136
- option_pattern = r'(?P<leader>[ /\[,])(?P<option>-[a-zA-Z]|--[a-z]+(-[a-z]+)?)\b'
137
+ option_pattern = r'(?P<leader>[ /\[,])(?P<option>-[a-zA-Z]+|--[a-z]+(-[a-z]+)?)\b'
137
138
  return re.sub(option_pattern + NOT_QUOTED, r'\g<leader>' + cyan(r'\g<option>'), text)
138
139
 
139
140
 
140
- def _format_special_args(text: str) -> str:
141
+ def _format_special_metavars(text: str) -> str:
141
142
  """Add rich ANSI formatting to special argument syntax."""
142
- metavars = ['FILE', 'PATH', 'ARGS', 'ID', 'NUM', 'CMD', 'SIZE', 'SEC', 'NAME', 'TEMPLATE', 'CHAR', 'MODE',
143
- 'ADDR', 'HOST', 'PORT', 'KEY', 'SECTION', 'VAR', 'VALUE', 'FIELD', 'COND', 'FORMAT', 'TAG']
144
- metavars_pattern = r'\b(?P<arg>' + '|'.join(metavars) + r')\b'
143
+ metavars_pattern = r'(?<!-)\b(?P<arg>[A-Z]{2,})\b'
145
144
  return re.sub(metavars_pattern + NOT_QUOTED, italic(r'\g<arg>'), text)
146
145
 
147
146
 
148
- def _format_special_marker(text: str) -> str:
149
- """Add rich ANSI formatting to special markers (e.g., '<stdout>')."""
150
- args = ['<stdout>', '<stderr>', '<stdin>', '<devnull>', '<none>', '<command>', '<args>', ]
151
- return re.sub(r'(?P<arg>' + '|'.join(args) + r')' + NOT_QUOTED, italic(r'\g<arg>'), text)
147
+ def _format_special_device(text: str) -> str:
148
+ """Add rich ANSI formatting to special device/resource names (e.g., '<stdout>')."""
149
+ return re.sub(r'(?P<arg><[a-z]{3,}>)' + NOT_QUOTED, italic(r'\g<arg>'), text)
150
+
151
+
152
+ def _format_special_reserved_names(text: str) -> str:
153
+ """Special reserved names (e.g., localhost)."""
154
+ names = ['localhost', 'stdin', 'stdout', 'stderr', ]
155
+ names_pattern = r'(?<!-)\b(?P<name>' + '|'.join(names) + r')\b'
156
+ return re.sub(names_pattern + NOT_QUOTED, italic(r'\g<name>'), text)
152
157
 
153
158
 
154
159
  def _format_single_quoted_string(text: str) -> str:
@@ -168,4 +173,5 @@ def _format_backtick_string(text: str) -> str:
168
173
 
169
174
  def _format_digit(text: str) -> str:
170
175
  """Add rich ANSI formatting to numerical digits."""
171
- return re.sub(r'\b(?P<num>\d+|null|NULL)\b' + NOT_QUOTED, green(r'\g<num>'), text)
176
+ return re.sub(r'\b(?P<num>\d+\.?[kmgtKMGT]?[bB]?|null|NULL)\b' + NOT_QUOTED,
177
+ green(r'\g<num>'), text)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes