fast-dev-cli 0.19.3__tar.gz → 0.19.4__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.19.3 → fast_dev_cli-0.19.4}/PKG-INFO +7 -11
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/README.md +6 -10
- fast_dev_cli-0.19.4/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/fast_dev_cli/cli.py +32 -3
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/pyproject.toml +1 -1
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_lint.py +37 -0
- fast_dev_cli-0.19.3/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/LICENSE +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/fast_dev_cli/py.typed +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/pdm_build.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/scripts/check.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/scripts/deps.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/scripts/format.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/scripts/test.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/__init__.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/assets/uv-tx.lock +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/assets/uv.lock +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/conftest.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_bump.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_deps.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_exec.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_fast_test.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_functions.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_help.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_poetry_version_plugin.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_pypi.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_runserver.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_sync.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_tag.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_upgrade.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_upload.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/test_version.py +0 -0
- {fast_dev_cli-0.19.3 → fast_dev_cli-0.19.4}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fast-dev-cli
|
|
3
|
-
Version: 0.19.
|
|
3
|
+
Version: 0.19.4
|
|
4
4
|
Summary: Python project development tool.
|
|
5
5
|
Author-Email: Waket Zheng <waketzheng@gmail.com>>
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -74,7 +74,7 @@ Description-Content-Type: text/markdown
|
|
|
74
74
|
|
|
75
75
|
## Requirements
|
|
76
76
|
|
|
77
|
-
Python 3.
|
|
77
|
+
Python 3.10+
|
|
78
78
|
|
|
79
79
|
## Features
|
|
80
80
|
|
|
@@ -88,7 +88,7 @@ Python 3.9+
|
|
|
88
88
|
```bash
|
|
89
89
|
pip install fast-dev-cli
|
|
90
90
|
```
|
|
91
|
-
*Will install: fast-dev-cli emoji typer
|
|
91
|
+
*Will install: fast-dev-cli emoji typer-slim mypy bumpversion2 pytest coverage*
|
|
92
92
|
|
|
93
93
|
</div>
|
|
94
94
|
|
|
@@ -113,21 +113,17 @@ fast bump <part> --commit # bump version and run `git commit`
|
|
|
113
113
|
```bash
|
|
114
114
|
fast test
|
|
115
115
|
```
|
|
116
|
-
-
|
|
116
|
+
- Install dependencies, support pip/pdm/uv/poetry
|
|
117
117
|
```bash
|
|
118
|
-
fast
|
|
119
|
-
```
|
|
120
|
-
- Upgrade main/dev dependencies to latest version (only for poetry project)
|
|
121
|
-
```bash
|
|
122
|
-
fast upgrade
|
|
118
|
+
fast deps
|
|
123
119
|
```
|
|
124
120
|
- Start a fastapi server in development mode
|
|
125
121
|
```bash
|
|
126
122
|
fast dev
|
|
127
123
|
```
|
|
128
|
-
-
|
|
124
|
+
- Change register of uv.lock to be pypi.org
|
|
129
125
|
```bash
|
|
130
|
-
fast
|
|
126
|
+
fast pypi
|
|
131
127
|
```
|
|
132
128
|
*Note: all command support the `--dry` option*
|
|
133
129
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
## Requirements
|
|
41
41
|
|
|
42
|
-
Python 3.
|
|
42
|
+
Python 3.10+
|
|
43
43
|
|
|
44
44
|
## Features
|
|
45
45
|
|
|
@@ -53,7 +53,7 @@ Python 3.9+
|
|
|
53
53
|
```bash
|
|
54
54
|
pip install fast-dev-cli
|
|
55
55
|
```
|
|
56
|
-
*Will install: fast-dev-cli emoji typer
|
|
56
|
+
*Will install: fast-dev-cli emoji typer-slim mypy bumpversion2 pytest coverage*
|
|
57
57
|
|
|
58
58
|
</div>
|
|
59
59
|
|
|
@@ -78,21 +78,17 @@ fast bump <part> --commit # bump version and run `git commit`
|
|
|
78
78
|
```bash
|
|
79
79
|
fast test
|
|
80
80
|
```
|
|
81
|
-
-
|
|
81
|
+
- Install dependencies, support pip/pdm/uv/poetry
|
|
82
82
|
```bash
|
|
83
|
-
fast
|
|
84
|
-
```
|
|
85
|
-
- Upgrade main/dev dependencies to latest version (only for poetry project)
|
|
86
|
-
```bash
|
|
87
|
-
fast upgrade
|
|
83
|
+
fast deps
|
|
88
84
|
```
|
|
89
85
|
- Start a fastapi server in development mode
|
|
90
86
|
```bash
|
|
91
87
|
fast dev
|
|
92
88
|
```
|
|
93
|
-
-
|
|
89
|
+
- Change register of uv.lock to be pypi.org
|
|
94
90
|
```bash
|
|
95
|
-
fast
|
|
91
|
+
fast pypi
|
|
96
92
|
```
|
|
97
93
|
*Note: all command support the `--dry` option*
|
|
98
94
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.19.4"
|
|
@@ -1058,6 +1058,8 @@ class LintCode(DryRun):
|
|
|
1058
1058
|
dmypy: bool = False,
|
|
1059
1059
|
tool: str = ToolOption.default,
|
|
1060
1060
|
prefix: bool = False,
|
|
1061
|
+
up: bool = False,
|
|
1062
|
+
sim: bool = True,
|
|
1061
1063
|
) -> None:
|
|
1062
1064
|
self.args = args
|
|
1063
1065
|
self.check_only = check_only
|
|
@@ -1066,6 +1068,8 @@ class LintCode(DryRun):
|
|
|
1066
1068
|
self._use_dmypy = dmypy
|
|
1067
1069
|
self._tool = tool
|
|
1068
1070
|
self._prefix = prefix
|
|
1071
|
+
self._up = up
|
|
1072
|
+
self._sim = sim
|
|
1069
1073
|
super().__init__(_exit, dry)
|
|
1070
1074
|
|
|
1071
1075
|
@staticmethod
|
|
@@ -1108,6 +1112,8 @@ class LintCode(DryRun):
|
|
|
1108
1112
|
use_dmypy: bool = False,
|
|
1109
1113
|
tool: str = ToolOption.default,
|
|
1110
1114
|
with_prefix: bool = False,
|
|
1115
|
+
ruff_check_up: bool = False,
|
|
1116
|
+
ruff_check_sim: bool = True,
|
|
1111
1117
|
) -> str:
|
|
1112
1118
|
if paths != "." and all(i.endswith(".html") for i in paths.split()):
|
|
1113
1119
|
return f"prettier -w {paths}"
|
|
@@ -1117,6 +1123,10 @@ class LintCode(DryRun):
|
|
|
1117
1123
|
tools[0] += " --check"
|
|
1118
1124
|
if check_only or load_bool("NO_FIX"):
|
|
1119
1125
|
tools[1] = tools[1].replace(" --fix", "")
|
|
1126
|
+
if ruff_check_up or load_bool("FASTDEVCLI_UP"):
|
|
1127
|
+
tools[1] = tools[1].replace(",SIM", ",SIM,UP")
|
|
1128
|
+
if not ruff_check_sim or load_bool("FASTDEVCLI_NO_SIM"):
|
|
1129
|
+
tools[1] = tools[1].replace(",SIM", "")
|
|
1120
1130
|
if skip_mypy or load_bool("SKIP_MYPY") or load_bool("FASTDEVCLI_NO_MYPY"):
|
|
1121
1131
|
# Sometimes mypy is too slow
|
|
1122
1132
|
tools = tools[:-1]
|
|
@@ -1227,6 +1237,8 @@ class LintCode(DryRun):
|
|
|
1227
1237
|
self._use_dmypy,
|
|
1228
1238
|
tool=self._tool,
|
|
1229
1239
|
with_prefix=self._prefix,
|
|
1240
|
+
ruff_check_up=self._up,
|
|
1241
|
+
ruff_check_sim=self._sim,
|
|
1230
1242
|
)
|
|
1231
1243
|
|
|
1232
1244
|
|
|
@@ -1242,6 +1254,8 @@ def lint(
|
|
|
1242
1254
|
dmypy: bool = False,
|
|
1243
1255
|
tool: str = ToolOption.default,
|
|
1244
1256
|
prefix: bool = False,
|
|
1257
|
+
up: bool = False,
|
|
1258
|
+
sim: bool = True,
|
|
1245
1259
|
) -> None:
|
|
1246
1260
|
if files is None:
|
|
1247
1261
|
files = parse_files(sys.argv[1:])
|
|
@@ -1255,6 +1269,8 @@ def lint(
|
|
|
1255
1269
|
dmypy=dmypy,
|
|
1256
1270
|
tool=tool,
|
|
1257
1271
|
prefix=prefix,
|
|
1272
|
+
up=up,
|
|
1273
|
+
sim=sim,
|
|
1258
1274
|
).run()
|
|
1259
1275
|
|
|
1260
1276
|
|
|
@@ -1265,6 +1281,8 @@ def check(
|
|
|
1265
1281
|
skip_mypy: bool = False,
|
|
1266
1282
|
dmypy: bool = False,
|
|
1267
1283
|
tool: str = ToolOption.default,
|
|
1284
|
+
up: bool = False,
|
|
1285
|
+
sim: bool = True,
|
|
1268
1286
|
) -> None:
|
|
1269
1287
|
LintCode(
|
|
1270
1288
|
files,
|
|
@@ -1275,6 +1293,8 @@ def check(
|
|
|
1275
1293
|
skip_mypy=skip_mypy,
|
|
1276
1294
|
dmypy=dmypy,
|
|
1277
1295
|
tool=tool,
|
|
1296
|
+
up=up,
|
|
1297
|
+
sim=sim,
|
|
1278
1298
|
).run()
|
|
1279
1299
|
|
|
1280
1300
|
|
|
@@ -1294,6 +1314,8 @@ def make_style(
|
|
|
1294
1314
|
),
|
|
1295
1315
|
tool: str = ToolOption,
|
|
1296
1316
|
dry: bool = DryOption,
|
|
1317
|
+
up: bool = Option(False, help="Whether ruff check with --extend-select=UP"),
|
|
1318
|
+
sim: bool = Option(True, help="Whether ruff check with --extend-select=SIM"),
|
|
1297
1319
|
) -> None:
|
|
1298
1320
|
"""Run: ruff check/format to reformat code and then mypy to check"""
|
|
1299
1321
|
if getattr(files, "default", files) is None:
|
|
@@ -1305,11 +1327,13 @@ def make_style(
|
|
|
1305
1327
|
bandit = _ensure_bool(bandit)
|
|
1306
1328
|
prefix = _ensure_bool(prefix)
|
|
1307
1329
|
tool = _ensure_str(tool)
|
|
1330
|
+
up = _ensure_bool(up)
|
|
1331
|
+
sim = _ensure_bool(sim)
|
|
1308
1332
|
kwargs = {"dry": dry, "skip_mypy": skip, "dmypy": dmypy, "bandit": bandit}
|
|
1309
1333
|
if _ensure_bool(check_only):
|
|
1310
|
-
check(files, tool=tool, **kwargs)
|
|
1334
|
+
check(files, tool=tool, up=up, sim=sim, **kwargs)
|
|
1311
1335
|
else:
|
|
1312
|
-
lint(files, prefix=prefix, tool=tool, **kwargs)
|
|
1336
|
+
lint(files, prefix=prefix, tool=tool, up=up, sim=sim, **kwargs)
|
|
1313
1337
|
|
|
1314
1338
|
|
|
1315
1339
|
@cli.command(name="check")
|
|
@@ -1317,9 +1341,14 @@ def only_check(
|
|
|
1317
1341
|
bandit: bool = Option(False, "--bandit", help="Run `bandit -r <package_dir>`"),
|
|
1318
1342
|
skip_mypy: bool = Option(False, "--skip-mypy"),
|
|
1319
1343
|
dry: bool = DryOption,
|
|
1344
|
+
up: bool = Option(False, help="Whether ruff check with --extend-select=UP"),
|
|
1345
|
+
sim: bool = Option(True, help="Whether ruff check with --extend-select=SIM"),
|
|
1320
1346
|
) -> None:
|
|
1321
1347
|
"""Check code style without reformat"""
|
|
1322
|
-
|
|
1348
|
+
bandit = _ensure_bool(bandit)
|
|
1349
|
+
up = _ensure_bool(up)
|
|
1350
|
+
sim = _ensure_bool(sim)
|
|
1351
|
+
check(dry=dry, bandit=bandit, skip_mypy=_ensure_bool(skip_mypy), up=up, sim=sim)
|
|
1323
1352
|
|
|
1324
1353
|
|
|
1325
1354
|
class Sync(DryRun):
|
|
@@ -74,6 +74,43 @@ def test_check(mock_no_dmypy, monkeypatch, mocker):
|
|
|
74
74
|
assert command4 == command
|
|
75
75
|
|
|
76
76
|
|
|
77
|
+
def test_check_up_sim(monkeypatch):
|
|
78
|
+
_test_up_sim(monkeypatch)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_lint_up_sim(monkeypatch):
|
|
82
|
+
_test_up_sim(monkeypatch, "lint")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _test_up_sim(monkeypatch, command="check"):
|
|
86
|
+
out = capture_cmd_output(f"fast {command} --up --dry")
|
|
87
|
+
assert "--extend-select=I,B,SIM,UP " in out
|
|
88
|
+
out = capture_cmd_output(f"fast {command} --no-sim --up --dry")
|
|
89
|
+
assert "--extend-select=I,B,UP " in out
|
|
90
|
+
out = capture_cmd_output(f"fast {command} --no-sim --dry")
|
|
91
|
+
assert "--extend-select=I,B " in out
|
|
92
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
93
|
+
assert "--extend-select=I,B,SIM " in out
|
|
94
|
+
monkeypatch.setenv("FASTDEVCLI_NO_SIM", "1")
|
|
95
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
96
|
+
assert "--extend-select=I,B " in out
|
|
97
|
+
monkeypatch.setenv("FASTDEVCLI_NO_SIM", "0")
|
|
98
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
99
|
+
assert "--extend-select=I,B,SIM " in out
|
|
100
|
+
monkeypatch.setenv("FASTDEVCLI_UP", "1")
|
|
101
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
102
|
+
assert "--extend-select=I,B,SIM,UP " in out
|
|
103
|
+
monkeypatch.setenv("FASTDEVCLI_NO_SIM", "1")
|
|
104
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
105
|
+
assert "--extend-select=I,B,UP " in out
|
|
106
|
+
monkeypatch.setenv("FASTDEVCLI_UP", "0")
|
|
107
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
108
|
+
assert "--extend-select=I,B " in out
|
|
109
|
+
monkeypatch.setenv("FASTDEVCLI_NO_SIM", "0")
|
|
110
|
+
out = capture_cmd_output(f"fast {command} --dry")
|
|
111
|
+
assert "--extend-select=I,B,SIM " in out
|
|
112
|
+
|
|
113
|
+
|
|
77
114
|
def test_check_bandit(tmp_path):
|
|
78
115
|
package_path = tmp_path / "foo"
|
|
79
116
|
with chdir(tmp_path):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.19.3"
|
|
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
|
|
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
|
|
File without changes
|