Skip to content

Commit 4375337

Browse files
committed
Bump version: 0.18.1 → 0.18.2
1 parent dddb0a6 commit 4375337

5 files changed

Lines changed: 68 additions & 68 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: echo "$GITHUB_CONTEXT"
2424
- uses: actions/checkout@v5
2525
- name: Set up Python
26-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: '3.x'
2929
- name: Install dependencies

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## 0.18
44

5+
### [0.18.2](../../releases/tag/v0.18.2) - 2025-09-09
6+
7+
#### Fixed
8+
- Fix inexact prompt when lint without ruff installed
9+
510
### [0.18.1](../../releases/tag/v0.18.1) - 2025-09-06
611

712
#### Added
@@ -22,7 +27,7 @@
2227
### [0.17.2](../../releases/tag/v0.17.2) - 2025-08-22
2328

2429
#### Added
25-
- Support `fast list --prefix=uv`
30+
- Support `fast lint --prefix=uv`
2631

2732
#### Fixed
2833
- Fix fast lint get error mypy relative path

fast_dev_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.18.1"
1+
__version__ = "0.18.2"

fast_dev_cli/cli.py

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,20 @@ class StrEnum(str, Enum):
6262
)
6363

6464

65-
class FastDevCliError(Exception): ...
65+
class FastDevCliError(Exception):
66+
"""Basic exception of this library, all custom exceptions inherit from it"""
6667

6768

68-
class ShellCommandError(FastDevCliError): ...
69+
class ShellCommandError(FastDevCliError):
70+
"""Raise if cmd command returncode is not zero"""
71+
72+
73+
class ParseError(FastDevCliError):
74+
"""Raise this if parse dependence line error"""
75+
76+
77+
class EnvError(FastDevCliError):
78+
"""Raise when expected to be managed by poetry, but toml file not found."""
6979

7080

7181
def poetry_module_name(name: str) -> str:
@@ -536,10 +546,6 @@ def bump() -> None:
536546
return BumpUp(commit, part, no_sync="--no-sync" in args, dry="--dry" in args).run()
537547

538548

539-
class EnvError(Exception):
540-
"""Raise when expected to be managed by poetry, but toml file not found."""
541-
542-
543549
class Project:
544550
path_depth = 5
545551
_tool: ToolName | None = None
@@ -591,30 +597,33 @@ def get_manage_tool(cls: type[Self], cache: bool = False) -> ToolName | None:
591597
try:
592598
text = cls.load_toml_text()
593599
except EnvError:
594-
pass
595-
else:
596-
with contextlib.suppress(KeyError, tomllib.TOMLDecodeError):
597-
doc = tomllib.loads(text)
598-
backend = doc["build-system"]["build-backend"]
599-
if "poetry" in backend:
600-
cls._tool = "poetry"
601-
return cls._tool
602-
elif "pdm" in backend:
603-
cls._tool = "pdm"
604-
work_dir = cls.get_work_dir(allow_cwd=True)
605-
if not Path(work_dir, "pdm.lock").exists() and (
606-
"[tool.uv]" in text or Path(work_dir, "uv.lock").exists()
607-
):
608-
cls._tool = "uv"
609-
return cls._tool
610-
for name in get_args(ToolName):
611-
if f"[tool.{name}]" in text:
612-
cls._tool = cast(ToolName, name)
613-
return cls._tool
614-
# Poetry 2.0 default to not include the '[tool.poetry]' section
615-
if cls.is_poetry_v2(text):
600+
return None
601+
with contextlib.suppress(KeyError, tomllib.TOMLDecodeError):
602+
doc = tomllib.loads(text)
603+
backend = doc["build-system"]["build-backend"]
604+
if "poetry" in backend:
616605
cls._tool = "poetry"
617606
return cls._tool
607+
work_dir = cls.get_work_dir(allow_cwd=True)
608+
uv_lock_exists = Path(work_dir, "uv.lock").exists()
609+
if "pdm" in backend:
610+
cls._tool = "pdm"
611+
if not Path(work_dir, "pdm.lock").exists() and (
612+
uv_lock_exists or "[tool.uv]" in text
613+
):
614+
cls._tool = "uv"
615+
return cls._tool
616+
elif uv_lock_exists:
617+
cls._tool = "uv"
618+
return cls._tool
619+
for name in get_args(ToolName):
620+
if f"[tool.{name}]" in text:
621+
cls._tool = cast(ToolName, name)
622+
return cls._tool
623+
# Poetry 2.0 default to not include the '[tool.poetry]' section
624+
if cls.is_poetry_v2(text):
625+
cls._tool = "poetry"
626+
return cls._tool
618627
return None
619628

620629
@staticmethod
@@ -665,12 +674,6 @@ def sync_dependencies(cls, prod: bool = True) -> None:
665674
run_and_echo(cmd)
666675

667676

668-
class ParseError(Exception):
669-
"""Raise this if parse dependence line error"""
670-
671-
pass
672-
673-
674677
class UpgradeDependencies(Project, DryRun):
675678
def __init__(
676679
self, _exit: bool = False, dry: bool = False, tool: ToolName = "poetry"
@@ -1144,18 +1147,11 @@ def make_style(
11441147
bandit = _ensure_bool(bandit)
11451148
prefix = _ensure_bool(prefix)
11461149
tool = _ensure_str(tool)
1150+
kwargs = {"dry": dry, "skip_mypy": skip, "dmypy": dmypy, "bandit": bandit}
11471151
if _ensure_bool(check_only):
1148-
check(files, dry=dry, skip_mypy=skip, dmypy=dmypy, bandit=bandit, tool=tool)
1152+
check(files, tool=tool, **kwargs)
11491153
else:
1150-
lint(
1151-
files,
1152-
dry=dry,
1153-
skip_mypy=skip,
1154-
dmypy=dmypy,
1155-
bandit=bandit,
1156-
tool=tool,
1157-
prefix=prefix,
1158-
)
1154+
lint(files, prefix=prefix, tool=tool, **kwargs)
11591155

11601156

11611157
@cli.command(name="check")
@@ -1508,8 +1504,7 @@ def common(
15081504
is_eager=True,
15091505
help="Show the version of this tool",
15101506
),
1511-
) -> None:
1512-
pass
1507+
) -> None: ...
15131508

15141509

15151510
def main() -> None:

pdm.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)