fast-dev-cli 0.25.7__tar.gz → 0.25.9__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.
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/PKG-INFO +1 -1
- fast_dev_cli-0.25.9/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/fast_dev_cli/cli.py +26 -15
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/pyproject.toml +1 -1
- fast_dev_cli-0.25.7/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/LICENSE +0 -0
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/README.md +0 -0
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.25.7 → fast_dev_cli-0.25.9}/fast_dev_cli/py.typed +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.9"
|
|
@@ -1269,7 +1269,11 @@ class LintCode(DryRun):
|
|
|
1269
1269
|
path_args = ["."]
|
|
1270
1270
|
quoted_paths = _join_shell_args(path_args)
|
|
1271
1271
|
if path_args != ["."] and all(i.endswith(".html") for i in path_args):
|
|
1272
|
-
|
|
1272
|
+
prettier = "prettier"
|
|
1273
|
+
if is_windows() and (abspath := shutil.which(prettier)):
|
|
1274
|
+
# If prettier is installed by `npm i -g`
|
|
1275
|
+
prettier = Path(abspath).name # prettier.CMD
|
|
1276
|
+
return f"{prettier} -w {quoted_paths}"
|
|
1273
1277
|
ruff_rules = ["I", "B"]
|
|
1274
1278
|
if ruff_check_sim and not load_bool("FASTDEVCLI_NO_SIM"):
|
|
1275
1279
|
ruff_rules.append("SIM")
|
|
@@ -1654,7 +1658,9 @@ def _should_run_test_script(path: Path = Path("scripts")) -> Path | None:
|
|
|
1654
1658
|
return None
|
|
1655
1659
|
|
|
1656
1660
|
|
|
1657
|
-
def test(
|
|
1661
|
+
def test(
|
|
1662
|
+
dry: bool, ignore_script: bool = False, files: list[Path] | None = None
|
|
1663
|
+
) -> None:
|
|
1658
1664
|
cwd = Path.cwd()
|
|
1659
1665
|
root = Project.get_work_dir(cwd=cwd, allow_cwd=True)
|
|
1660
1666
|
script_dir = root / "scripts"
|
|
@@ -1668,6 +1674,8 @@ def test(dry: bool, ignore_script: bool = False) -> None:
|
|
|
1668
1674
|
cmd = f"cd {_quote_shell_arg(root)} && " + cmd
|
|
1669
1675
|
else:
|
|
1670
1676
|
cmd = 'coverage run -m pytest -s && coverage report --omit="tests/*" -m'
|
|
1677
|
+
if files:
|
|
1678
|
+
cmd = "pytest -s " + " ".join(i.as_posix() for i in files)
|
|
1671
1679
|
if not is_venv() or not check_call("coverage --version"):
|
|
1672
1680
|
sep = " && "
|
|
1673
1681
|
prefix = f"{tool} run " if (tool := Project.get_manage_tool()) else ""
|
|
@@ -1677,11 +1685,12 @@ def test(dry: bool, ignore_script: bool = False) -> None:
|
|
|
1677
1685
|
|
|
1678
1686
|
@cli.command(name="test")
|
|
1679
1687
|
def coverage_test(
|
|
1688
|
+
files: Annotated[list[Path] | None, typer.Argument()] = None,
|
|
1680
1689
|
dry: bool = DryOption,
|
|
1681
1690
|
ignore_script: bool = Option(False, "--ignore-script", "-i"),
|
|
1682
1691
|
) -> None:
|
|
1683
1692
|
"""Run unittest by pytest and report coverage"""
|
|
1684
|
-
return test(dry, ignore_script)
|
|
1693
|
+
return test(dry, ignore_script, files=files)
|
|
1685
1694
|
|
|
1686
1695
|
|
|
1687
1696
|
def _not_a_distribution() -> bool:
|
|
@@ -2225,7 +2234,7 @@ class UvPypi(DryRun):
|
|
|
2225
2234
|
|
|
2226
2235
|
@cli.command()
|
|
2227
2236
|
def pypi(
|
|
2228
|
-
file: str | None
|
|
2237
|
+
file: Annotated[str | None, typer.Argument()] = None,
|
|
2229
2238
|
dry: bool = DryOption,
|
|
2230
2239
|
verbose: bool = False,
|
|
2231
2240
|
quiet: bool = False,
|
|
@@ -2242,7 +2251,7 @@ def pypi(
|
|
|
2242
2251
|
|
|
2243
2252
|
|
|
2244
2253
|
class SuffixParser:
|
|
2245
|
-
usually = ("py", "md", "json", "txt", "proto")
|
|
2254
|
+
usually = ("py", "md", "json", "txt", "proto", "toml")
|
|
2246
2255
|
|
|
2247
2256
|
@classmethod
|
|
2248
2257
|
def fill(cls, files: list[str]) -> list[str]:
|
|
@@ -2282,8 +2291,8 @@ def vi(
|
|
|
2282
2291
|
dry: Annotated[
|
|
2283
2292
|
bool, Option(help="Only print, not really run shell command")
|
|
2284
2293
|
] = False,
|
|
2285
|
-
vertical: bool | None
|
|
2286
|
-
horizon: bool | None
|
|
2294
|
+
vertical: Annotated[bool | None, Option(..., "-O", help="Open vertically")] = None,
|
|
2295
|
+
horizon: Annotated[bool | None, Option(..., "-o", help="Open horizontally")] = None,
|
|
2287
2296
|
guess: Annotated[
|
|
2288
2297
|
bool, Option(help="Whether guess file suffix if not exist")
|
|
2289
2298
|
] = True,
|
|
@@ -2308,14 +2317,16 @@ def version_callback(value: bool) -> None:
|
|
|
2308
2317
|
|
|
2309
2318
|
@cli.callback()
|
|
2310
2319
|
def common(
|
|
2311
|
-
version:
|
|
2312
|
-
None,
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2320
|
+
version: Annotated[
|
|
2321
|
+
bool | None,
|
|
2322
|
+
Option(
|
|
2323
|
+
...,
|
|
2324
|
+
*("--version", "-V"),
|
|
2325
|
+
callback=version_callback,
|
|
2326
|
+
is_eager=True,
|
|
2327
|
+
help="Show the version of this tool",
|
|
2328
|
+
),
|
|
2329
|
+
] = None,
|
|
2319
2330
|
) -> None: ...
|
|
2320
2331
|
|
|
2321
2332
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.7"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|