fastapi-cli 0.0.1__tar.gz → 0.0.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.
Files changed (61) hide show
  1. fastapi_cli-0.0.3/LICENSE +21 -0
  2. fastapi_cli-0.0.3/PKG-INFO +145 -0
  3. fastapi_cli-0.0.3/README.md +107 -0
  4. fastapi_cli-0.0.3/pdm_build.py +39 -0
  5. fastapi_cli-0.0.3/pyproject.toml +142 -0
  6. fastapi_cli-0.0.3/requirements-tests.txt +9 -0
  7. fastapi_cli-0.0.3/requirements.txt +5 -0
  8. fastapi_cli-0.0.3/scripts/format.sh +6 -0
  9. fastapi_cli-0.0.3/scripts/lint.sh +8 -0
  10. fastapi_cli-0.0.3/scripts/test-cov-html.sh +9 -0
  11. fastapi_cli-0.0.3/scripts/test.sh +6 -0
  12. fastapi_cli-0.0.3/src/fastapi_cli/__init__.py +1 -0
  13. fastapi_cli-0.0.3/src/fastapi_cli/__main__.py +3 -0
  14. fastapi_cli-0.0.3/src/fastapi_cli/cli.py +269 -0
  15. fastapi_cli-0.0.3/src/fastapi_cli/discover.py +163 -0
  16. fastapi_cli-0.0.3/src/fastapi_cli/exceptions.py +2 -0
  17. fastapi_cli-0.0.3/src/fastapi_cli/logging.py +23 -0
  18. fastapi_cli-0.0.3/src/fastapi_cli/py.typed +0 -0
  19. fastapi_cli-0.0.3/tests/__init__.py +0 -0
  20. fastapi_cli-0.0.3/tests/assets/broken_package/mod/__init__.py +1 -0
  21. fastapi_cli-0.0.3/tests/assets/broken_package/mod/app.py +10 -0
  22. fastapi_cli-0.0.3/tests/assets/broken_package/utils.py +2 -0
  23. fastapi_cli-0.0.3/tests/assets/default_files/default_api/api.py +8 -0
  24. fastapi_cli-0.0.3/tests/assets/default_files/default_app/api.py +8 -0
  25. fastapi_cli-0.0.3/tests/assets/default_files/default_app/app.py +8 -0
  26. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_api/app/__init__.py +0 -0
  27. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_api/app/api.py +8 -0
  28. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_app/app/__init__.py +0 -0
  29. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_app/app/api.py +8 -0
  30. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_app/app/app.py +8 -0
  31. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_main/app/__init__.py +0 -0
  32. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_main/app/api.py +8 -0
  33. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_main/app/app.py +8 -0
  34. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_main/app/main.py +8 -0
  35. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_non_default/app/__init__.py +0 -0
  36. fastapi_cli-0.0.3/tests/assets/default_files/default_app_dir_non_default/app/nondefault.py +8 -0
  37. fastapi_cli-0.0.3/tests/assets/default_files/default_main/api.py +8 -0
  38. fastapi_cli-0.0.3/tests/assets/default_files/default_main/app.py +8 -0
  39. fastapi_cli-0.0.3/tests/assets/default_files/default_main/main.py +8 -0
  40. fastapi_cli-0.0.3/tests/assets/default_files/non_default/nonstandard.py +8 -0
  41. fastapi_cli-0.0.3/tests/assets/package/__init__.py +2 -0
  42. fastapi_cli-0.0.3/tests/assets/package/core/__init__.py +0 -0
  43. fastapi_cli-0.0.3/tests/assets/package/core/utils.py +2 -0
  44. fastapi_cli-0.0.3/tests/assets/package/mod/__init__.py +1 -0
  45. fastapi_cli-0.0.3/tests/assets/package/mod/api.py +24 -0
  46. fastapi_cli-0.0.3/tests/assets/package/mod/app.py +32 -0
  47. fastapi_cli-0.0.3/tests/assets/package/mod/other.py +16 -0
  48. fastapi_cli-0.0.3/tests/assets/single_file_api.py +24 -0
  49. fastapi_cli-0.0.3/tests/assets/single_file_app.py +32 -0
  50. fastapi_cli-0.0.3/tests/assets/single_file_other.py +16 -0
  51. fastapi_cli-0.0.3/tests/conftest.py +23 -0
  52. fastapi_cli-0.0.3/tests/test_cli.py +223 -0
  53. fastapi_cli-0.0.3/tests/test_utils_default_dir.py +88 -0
  54. fastapi_cli-0.0.3/tests/test_utils_default_file.py +103 -0
  55. fastapi_cli-0.0.3/tests/test_utils_package.py +455 -0
  56. fastapi_cli-0.0.3/tests/test_utils_single_file.py +115 -0
  57. fastapi_cli-0.0.3/tests/utils.py +14 -0
  58. fastapi-cli-0.0.1/PKG-INFO +0 -11
  59. fastapi-cli-0.0.1/fastapi_cli/__init__.py +0 -3
  60. fastapi-cli-0.0.1/pyproject.toml +0 -16
  61. fastapi-cli-0.0.1/setup.py +0 -28
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Sebastián Ramírez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.1
2
+ Name: fastapi-cli
3
+ Version: 0.0.3
4
+ Summary: Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀
5
+ Home-page: https://github.com/tiangolo/fastapi-cli
6
+ Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiangolo@gmail.com>
7
+ License: MIT
8
+ Classifier: Intended Audience :: Information Technology
9
+ Classifier: Intended Audience :: System Administrators
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Classifier: Topic :: Software Development :: Libraries
16
+ Classifier: Topic :: Software Development
17
+ Classifier: Typing :: Typed
18
+ Classifier: Development Status :: 4 - Beta
19
+ Classifier: Framework :: FastAPI
20
+ Classifier: Intended Audience :: Developers
21
+ Classifier: License :: OSI Approved :: MIT License
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.7
24
+ Classifier: Programming Language :: Python :: 3.8
25
+ Classifier: Programming Language :: Python :: 3.9
26
+ Classifier: Programming Language :: Python :: 3.10
27
+ Classifier: Programming Language :: Python :: 3.11
28
+ Classifier: Programming Language :: Python :: 3.12
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Project-URL: Documentation, https://fastapi.tiangolo.com
31
+ Project-URL: Homepage, https://github.com/tiangolo/fastapi-cli
32
+ Project-URL: Repository, https://github.com/tiangolo/fastapi-cli
33
+ Requires-Python: >=3.8
34
+ Requires-Dist: typer>=0.12.3
35
+ Requires-Dist: fastapi
36
+ Requires-Dist: uvicorn[standard]>=0.15.0
37
+ Description-Content-Type: text/markdown
38
+
39
+ # FastAPI CLI
40
+
41
+ <a href="https://github.com/tiangolo/fastapi-cli/actions/workflows/test.yml" target="_blank">
42
+ <img src="https://github.com/tiangolo/fastapi-cli/actions/workflows/test.yml/badge.svg" alt="Test">
43
+ </a>
44
+ <a href="https://github.com/tiangolo/fastapi-cli/actions/workflows/publish.yml" target="_blank">
45
+ <img src="https://github.com/tiangolo/fastapi-cli/actions/workflows/publish.yml/badge.svg" alt="Publish">
46
+ </a>
47
+ <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/fastapi-cli" target="_blank">
48
+ <img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/fastapi-cli.svg" alt="Coverage">
49
+ <a href="https://pypi.org/project/fastapi-cli" target="_blank">
50
+ <img src="https://img.shields.io/pypi/v/fastapi-cli?color=%2334D058&label=pypi%20package" alt="Package version">
51
+ </a>
52
+
53
+ ---
54
+
55
+ **Source Code**: <a href="https://github.com/tiangolo/fastapi-cli" target="_blank">https://github.com/tiangolo/fastapi-cli</a>
56
+
57
+ ---
58
+
59
+ Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀
60
+
61
+ ## Description
62
+
63
+ **FastAPI CLI** is a command line program `fastapi` that you can use to serve your FastAPI app, manage your FastAPI project, and more.
64
+
65
+ When you install FastAPI (e.g. with `pip install fastapi`), it includes a package called `fastapi-cli`, this package provides the `fastapi` command in the terminal.
66
+
67
+ To run your FastAPI app for development, you can use the `fastapi dev` command:
68
+
69
+ <div class="termy">
70
+
71
+ ```console
72
+ $ fastapi dev main.py
73
+ INFO Using path main.py
74
+ INFO Resolved absolute path /home/user/code/awesomeapp/main.py
75
+ INFO Searching for package file structure from directories with __init__.py files
76
+ INFO Importing from /home/user/code/awesomeapp
77
+
78
+ ╭─ Python module file ─╮
79
+ │ │
80
+ │ 🐍 main.py │
81
+ │ │
82
+ ╰──────────────────────╯
83
+
84
+ INFO Importing module main
85
+ INFO Found importable FastAPI app
86
+
87
+ ╭─ Importable FastAPI app ─╮
88
+ │ │
89
+ │ from main import app │
90
+ │ │
91
+ ╰──────────────────────────╯
92
+
93
+ INFO Using import string main:app
94
+
95
+ ╭────────── FastAPI CLI - Development mode ───────────╮
96
+ │ │
97
+ │ Serving at: http://127.0.0.1:8000 │
98
+ │ │
99
+ │ API docs: http://127.0.0.1:8000/docs │
100
+ │ │
101
+ │ Running in development mode, for production use: │
102
+ │ │
103
+ │ fastapi run │
104
+ │ │
105
+ ╰─────────────────────────────────────────────────────╯
106
+
107
+ INFO: Will watch for changes in these directories: ['/home/user/code/awesomeapp']
108
+ INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
109
+ INFO: Started reloader process [56345] using WatchFiles
110
+ INFO: Started server process [56352]
111
+ INFO: Waiting for application startup.
112
+ INFO: Application startup complete.
113
+ ```
114
+
115
+ </div>
116
+
117
+ That command line program called `fastapi` is **FastAPI CLI**.
118
+
119
+ FastAPI CLI takes the path to your Python program and automatically detects the variable with the FastAPI (commonly named `app`) and how to import it, and then serves it.
120
+
121
+ For production you would use `fastapi run` instead. 🚀
122
+
123
+ Internally, **FastAPI CLI** uses <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a>, a high-performance, production-ready, ASGI server. 😎
124
+
125
+ ## `fastapi dev`
126
+
127
+ When you run `fastapi dev`, it will run on development mode.
128
+
129
+ By default, it will have **auto-reload** enabled, so it will automatically reload the server when you make changes to your code. This is resource intensive and could be less stable than without it, you should only use it for development.
130
+
131
+ By default it will listen on the IP address `127.0.0.1`, which is the IP for your machine to communicate with itself alone (`localhost`).
132
+
133
+ ## `fastapi run`
134
+
135
+ When you run `fastapi run`, it will run on production mode by default.
136
+
137
+ It will have **auto-reload disabled** by default.
138
+
139
+ It will listen on the IP address `0.0.0.0`, which means all the available IP addresses, this way it will be publicly accessible to anyone that can communicate with the machine. This is how you would normally run it in production, for example, in a container.
140
+
141
+ In most cases you would (and should) have a "termination proxy" handling HTTPS for you on top, this will depend on how you deploy your application, your provider might do this for you, or you might need to set it up yourself. You can learn more about it in the <a href="https://fastapi.tiangolo.com/deployment/" class="external-link" target="_blank">FastAPI Deployment documentation</a>.
142
+
143
+ ## License
144
+
145
+ This project is licensed under the terms of the MIT license.
@@ -0,0 +1,107 @@
1
+ # FastAPI CLI
2
+
3
+ <a href="https://github.com/tiangolo/fastapi-cli/actions/workflows/test.yml" target="_blank">
4
+ <img src="https://github.com/tiangolo/fastapi-cli/actions/workflows/test.yml/badge.svg" alt="Test">
5
+ </a>
6
+ <a href="https://github.com/tiangolo/fastapi-cli/actions/workflows/publish.yml" target="_blank">
7
+ <img src="https://github.com/tiangolo/fastapi-cli/actions/workflows/publish.yml/badge.svg" alt="Publish">
8
+ </a>
9
+ <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/fastapi-cli" target="_blank">
10
+ <img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/fastapi-cli.svg" alt="Coverage">
11
+ <a href="https://pypi.org/project/fastapi-cli" target="_blank">
12
+ <img src="https://img.shields.io/pypi/v/fastapi-cli?color=%2334D058&label=pypi%20package" alt="Package version">
13
+ </a>
14
+
15
+ ---
16
+
17
+ **Source Code**: <a href="https://github.com/tiangolo/fastapi-cli" target="_blank">https://github.com/tiangolo/fastapi-cli</a>
18
+
19
+ ---
20
+
21
+ Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀
22
+
23
+ ## Description
24
+
25
+ **FastAPI CLI** is a command line program `fastapi` that you can use to serve your FastAPI app, manage your FastAPI project, and more.
26
+
27
+ When you install FastAPI (e.g. with `pip install fastapi`), it includes a package called `fastapi-cli`, this package provides the `fastapi` command in the terminal.
28
+
29
+ To run your FastAPI app for development, you can use the `fastapi dev` command:
30
+
31
+ <div class="termy">
32
+
33
+ ```console
34
+ $ fastapi dev main.py
35
+ INFO Using path main.py
36
+ INFO Resolved absolute path /home/user/code/awesomeapp/main.py
37
+ INFO Searching for package file structure from directories with __init__.py files
38
+ INFO Importing from /home/user/code/awesomeapp
39
+
40
+ ╭─ Python module file ─╮
41
+ │ │
42
+ │ 🐍 main.py │
43
+ │ │
44
+ ╰──────────────────────╯
45
+
46
+ INFO Importing module main
47
+ INFO Found importable FastAPI app
48
+
49
+ ╭─ Importable FastAPI app ─╮
50
+ │ │
51
+ │ from main import app │
52
+ │ │
53
+ ╰──────────────────────────╯
54
+
55
+ INFO Using import string main:app
56
+
57
+ ╭────────── FastAPI CLI - Development mode ───────────╮
58
+ │ │
59
+ │ Serving at: http://127.0.0.1:8000 │
60
+ │ │
61
+ │ API docs: http://127.0.0.1:8000/docs │
62
+ │ │
63
+ │ Running in development mode, for production use: │
64
+ │ │
65
+ │ fastapi run │
66
+ │ │
67
+ ╰─────────────────────────────────────────────────────╯
68
+
69
+ INFO: Will watch for changes in these directories: ['/home/user/code/awesomeapp']
70
+ INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
71
+ INFO: Started reloader process [56345] using WatchFiles
72
+ INFO: Started server process [56352]
73
+ INFO: Waiting for application startup.
74
+ INFO: Application startup complete.
75
+ ```
76
+
77
+ </div>
78
+
79
+ That command line program called `fastapi` is **FastAPI CLI**.
80
+
81
+ FastAPI CLI takes the path to your Python program and automatically detects the variable with the FastAPI (commonly named `app`) and how to import it, and then serves it.
82
+
83
+ For production you would use `fastapi run` instead. 🚀
84
+
85
+ Internally, **FastAPI CLI** uses <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a>, a high-performance, production-ready, ASGI server. 😎
86
+
87
+ ## `fastapi dev`
88
+
89
+ When you run `fastapi dev`, it will run on development mode.
90
+
91
+ By default, it will have **auto-reload** enabled, so it will automatically reload the server when you make changes to your code. This is resource intensive and could be less stable than without it, you should only use it for development.
92
+
93
+ By default it will listen on the IP address `127.0.0.1`, which is the IP for your machine to communicate with itself alone (`localhost`).
94
+
95
+ ## `fastapi run`
96
+
97
+ When you run `fastapi run`, it will run on production mode by default.
98
+
99
+ It will have **auto-reload disabled** by default.
100
+
101
+ It will listen on the IP address `0.0.0.0`, which means all the available IP addresses, this way it will be publicly accessible to anyone that can communicate with the machine. This is how you would normally run it in production, for example, in a container.
102
+
103
+ In most cases you would (and should) have a "termination proxy" handling HTTPS for you on top, this will depend on how you deploy your application, your provider might do this for you, or you might need to set it up yourself. You can learn more about it in the <a href="https://fastapi.tiangolo.com/deployment/" class="external-link" target="_blank">FastAPI Deployment documentation</a>.
104
+
105
+ ## License
106
+
107
+ This project is licensed under the terms of the MIT license.
@@ -0,0 +1,39 @@
1
+ import os
2
+ from typing import Any, Dict, List
3
+
4
+ from pdm.backend.hooks import Context
5
+
6
+ TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "fastapi-cli")
7
+
8
+
9
+ def pdm_build_initialize(context: Context):
10
+ metadata = context.config.metadata
11
+ # Get custom config for the current package, from the env var
12
+ config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
13
+ "_internal-slim-build"
14
+ ]["packages"][TIANGOLO_BUILD_PACKAGE]
15
+ project_config: Dict[str, Any] = config["project"]
16
+ # Get main optional dependencies, extras
17
+ optional_dependencies: Dict[str, List[str]] = metadata.get(
18
+ "optional-dependencies", {}
19
+ )
20
+ # Get custom optional dependencies name to always include in this (non-slim) package
21
+ include_optional_dependencies: List[str] = config.get(
22
+ "include-optional-dependencies", []
23
+ )
24
+ # Override main [project] configs with custom configs for this package
25
+ for key, value in project_config.items():
26
+ metadata[key] = value
27
+ # Get custom build config for the current package
28
+ build_config: Dict[str, Any] = (
29
+ config.get("tool", {}).get("pdm", {}).get("build", {})
30
+ )
31
+ # Override PDM build config with custom build config for this package
32
+ for key, value in build_config.items():
33
+ context.config.build_config[key] = value
34
+ # Get main dependencies
35
+ dependencies: List[str] = metadata.get("dependencies", [])
36
+ # Add optional dependencies to the default dependencies for this (non-slim) package
37
+ for include_optional in include_optional_dependencies:
38
+ optional_dependencies_group = optional_dependencies.get(include_optional, [])
39
+ dependencies.extend(optional_dependencies_group)
@@ -0,0 +1,142 @@
1
+ [project]
2
+ name = "fastapi-cli"
3
+ dynamic = []
4
+ description = "Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀"
5
+ authors = [
6
+ { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
7
+ ]
8
+ requires-python = ">=3.8"
9
+ readme = "README.md"
10
+ classifiers = [
11
+ "Intended Audience :: Information Technology",
12
+ "Intended Audience :: System Administrators",
13
+ "Operating System :: OS Independent",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python",
16
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
17
+ "Topic :: Software Development :: Libraries :: Python Modules",
18
+ "Topic :: Software Development :: Libraries",
19
+ "Topic :: Software Development",
20
+ "Typing :: Typed",
21
+ "Development Status :: 4 - Beta",
22
+ "Framework :: FastAPI",
23
+ "Intended Audience :: Developers",
24
+ "License :: OSI Approved :: MIT License",
25
+ "Programming Language :: Python :: 3 :: Only",
26
+ "Programming Language :: Python :: 3.7",
27
+ "Programming Language :: Python :: 3.8",
28
+ "Programming Language :: Python :: 3.9",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "License :: OSI Approved :: MIT License",
33
+ ]
34
+ dependencies = [
35
+ "typer >= 0.12.3",
36
+ "fastapi",
37
+ "uvicorn[standard] >= 0.15.0",
38
+ ]
39
+ version = "0.0.3"
40
+
41
+ [project.license]
42
+ text = "MIT"
43
+
44
+ [project.optional-dependencies]
45
+
46
+ [project.urls]
47
+ Documentation = "https://fastapi.tiangolo.com"
48
+ homepage = "https://github.com/tiangolo/fastapi-cli"
49
+ Repository = "https://github.com/tiangolo/fastapi-cli"
50
+
51
+ [project.scripts]
52
+ fastapi = "fastapi_cli.cli:main"
53
+
54
+ [build-system]
55
+ requires = [
56
+ "pdm-backend",
57
+ ]
58
+ build-backend = "pdm.backend"
59
+
60
+ [tool.pdm]
61
+ distribution = true
62
+
63
+ [tool.pdm.version]
64
+ source = "file"
65
+ path = "src/fastapi_cli/__init__.py"
66
+
67
+ [tool.pdm.build]
68
+ source-includes = [
69
+ "tests/",
70
+ "requirements*.txt",
71
+ "scripts/",
72
+ ]
73
+
74
+ [tool.tiangolo._internal-slim-build.packages.fastapi-cli-slim.project]
75
+ name = "fastapi-cli-slim"
76
+
77
+ [tool.tiangolo._internal-slim-build.packages.fastapi-cli]
78
+ include-optional-dependencies = [
79
+ "standard",
80
+ ]
81
+
82
+ [tool.tiangolo._internal-slim-build.packages.fastapi-cli.project.optional-dependencies]
83
+
84
+ [tool.pytest.ini_options]
85
+ addopts = [
86
+ "--strict-config",
87
+ "--strict-markers",
88
+ ]
89
+ xfail_strict = true
90
+ junit_family = "xunit2"
91
+
92
+ [tool.coverage.run]
93
+ parallel = true
94
+ data_file = "coverage/.coverage"
95
+ source = [
96
+ "src",
97
+ "tests",
98
+ ]
99
+ context = "${CONTEXT}"
100
+ omit = [
101
+ "tests/assets/*",
102
+ ]
103
+
104
+ [tool.coverage.report]
105
+ exclude_lines = [
106
+ "pragma: no cover",
107
+ "@overload",
108
+ "if __name__ == \"__main__\":",
109
+ "if TYPE_CHECKING:",
110
+ ]
111
+
112
+ [tool.mypy]
113
+ strict = true
114
+ exclude = [
115
+ "tests/assets/*",
116
+ ]
117
+
118
+ [tool.ruff.lint]
119
+ select = [
120
+ "E",
121
+ "W",
122
+ "F",
123
+ "I",
124
+ "B",
125
+ "C4",
126
+ "UP",
127
+ ]
128
+ ignore = [
129
+ "E501",
130
+ "B008",
131
+ "C901",
132
+ "W191",
133
+ ]
134
+
135
+ [tool.ruff.lint.isort]
136
+ known-third-party = [
137
+ "typer",
138
+ "fastapi",
139
+ ]
140
+
141
+ [tool.ruff.lint.pyupgrade]
142
+ keep-runtime-typing = true
@@ -0,0 +1,9 @@
1
+ -e .
2
+
3
+ pytest >=4.4.0,<9.0.0
4
+ coverage[toml] >=6.2,<8.0
5
+ mypy ==1.10.0
6
+ ruff ==0.4.3
7
+ # Needed explicitly by fastapi-cli-slim
8
+ fastapi-slim
9
+ uvicorn
@@ -0,0 +1,5 @@
1
+ -e .
2
+
3
+ -r requirements-tests.txt
4
+
5
+ pre-commit >=2.17.0,<4.0.0
@@ -0,0 +1,6 @@
1
+ #!/bin/sh -e
2
+ set -x
3
+ set -e
4
+
5
+ ruff src tests scripts --fix
6
+ ruff format src tests scripts
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ mypy src tests
7
+ ruff check src tests scripts
8
+ ruff format src tests --check
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ bash scripts/test.sh ${@}
7
+ coverage combine
8
+ coverage report --show-missing
9
+ coverage html
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ set -x
5
+
6
+ coverage run -m pytest tests ${@}
@@ -0,0 +1 @@
1
+ __version__ = "0.0.3"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ main()