fastapi-cli 0.0.18__tar.gz → 0.0.20__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.
Files changed (77) hide show
  1. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/PKG-INFO +2 -3
  2. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/pdm_build.py +3 -3
  3. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/pyproject.toml +2 -3
  4. fastapi_cli-0.0.20/src/fastapi_cli/__init__.py +1 -0
  5. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/cli.py +15 -3
  6. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/config.py +2 -2
  7. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/discover.py +2 -2
  8. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/utils/cli.py +2 -2
  9. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/conftest.py +1 -1
  10. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_cli.py +37 -0
  11. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_cli_pyproject.py +12 -9
  12. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/utils.py +2 -1
  13. fastapi_cli-0.0.18/src/fastapi_cli/__init__.py +0 -1
  14. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/LICENSE +0 -0
  15. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/README.md +0 -0
  16. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/requirements-github-actions.txt +0 -0
  17. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/requirements-tests.txt +0 -0
  18. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/requirements.txt +0 -0
  19. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/scripts/format.sh +0 -0
  20. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/scripts/lint.sh +0 -0
  21. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/scripts/test-cov-html.sh +0 -0
  22. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/scripts/test.sh +0 -0
  23. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/__main__.py +0 -0
  24. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/exceptions.py +0 -0
  25. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/logging.py +0 -0
  26. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/py.typed +0 -0
  27. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/src/fastapi_cli/utils/__init__.py +0 -0
  28. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/__init__.py +0 -0
  29. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/broken_package/mod/__init__.py +0 -0
  30. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/broken_package/mod/app.py +0 -0
  31. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/broken_package/utils.py +0 -0
  32. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_api/api.py +0 -0
  33. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app/api.py +0 -0
  34. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app/app.py +0 -0
  35. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_api/app/__init__.py +0 -0
  36. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_api/app/api.py +0 -0
  37. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_app/app/__init__.py +0 -0
  38. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_app/app/api.py +0 -0
  39. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_app/app/app.py +0 -0
  40. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_main/app/__init__.py +0 -0
  41. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_main/app/api.py +0 -0
  42. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_main/app/app.py +0 -0
  43. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_main/app/main.py +0 -0
  44. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_non_default/app/__init__.py +0 -0
  45. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_app_dir_non_default/app/nondefault.py +0 -0
  46. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_main/api.py +0 -0
  47. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_main/app.py +0 -0
  48. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/default_main/main.py +0 -0
  49. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/default_files/non_default/nonstandard.py +0 -0
  50. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/__init__.py +0 -0
  51. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/__init__.py +0 -0
  52. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/core/__init__.py +0 -0
  53. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/core/utils.py +0 -0
  54. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/mod/__init__.py +0 -0
  55. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/mod/api.py +0 -0
  56. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/mod/app.py +0 -0
  57. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/nested_package/package/mod/other.py +0 -0
  58. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/__init__.py +0 -0
  59. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/core/__init__.py +0 -0
  60. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/core/utils.py +0 -0
  61. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/mod/__init__.py +0 -0
  62. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/mod/api.py +0 -0
  63. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/mod/app.py +0 -0
  64. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/package/mod/other.py +0 -0
  65. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/pyproject_config/another_module.py +0 -0
  66. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/pyproject_config/my_module.py +0 -0
  67. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/pyproject_config/pyproject.toml +0 -0
  68. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/single_file_api.py +0 -0
  69. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/single_file_app.py +0 -0
  70. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/assets/single_file_other.py +0 -0
  71. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_discover.py +0 -0
  72. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_requirements.py +0 -0
  73. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_utils_cli.py +0 -0
  74. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_utils_default_dir.py +0 -0
  75. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_utils_default_file.py +0 -0
  76. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_utils_package.py +0 -0
  77. {fastapi_cli-0.0.18 → fastapi_cli-0.0.20}/tests/test_utils_single_file.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-cli
3
- Version: 0.0.18
3
+ Version: 0.0.20
4
4
  Summary: Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀
5
5
  Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiangolo@gmail.com>
6
6
  License-Expression: MIT
@@ -19,7 +19,6 @@ Classifier: Development Status :: 4 - Beta
19
19
  Classifier: Framework :: FastAPI
20
20
  Classifier: Intended Audience :: Developers
21
21
  Classifier: Programming Language :: Python :: 3 :: Only
22
- Classifier: Programming Language :: Python :: 3.8
23
22
  Classifier: Programming Language :: Python :: 3.9
24
23
  Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
@@ -31,7 +30,7 @@ Project-URL: Documentation, https://fastapi.tiangolo.com/fastapi-cli/
31
30
  Project-URL: Repository, https://github.com/fastapi/fastapi-cli
32
31
  Project-URL: Issues, https://github.com/fastapi/fastapi-cli/issues
33
32
  Project-URL: Changelog, https://github.com/fastapi/fastapi-cli/blob/main/release-notes.md
34
- Requires-Python: >=3.8
33
+ Requires-Python: >=3.9
35
34
  Requires-Dist: typer>=0.15.1
36
35
  Requires-Dist: uvicorn[standard]>=0.15.0
37
36
  Requires-Dist: rich-toolkit>=0.14.8
@@ -1,5 +1,5 @@
1
1
  import os
2
- from typing import Any, Dict
2
+ from typing import Any
3
3
 
4
4
  from pdm.backend.hooks import Context
5
5
 
@@ -9,12 +9,12 @@ TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi-cli")
9
9
  def pdm_build_initialize(context: Context):
10
10
  metadata = context.config.metadata
11
11
  # Get custom config for the current package, from the env var
12
- config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
12
+ config: dict[str, Any] = context.config.data["tool"]["tiangolo"][
13
13
  "_internal-slim-build"
14
14
  ]["packages"].get(TIANGOLO_BUILD_PACKAGE)
15
15
  if not config:
16
16
  return
17
- project_config: Dict[str, Any] = config["project"]
17
+ project_config: dict[str, Any] = config["project"]
18
18
  # Override main [project] configs with custom configs for this package
19
19
  for key, value in project_config.items():
20
20
  metadata[key] = value
@@ -5,7 +5,7 @@ description = "Run and manage FastAPI apps from the command line with FastAPI CL
5
5
  authors = [
6
6
  { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
7
7
  ]
8
- requires-python = ">=3.8"
8
+ requires-python = ">=3.9"
9
9
  readme = "README.md"
10
10
  license = "MIT"
11
11
  license-files = [
@@ -26,7 +26,6 @@ classifiers = [
26
26
  "Framework :: FastAPI",
27
27
  "Intended Audience :: Developers",
28
28
  "Programming Language :: Python :: 3 :: Only",
29
- "Programming Language :: Python :: 3.8",
30
29
  "Programming Language :: Python :: 3.9",
31
30
  "Programming Language :: Python :: 3.10",
32
31
  "Programming Language :: Python :: 3.11",
@@ -40,7 +39,7 @@ dependencies = [
40
39
  "rich-toolkit >= 0.14.8",
41
40
  "tomli >= 2.0.0; python_version < '3.11'",
42
41
  ]
43
- version = "0.0.18"
42
+ version = "0.0.20"
44
43
 
45
44
  [project.optional-dependencies]
46
45
  standard = [
@@ -0,0 +1 @@
1
+ __version__ = "0.0.20"
@@ -1,12 +1,11 @@
1
1
  import logging
2
2
  from pathlib import Path
3
- from typing import Any, List, Union
3
+ from typing import Annotated, Any, Union
4
4
 
5
5
  import typer
6
6
  from pydantic import ValidationError
7
7
  from rich import print
8
8
  from rich.tree import Tree
9
- from typing_extensions import Annotated
10
9
 
11
10
  from fastapi_cli.config import FastAPIConfig
12
11
  from fastapi_cli.discover import get_import_data, get_import_data_from_import_string
@@ -78,7 +77,7 @@ def callback(
78
77
  setup_logging(level=log_level)
79
78
 
80
79
 
81
- def _get_module_tree(module_paths: List[Path]) -> Tree:
80
+ def _get_module_tree(module_paths: list[Path]) -> Tree:
82
81
  root = module_paths[0]
83
82
  name = f"🐍 {root.name}" if root.is_file() else f"📁 {root.name}"
84
83
 
@@ -105,6 +104,7 @@ def _run(
105
104
  host: str = "127.0.0.1",
106
105
  port: int = 8000,
107
106
  reload: bool = True,
107
+ reload_dirs: Union[list[Path], None] = None,
108
108
  workers: Union[int, None] = None,
109
109
  root_path: str = "",
110
110
  command: str,
@@ -220,6 +220,11 @@ def _run(
220
220
  host=host,
221
221
  port=port,
222
222
  reload=reload,
223
+ reload_dirs=(
224
+ [str(directory.resolve()) for directory in reload_dirs]
225
+ if reload_dirs
226
+ else None
227
+ ),
223
228
  workers=workers,
224
229
  root_path=root_path,
225
230
  proxy_headers=proxy_headers,
@@ -256,6 +261,12 @@ def dev(
256
261
  help="Enable auto-reload of the server when (code) files change. This is [bold]resource intensive[/bold], use it only during development."
257
262
  ),
258
263
  ] = True,
264
+ reload_dir: Annotated[
265
+ Union[list[Path], None],
266
+ typer.Option(
267
+ help="Set reload directories explicitly, instead of using the current working directory."
268
+ ),
269
+ ] = None,
259
270
  root_path: Annotated[
260
271
  str,
261
272
  typer.Option(
@@ -319,6 +330,7 @@ def dev(
319
330
  host=host,
320
331
  port=port,
321
332
  reload=reload,
333
+ reload_dirs=reload_dir,
322
334
  root_path=root_path,
323
335
  app=app,
324
336
  entrypoint=entrypoint,
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  from pathlib import Path
3
- from typing import Any, Dict, Optional
3
+ from typing import Any, Optional
4
4
 
5
5
  from pydantic import BaseModel, StrictStr
6
6
 
@@ -11,7 +11,7 @@ class FastAPIConfig(BaseModel):
11
11
  entrypoint: Optional[StrictStr] = None
12
12
 
13
13
  @classmethod
14
- def _read_pyproject_toml(cls) -> Dict[str, Any]:
14
+ def _read_pyproject_toml(cls) -> dict[str, Any]:
15
15
  """Read FastAPI configuration from pyproject.toml in current directory."""
16
16
  pyproject_path = Path.cwd() / "pyproject.toml"
17
17
 
@@ -3,7 +3,7 @@ import sys
3
3
  from dataclasses import dataclass
4
4
  from logging import getLogger
5
5
  from pathlib import Path
6
- from typing import List, Union
6
+ from typing import Union
7
7
 
8
8
  from fastapi_cli.exceptions import FastAPICLIException
9
9
 
@@ -39,7 +39,7 @@ def get_default_path() -> Path:
39
39
  class ModuleData:
40
40
  module_import_str: str
41
41
  extra_sys_path: Path
42
- module_paths: List[Path]
42
+ module_paths: list[Path]
43
43
 
44
44
 
45
45
  def get_module_data_from_path(path: Path) -> ModuleData:
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Dict
2
+ from typing import Any
3
3
 
4
4
  from rich_toolkit import RichToolkit, RichToolkitTheme
5
5
  from rich_toolkit.styles import TaggedStyle
@@ -20,7 +20,7 @@ class CustomFormatter(DefaultFormatter):
20
20
  return result
21
21
 
22
22
 
23
- def get_uvicorn_log_config() -> Dict[str, Any]:
23
+ def get_uvicorn_log_config() -> dict[str, Any]:
24
24
  return {
25
25
  "version": 1,
26
26
  "disable_existing_loggers": False,
@@ -1,5 +1,5 @@
1
1
  import sys
2
- from typing import Generator
2
+ from collections.abc import Generator
3
3
 
4
4
  import pytest
5
5
  from typer import rich_utils
@@ -27,6 +27,7 @@ def test_dev() -> None:
27
27
  "host": "127.0.0.1",
28
28
  "port": 8000,
29
29
  "reload": True,
30
+ "reload_dirs": None,
30
31
  "workers": None,
31
32
  "root_path": "",
32
33
  "proxy_headers": True,
@@ -72,6 +73,7 @@ def test_dev_package() -> None:
72
73
  "host": "127.0.0.1",
73
74
  "port": 8000,
74
75
  "reload": True,
76
+ "reload_dirs": None,
75
77
  "workers": None,
76
78
  "root_path": "",
77
79
  "proxy_headers": True,
@@ -121,6 +123,7 @@ def test_dev_args() -> None:
121
123
  "host": "192.168.0.2",
122
124
  "port": 8080,
123
125
  "reload": False,
126
+ "reload_dirs": None,
124
127
  "workers": None,
125
128
  "root_path": "/api",
126
129
  "proxy_headers": False,
@@ -151,6 +154,7 @@ def test_dev_env_vars() -> None:
151
154
  "host": "127.0.0.1",
152
155
  "port": 8111,
153
156
  "reload": True,
157
+ "reload_dirs": None,
154
158
  "workers": None,
155
159
  "root_path": "",
156
160
  "proxy_headers": True,
@@ -188,6 +192,7 @@ def test_dev_env_vars_and_args() -> None:
188
192
  "host": "127.0.0.1",
189
193
  "port": 8080,
190
194
  "reload": True,
195
+ "reload_dirs": None,
191
196
  "workers": None,
192
197
  "root_path": "",
193
198
  "proxy_headers": True,
@@ -233,6 +238,7 @@ def test_run() -> None:
233
238
  "host": "0.0.0.0",
234
239
  "port": 8000,
235
240
  "reload": False,
241
+ "reload_dirs": None,
236
242
  "workers": None,
237
243
  "root_path": "",
238
244
  "proxy_headers": True,
@@ -259,6 +265,7 @@ def test_run_trust_proxy() -> None:
259
265
  "host": "0.0.0.0",
260
266
  "port": 8000,
261
267
  "reload": False,
268
+ "reload_dirs": None,
262
269
  "workers": None,
263
270
  "root_path": "",
264
271
  "proxy_headers": True,
@@ -305,6 +312,7 @@ def test_run_args() -> None:
305
312
  "host": "192.168.0.2",
306
313
  "port": 8080,
307
314
  "reload": False,
315
+ "reload_dirs": None,
308
316
  "workers": 2,
309
317
  "root_path": "/api",
310
318
  "proxy_headers": False,
@@ -336,6 +344,7 @@ def test_run_env_vars() -> None:
336
344
  "host": "0.0.0.0",
337
345
  "port": 8111,
338
346
  "reload": False,
347
+ "reload_dirs": None,
339
348
  "workers": None,
340
349
  "root_path": "",
341
350
  "proxy_headers": True,
@@ -369,6 +378,7 @@ def test_run_env_vars_and_args() -> None:
369
378
  "host": "0.0.0.0",
370
379
  "port": 8080,
371
380
  "reload": False,
381
+ "reload_dirs": None,
372
382
  "workers": None,
373
383
  "root_path": "",
374
384
  "proxy_headers": True,
@@ -404,6 +414,7 @@ def test_dev_help() -> None:
404
414
  assert "The host to serve on." in result.output
405
415
  assert "The port to serve on." in result.output
406
416
  assert "Enable auto-reload of the server when (code) files change." in result.output
417
+ assert "Set reload directories explicitly" in result.output
407
418
  assert "The root path is used to tell your app" in result.output
408
419
  assert "The name of the variable that contains the FastAPI app" in result.output
409
420
  assert "Use multiple worker processes." not in result.output
@@ -443,6 +454,30 @@ def test_version() -> None:
443
454
  assert "FastAPI CLI version:" in result.output
444
455
 
445
456
 
457
+ def test_dev_reload_dir() -> None:
458
+ with changing_dir(assets_path):
459
+ with patch.object(uvicorn, "run") as mock_run:
460
+ result = runner.invoke(
461
+ app,
462
+ [
463
+ "dev",
464
+ "single_file_app.py",
465
+ "--reload-dir",
466
+ "src",
467
+ "--reload-dir",
468
+ "lib",
469
+ ],
470
+ )
471
+ assert result.exit_code == 0, result.output
472
+ assert mock_run.called
473
+ assert mock_run.call_args
474
+ # Paths are resolved to absolute paths
475
+ reload_dirs = mock_run.call_args.kwargs["reload_dirs"]
476
+ assert len(reload_dirs) == 2
477
+ assert reload_dirs[0] == str((assets_path / "src").resolve())
478
+ assert reload_dirs[1] == str((assets_path / "lib").resolve())
479
+
480
+
446
481
  def test_dev_with_import_string() -> None:
447
482
  with changing_dir(assets_path):
448
483
  with patch.object(uvicorn, "run") as mock_run:
@@ -456,6 +491,7 @@ def test_dev_with_import_string() -> None:
456
491
  "host": "127.0.0.1",
457
492
  "port": 8000,
458
493
  "reload": True,
494
+ "reload_dirs": None,
459
495
  "workers": None,
460
496
  "root_path": "",
461
497
  "proxy_headers": True,
@@ -477,6 +513,7 @@ def test_run_with_import_string() -> None:
477
513
  "host": "0.0.0.0",
478
514
  "port": 8000,
479
515
  "reload": False,
516
+ "reload_dirs": None,
480
517
  "workers": None,
481
518
  "root_path": "",
482
519
  "proxy_headers": True,
@@ -13,9 +13,10 @@ assets_path = Path(__file__).parent / "assets"
13
13
 
14
14
 
15
15
  def test_dev_with_pyproject_app_config_uses() -> None:
16
- with changing_dir(assets_path / "pyproject_config"), patch.object(
17
- uvicorn, "run"
18
- ) as mock_run:
16
+ with (
17
+ changing_dir(assets_path / "pyproject_config"),
18
+ patch.object(uvicorn, "run") as mock_run,
19
+ ):
19
20
  result = runner.invoke(app, ["dev"])
20
21
  assert result.exit_code == 0, result.output
21
22
 
@@ -28,9 +29,10 @@ def test_dev_with_pyproject_app_config_uses() -> None:
28
29
 
29
30
 
30
31
  def test_run_with_pyproject_app_config() -> None:
31
- with changing_dir(assets_path / "pyproject_config"), patch.object(
32
- uvicorn, "run"
33
- ) as mock_run:
32
+ with (
33
+ changing_dir(assets_path / "pyproject_config"),
34
+ patch.object(uvicorn, "run") as mock_run,
35
+ ):
34
36
  result = runner.invoke(app, ["run"])
35
37
  assert result.exit_code == 0, result.output
36
38
 
@@ -43,9 +45,10 @@ def test_run_with_pyproject_app_config() -> None:
43
45
 
44
46
 
45
47
  def test_cli_arg_overrides_pyproject_config() -> None:
46
- with changing_dir(assets_path / "pyproject_config"), patch.object(
47
- uvicorn, "run"
48
- ) as mock_run:
48
+ with (
49
+ changing_dir(assets_path / "pyproject_config"),
50
+ patch.object(uvicorn, "run") as mock_run,
51
+ ):
49
52
  result = runner.invoke(app, ["dev", "another_module.py"])
50
53
 
51
54
  assert result.exit_code == 0, result.output
@@ -1,7 +1,8 @@
1
1
  import os
2
+ from collections.abc import Generator
2
3
  from contextlib import contextmanager
3
4
  from pathlib import Path
4
- from typing import Generator, Union
5
+ from typing import Union
5
6
 
6
7
 
7
8
  @contextmanager
@@ -1 +0,0 @@
1
- __version__ = "0.0.18"
File without changes
File without changes