cihai-cli 0.25.0__tar.gz → 0.26.0__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.
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/PKG-INFO +2 -2
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/pyproject.toml +13 -5
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/src/cihai_cli/__about__.py +1 -1
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/src/cihai_cli/cli.py +11 -8
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/conftest.py +3 -1
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/test_cli.py +2 -1
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/LICENSE +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/README.md +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/src/cihai_cli/__init__.py +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/__init__.py +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_DictionaryIndices.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_DictionaryLikeData.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_IRGSources.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_NumericValues.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_OtherMappings.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_RadicalStrokeCounts.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_Readings.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/Unihan_Variants.txt +0 -0
- {cihai_cli-0.25.0 → cihai_cli-0.26.0}/tests/fixtures/test_config.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cihai-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.0
|
|
4
4
|
Summary: Command line frontend for the cihai CJK language library
|
|
5
5
|
Home-page: https://cihai-cli.git-pull.com
|
|
6
6
|
License: MIT
|
|
@@ -25,7 +25,7 @@ Classifier: Topic :: Software Development :: Localization
|
|
|
25
25
|
Classifier: Topic :: System :: Shells
|
|
26
26
|
Classifier: Topic :: Utilities
|
|
27
27
|
Requires-Dist: PyYAML
|
|
28
|
-
Requires-Dist: cihai (>=0.
|
|
28
|
+
Requires-Dist: cihai (>=0.31.0,<0.32.0)
|
|
29
29
|
Project-URL: Bug Tracker, https://github.com/cihai/cihai-cli/issues
|
|
30
30
|
Project-URL: Documentation, https://cihai-cli.git-pull.com
|
|
31
31
|
Project-URL: Q & A, https://github.com/cihai/cihai-cli/discussions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cihai-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.26.0"
|
|
4
4
|
description = "Command line frontend for the cihai CJK language library"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
authors = ["Tony Narlock <tony@git-pull.com>"]
|
|
@@ -58,7 +58,7 @@ Repository = "https://github.com/cihai/cihai-cli"
|
|
|
58
58
|
|
|
59
59
|
[tool.poetry.dependencies]
|
|
60
60
|
python = "^3.8"
|
|
61
|
-
cihai = "~0.
|
|
61
|
+
cihai = "~0.31.0"
|
|
62
62
|
PyYAML = "*"
|
|
63
63
|
|
|
64
64
|
[tool.poetry.group.docs.dependencies]
|
|
@@ -116,13 +116,18 @@ ignore_missing_imports = true
|
|
|
116
116
|
|
|
117
117
|
[tool.ruff]
|
|
118
118
|
target-version = "py38"
|
|
119
|
+
|
|
120
|
+
[tool.ruff.lint]
|
|
119
121
|
select = [
|
|
120
122
|
"E", # pycodestyle
|
|
121
123
|
"F", # pyflakes
|
|
122
124
|
"I", # isort
|
|
123
125
|
"UP", # pyupgrade
|
|
126
|
+
"A", # flake8-builtins
|
|
124
127
|
"B", # flake8-bugbear
|
|
125
128
|
"C4", # flake8-comprehensions
|
|
129
|
+
"COM", # flake8-commas
|
|
130
|
+
"EM", # flake8-errmsg
|
|
126
131
|
"Q", # flake8-quotes
|
|
127
132
|
"PTH", # flake8-use-pathlib
|
|
128
133
|
"SIM", # flake8-simplify
|
|
@@ -131,15 +136,18 @@ select = [
|
|
|
131
136
|
"RUF", # Ruff-specific rules
|
|
132
137
|
"D", # pydocstyle
|
|
133
138
|
]
|
|
139
|
+
ignore = [
|
|
140
|
+
"COM812", # missing trailing comma, ruff format conflict
|
|
141
|
+
]
|
|
134
142
|
|
|
135
|
-
[tool.ruff.isort]
|
|
143
|
+
[tool.ruff.lint.isort]
|
|
136
144
|
known-first-party = ["unihan_etl", "cihai"]
|
|
137
145
|
combine-as-imports = true
|
|
138
146
|
|
|
139
|
-
[tool.ruff.pydocstyle]
|
|
147
|
+
[tool.ruff.lint.pydocstyle]
|
|
140
148
|
convention = "numpy"
|
|
141
149
|
|
|
142
|
-
[tool.ruff.per-file-ignores]
|
|
150
|
+
[tool.ruff.lint.per-file-ignores]
|
|
143
151
|
"*/__init__.py" = ["F401"]
|
|
144
152
|
|
|
145
153
|
[tool.pytest.ini_options]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Metadata for cihai_cli package."""
|
|
2
2
|
__title__ = "cihai-cli"
|
|
3
3
|
__package_name__ = "cihai_cli"
|
|
4
|
-
__version__ = "0.
|
|
4
|
+
__version__ = "0.26.0"
|
|
5
5
|
__description__ = "Command line frontend for the cihai CJK language library"
|
|
6
6
|
__author__ = "Tony Narlock"
|
|
7
7
|
__email__ = "tony@git-pull.com"
|
|
@@ -59,7 +59,8 @@ def create_parser() -> argparse.ArgumentParser:
|
|
|
59
59
|
info_parser = subparsers.add_parser("info", help=INFO_SHORT_HELP)
|
|
60
60
|
create_info_subparser(info_parser)
|
|
61
61
|
reverse_parser = subparsers.add_parser(
|
|
62
|
-
"reverse",
|
|
62
|
+
"reverse",
|
|
63
|
+
help='Search all info for character matches, e.g. "good"',
|
|
63
64
|
)
|
|
64
65
|
create_reverse_subparser(reverse_parser)
|
|
65
66
|
|
|
@@ -130,7 +131,7 @@ def command_info(c: Cihai, char: str, show_all: bool) -> None:
|
|
|
130
131
|
continue
|
|
131
132
|
attrs[str(col)] = value
|
|
132
133
|
print(
|
|
133
|
-
yaml.safe_dump(attrs, allow_unicode=True, default_flow_style=False).strip("\n")
|
|
134
|
+
yaml.safe_dump(attrs, allow_unicode=True, default_flow_style=False).strip("\n"),
|
|
134
135
|
)
|
|
135
136
|
|
|
136
137
|
|
|
@@ -165,20 +166,22 @@ def command_reverse(c: Cihai, char: str, show_all: bool) -> None:
|
|
|
165
166
|
attrs[str(c)] = value
|
|
166
167
|
print(
|
|
167
168
|
yaml.safe_dump(attrs, allow_unicode=True, default_flow_style=False).strip(
|
|
168
|
-
"\n"
|
|
169
|
-
)
|
|
169
|
+
"\n",
|
|
170
|
+
),
|
|
170
171
|
)
|
|
171
172
|
print("--------")
|
|
172
173
|
|
|
173
174
|
|
|
174
175
|
def setup_logger(
|
|
175
|
-
logger: t.Optional[logging.Logger] = None,
|
|
176
|
+
logger: t.Optional[logging.Logger] = None,
|
|
177
|
+
level: str = "INFO",
|
|
176
178
|
) -> None:
|
|
177
179
|
"""Configure logging for CLI use.
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
logger : :py:class:`Logger`
|
|
184
|
+
Instance of logger, if one set up.
|
|
182
185
|
"""
|
|
183
186
|
if not logger:
|
|
184
187
|
logger = logging.getLogger()
|
|
@@ -50,7 +50,9 @@ def zip_file(zip_path: pathlib.Path, fixture_path: pathlib.Path) -> zipfile.ZipF
|
|
|
50
50
|
|
|
51
51
|
@pytest.fixture
|
|
52
52
|
def unihan_options(
|
|
53
|
-
zip_file: zipfile.ZipFile,
|
|
53
|
+
zip_file: zipfile.ZipFile,
|
|
54
|
+
zip_path: pathlib.Path,
|
|
55
|
+
tmp_path: pathlib.Path,
|
|
54
56
|
) -> "UnihanOptions":
|
|
55
57
|
"""Return UnihanOptions for fixture."""
|
|
56
58
|
return {
|
|
@@ -51,7 +51,8 @@ def test_cli_reflects_after_bootstrap(
|
|
|
51
51
|
}
|
|
52
52
|
config_file = tmp_path / "config.yml"
|
|
53
53
|
config_file.write_text(
|
|
54
|
-
yaml.dump(config, default_flow_style=False),
|
|
54
|
+
yaml.dump(config, default_flow_style=False),
|
|
55
|
+
encoding="utf-8",
|
|
55
56
|
)
|
|
56
57
|
|
|
57
58
|
try:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|