fast-dev-cli 0.24.2__tar.gz → 0.24.3__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: fast-dev-cli
3
- Version: 0.24.2
3
+ Version: 0.24.3
4
4
  Summary: Python project development tool.
5
5
  Author-Email: Waket Zheng <waketzheng@gmail.com>>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -0,0 +1 @@
1
+ __version__ = "0.24.3"
@@ -1229,6 +1229,15 @@ class LintCode(DryRun):
1229
1229
  prefix = ""
1230
1230
  should_run_by_tool = with_prefix
1231
1231
  requires_mypy = any(tool.startswith("mypy") for tool in tools)
1232
+ global_mypy = False
1233
+ if requires_mypy and Path.home().joinpath(".local/bin/mypy").exists():
1234
+ global_mypy = True
1235
+ mypy_opt = "--python-executable=.venv/bin/python"
1236
+ for i, t in enumerate(tools):
1237
+ if t.startswith("mypy"):
1238
+ if mypy_opt not in t:
1239
+ tools[i] = t + " " + mypy_opt
1240
+ break
1232
1241
  if requires_mypy and not should_run_by_tool:
1233
1242
  if is_venv() and Path(sys.argv[0]).parent != Path.home().joinpath(
1234
1243
  ".local/bin"
@@ -1245,6 +1254,8 @@ class LintCode(DryRun):
1245
1254
  "You may need to run the following command"
1246
1255
  f" to install ruff:\n\n {command}\n"
1247
1256
  )
1257
+ elif global_mypy:
1258
+ should_run_by_tool = True
1248
1259
  elif cls.missing_mypy_exec():
1249
1260
  should_run_by_tool = True
1250
1261
  if check_call('python -c "import fast_dev_cli"'):
@@ -1280,7 +1291,11 @@ class LintCode(DryRun):
1280
1291
  tool
1281
1292
  # `ruff <command>` get the same result with `pdm run ruff <command>`.
1282
1293
  # Other tools should run inside the selected environment.
1283
- if ruff_exists and tool.startswith("ruff")
1294
+ if (
1295
+ ruff_exists
1296
+ and tool.startswith("ruff")
1297
+ or (global_mypy and tool.startswith("mypy"))
1298
+ )
1284
1299
  else prefix + tool
1285
1300
  )
1286
1301
  + f" {paths}"
@@ -29,7 +29,7 @@ dependencies = [
29
29
  "typer>=0.24.0,<1",
30
30
  "tomli >=2.0.1,<3; python_version < '3.11'",
31
31
  ]
32
- version = "0.24.2"
32
+ version = "0.24.3"
33
33
 
34
34
  [project.urls]
35
35
  Homepage = "https://github.com/waketzheng/fast-dev-cli"
@@ -1 +0,0 @@
1
- __version__ = "0.24.2"
File without changes
File without changes