fast-dev-cli 0.6.6__tar.gz → 0.7.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.
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/PKG-INFO +1 -3
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/fast_dev_cli/cli.py +8 -23
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/pyproject.toml +4 -8
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/LICENSE +0 -0
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/README.md +0 -0
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/fast_dev_cli/__init__.py +0 -0
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.6.6 → fast_dev_cli-0.7.0}/fast_dev_cli/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fast-dev-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Waket Zheng
|
|
6
6
|
Author-email: waketzheng@gmail.com
|
|
@@ -9,11 +9,9 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Provides-Extra: all
|
|
12
|
-
Requires-Dist: black (>=23.9.1) ; extra == "all"
|
|
13
12
|
Requires-Dist: bumpversion (>=0.6.0,<0.7.0) ; extra == "all"
|
|
14
13
|
Requires-Dist: click (>=7.1.1)
|
|
15
14
|
Requires-Dist: coverage (>=6.5.0) ; extra == "all"
|
|
16
|
-
Requires-Dist: isort (>=5.12.0) ; extra == "all"
|
|
17
15
|
Requires-Dist: mypy (>=1.5.0) ; extra == "all"
|
|
18
16
|
Requires-Dist: pytest (>=8.1.1,<9.0.0) ; extra == "all"
|
|
19
17
|
Requires-Dist: ruff (>=0.3) ; extra == "all"
|
|
@@ -246,7 +246,8 @@ class Project:
|
|
|
246
246
|
def get_work_dir(
|
|
247
247
|
cls: Type[Self], name=TOML_FILE, cwd: Path | None = None, allow_cwd=False
|
|
248
248
|
) -> Path:
|
|
249
|
-
|
|
249
|
+
cwd = cwd or Path.cwd()
|
|
250
|
+
if d := cls.work_dir(name, cwd, cls.path_depth):
|
|
250
251
|
return d
|
|
251
252
|
if allow_cwd:
|
|
252
253
|
return cls.get_root_dir(cwd)
|
|
@@ -422,7 +423,7 @@ class UpgradeDependencies(Project, DryRun):
|
|
|
422
423
|
return _upgrade
|
|
423
424
|
|
|
424
425
|
def gen(self: Self) -> str:
|
|
425
|
-
return self.gen_cmd() + " && poetry update"
|
|
426
|
+
return self.gen_cmd() + " && poetry lock && poetry update"
|
|
426
427
|
|
|
427
428
|
|
|
428
429
|
@cli.command()
|
|
@@ -487,36 +488,20 @@ class LintCode(DryRun):
|
|
|
487
488
|
|
|
488
489
|
@staticmethod
|
|
489
490
|
def check_lint_tool_installed() -> bool:
|
|
490
|
-
return check_call("
|
|
491
|
+
return check_call("ruff --version")
|
|
491
492
|
|
|
492
493
|
@classmethod
|
|
493
494
|
def to_cmd(cls: Type[Self], paths=".", check_only=False) -> str:
|
|
494
495
|
cmd = ""
|
|
495
|
-
tools = ["
|
|
496
|
+
tools = ["ruff check --extend-select=I --fix", "ruff format", "mypy"]
|
|
496
497
|
if check_only:
|
|
497
|
-
tools[
|
|
498
|
-
tools[1] += " --check --fast"
|
|
498
|
+
tools[1] += " --check"
|
|
499
499
|
if check_only or load_bool("NO_FIX"):
|
|
500
|
-
tools[
|
|
500
|
+
tools[0] = tools[0].replace(" --fix", "")
|
|
501
501
|
if load_bool("SKIP_MYPY"):
|
|
502
502
|
# Sometimes mypy is too slow
|
|
503
503
|
tools = tools[:-1]
|
|
504
504
|
lint_them = " && ".join("{0}{%d} {1}" % i for i in range(2, len(tools) + 2))
|
|
505
|
-
current_path = Path.cwd()
|
|
506
|
-
root = Project.get_work_dir(cwd=current_path, allow_cwd=True)
|
|
507
|
-
app_name = root.name.replace("-", "_")
|
|
508
|
-
if (app_dir := root / app_name).exists() or (app_dir := root / "app").exists():
|
|
509
|
-
if current_path == app_dir:
|
|
510
|
-
tools[0] += " --src=."
|
|
511
|
-
elif current_path == root:
|
|
512
|
-
tools[0] += f" --src={app_dir.name}"
|
|
513
|
-
else:
|
|
514
|
-
parents = "../"
|
|
515
|
-
for i, p in enumerate(current_path.parents):
|
|
516
|
-
if p == root:
|
|
517
|
-
parents *= i + 1
|
|
518
|
-
break
|
|
519
|
-
tools[0] += f" --src={parents}{app_dir.name}"
|
|
520
505
|
prefix = "poetry run "
|
|
521
506
|
if is_venv():
|
|
522
507
|
if cls.check_lint_tool_installed():
|
|
@@ -550,7 +535,7 @@ def make_style(
|
|
|
550
535
|
check_only: bool = Option(False, "--check-only", "-c"),
|
|
551
536
|
dry: bool = Option(False, "--dry", help="Only print, not really run shell command"),
|
|
552
537
|
) -> None:
|
|
553
|
-
"""Run:
|
|
538
|
+
"""Run: ruff check/format to reformat code and then mypy to check"""
|
|
554
539
|
if isinstance(files, str):
|
|
555
540
|
files = [files]
|
|
556
541
|
if check_only:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "fast-dev-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["Waket Zheng <waketzheng@gmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -9,8 +9,6 @@ packages = [{include = "fast_dev_cli"}]
|
|
|
9
9
|
[tool.poetry.dependencies]
|
|
10
10
|
python = "^3.11"
|
|
11
11
|
click = ">=7.1.1"
|
|
12
|
-
isort = {version = ">=5.12.0", optional = true}
|
|
13
|
-
black = {version = ">=23.9.1", optional = true}
|
|
14
12
|
ruff = {version = ">=0.3", optional = true}
|
|
15
13
|
mypy = {version = ">=1.5.0", optional = true}
|
|
16
14
|
coverage = {version = ">=6.5.0", optional = true}
|
|
@@ -19,11 +17,9 @@ pytest = {version = "^8.1.1", optional = true}
|
|
|
19
17
|
typer = {version = ">=0.12.0", optional = true}
|
|
20
18
|
|
|
21
19
|
[tool.poetry.extras]
|
|
22
|
-
all = ["
|
|
20
|
+
all = ["ruff", "typer", "mypy", "bumpversion", "pytest", "coverage"]
|
|
23
21
|
|
|
24
22
|
[tool.poetry.group.dev.dependencies]
|
|
25
|
-
isort = "*"
|
|
26
|
-
black = "*"
|
|
27
23
|
ruff = ">=0.3"
|
|
28
24
|
mypy = "*"
|
|
29
25
|
pytest = "*"
|
|
@@ -41,8 +37,8 @@ build-backend = "poetry.core.masonry.api"
|
|
|
41
37
|
[tool.poetry.scripts]
|
|
42
38
|
fast = "fast_dev_cli:cli"
|
|
43
39
|
|
|
44
|
-
[tool.
|
|
45
|
-
|
|
40
|
+
[tool.ruff]
|
|
41
|
+
target-version = "py311"
|
|
46
42
|
|
|
47
43
|
[tool.mypy]
|
|
48
44
|
pretty = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|