fastapi

Форк
0
/
pyproject.toml 
196 строк · 7.2 Кб
1
[build-system]
2
requires = ["hatchling >= 1.13.0"]
3
build-backend = "hatchling.build"
4

5
[project]
6
name = "fastapi"
7
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
8
readme = "README.md"
9
requires-python = ">=3.8"
10
license = "MIT"
11
authors = [
12
    { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
13
]
14
classifiers = [
15
    "Intended Audience :: Information Technology",
16
    "Intended Audience :: System Administrators",
17
    "Operating System :: OS Independent",
18
    "Programming Language :: Python :: 3",
19
    "Programming Language :: Python",
20
    "Topic :: Internet",
21
    "Topic :: Software Development :: Libraries :: Application Frameworks",
22
    "Topic :: Software Development :: Libraries :: Python Modules",
23
    "Topic :: Software Development :: Libraries",
24
    "Topic :: Software Development",
25
    "Typing :: Typed",
26
    "Development Status :: 4 - Beta",
27
    "Environment :: Web Environment",
28
    "Framework :: AsyncIO",
29
    "Framework :: FastAPI",
30
    "Framework :: Pydantic",
31
    "Framework :: Pydantic :: 1",
32
    "Intended Audience :: Developers",
33
    "License :: OSI Approved :: MIT License",
34
    "Programming Language :: Python :: 3 :: Only",
35
    "Programming Language :: Python :: 3.8",
36
    "Programming Language :: Python :: 3.9",
37
    "Programming Language :: Python :: 3.10",
38
    "Programming Language :: Python :: 3.11",
39
    "Programming Language :: Python :: 3.12",
40
    "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
41
    "Topic :: Internet :: WWW/HTTP",
42
]
43
dependencies = [
44
    "starlette>=0.36.3,<0.37.0",
45
    "pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
46
    "typing-extensions>=4.8.0",
47
]
48
dynamic = ["version"]
49

50
[project.urls]
51
Homepage = "https://github.com/tiangolo/fastapi"
52
Documentation = "https://fastapi.tiangolo.com/"
53
Repository = "https://github.com/tiangolo/fastapi"
54

55
[project.optional-dependencies]
56
all = [
57
    "httpx >=0.23.0",
58
    "jinja2 >=2.11.2",
59
    "python-multipart >=0.0.7",
60
    "itsdangerous >=1.1.0",
61
    "pyyaml >=5.3.1",
62
    "ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
63
    "orjson >=3.2.1",
64
    "email_validator >=2.0.0",
65
    "uvicorn[standard] >=0.12.0",
66
    "pydantic-settings >=2.0.0",
67
    "pydantic-extra-types >=2.0.0",
68
]
69

70
[tool.hatch.version]
71
path = "fastapi/__init__.py"
72

73
[tool.mypy]
74
strict = true
75

76
[[tool.mypy.overrides]]
77
module = "fastapi.concurrency"
78
warn_unused_ignores = false
79
ignore_missing_imports = true
80

81
[[tool.mypy.overrides]]
82
module = "fastapi.tests.*"
83
ignore_missing_imports = true
84
check_untyped_defs = true
85

86
[[tool.mypy.overrides]]
87
module = "docs_src.*"
88
disallow_incomplete_defs = false
89
disallow_untyped_defs = false
90
disallow_untyped_calls = false
91

92
[tool.pytest.ini_options]
93
addopts = [
94
  "--strict-config",
95
  "--strict-markers",
96
  "--ignore=docs_src",
97
]
98
xfail_strict = true
99
junit_family = "xunit2"
100
filterwarnings = [
101
    "error",
102
    # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
103
    'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
104
    'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
105
    # TODO: remove after upgrading HTTPX to a version newer than 0.23.0
106
    # Including PR: https://github.com/encode/httpx/pull/2309
107
    "ignore:'cgi' is deprecated:DeprecationWarning",
108
    # For passlib
109
    "ignore:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning",
110
    # see https://trio.readthedocs.io/en/stable/history.html#trio-0-22-0-2022-09-28
111
    "ignore:You seem to already have a custom.*:RuntimeWarning:trio",
112
    "ignore::trio.TrioDeprecationWarning",
113
    # TODO remove pytest-cov
114
    'ignore::pytest.PytestDeprecationWarning:pytest_cov',
115
    # TODO: remove after upgrading SQLAlchemy to a version that includes the following changes
116
    # https://github.com/sqlalchemy/sqlalchemy/commit/59521abcc0676e936b31a523bd968fc157fef0c2
117
    'ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:sqlalchemy',
118
    # TODO: remove after upgrading python-jose to a version that explicitly supports Python 3.12
119
    # also, if it won't receive an update, consider replacing python-jose with some alternative
120
    # related issues:
121
    #   - https://github.com/mpdavis/python-jose/issues/332
122
    #   - https://github.com/mpdavis/python-jose/issues/334
123
    'ignore:datetime\.datetime\.utcnow\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:jose',
124
    # TODO: remove after upgrading Starlette to a version including https://github.com/encode/starlette/pull/2406
125
    # Probably Starlette 0.36.0
126
    "ignore: The 'method' parameter is not used, and it will be removed.:DeprecationWarning:starlette",
127
]
128

129
[tool.coverage.run]
130
parallel = true
131
source = [
132
    "docs_src",
133
    "tests",
134
    "fastapi"
135
]
136
context = '${CONTEXT}'
137
omit = [
138
    "docs_src/response_model/tutorial003_04.py",
139
    "docs_src/response_model/tutorial003_04_py310.py",
140
]
141

142
[tool.ruff]
143
select = [
144
    "E",  # pycodestyle errors
145
    "W",  # pycodestyle warnings
146
    "F",  # pyflakes
147
    "I",  # isort
148
    "B",  # flake8-bugbear
149
    "C4",  # flake8-comprehensions
150
    "UP",  # pyupgrade
151
]
152
ignore = [
153
    "E501",  # line too long, handled by black
154
    "B008",  # do not perform function calls in argument defaults
155
    "W191",  # indentation contains tabs
156
]
157

158
[tool.ruff.per-file-ignores]
159
"__init__.py" = ["F401"]
160
"docs_src/dependencies/tutorial007.py" = ["F821"]
161
"docs_src/dependencies/tutorial008.py" = ["F821"]
162
"docs_src/dependencies/tutorial009.py" = ["F821"]
163
"docs_src/dependencies/tutorial010.py" = ["F821"]
164
"docs_src/custom_response/tutorial007.py" = ["B007"]
165
"docs_src/dataclasses/tutorial003.py" = ["I001"]
166
"docs_src/path_operation_advanced_configuration/tutorial007.py" = ["B904"]
167
"docs_src/path_operation_advanced_configuration/tutorial007_pv1.py" = ["B904"]
168
"docs_src/custom_request_and_route/tutorial002.py" = ["B904"]
169
"docs_src/dependencies/tutorial008_an.py" = ["F821"]
170
"docs_src/dependencies/tutorial008_an_py39.py" = ["F821"]
171
"docs_src/query_params_str_validations/tutorial012_an.py" = ["B006"]
172
"docs_src/query_params_str_validations/tutorial012_an_py39.py" = ["B006"]
173
"docs_src/query_params_str_validations/tutorial013_an.py" = ["B006"]
174
"docs_src/query_params_str_validations/tutorial013_an_py39.py" = ["B006"]
175
"docs_src/security/tutorial004.py" = ["B904"]
176
"docs_src/security/tutorial004_an.py" = ["B904"]
177
"docs_src/security/tutorial004_an_py310.py" = ["B904"]
178
"docs_src/security/tutorial004_an_py39.py" = ["B904"]
179
"docs_src/security/tutorial004_py310.py" = ["B904"]
180
"docs_src/security/tutorial005.py" = ["B904"]
181
"docs_src/security/tutorial005_an.py" = ["B904"]
182
"docs_src/security/tutorial005_an_py310.py" = ["B904"]
183
"docs_src/security/tutorial005_an_py39.py" = ["B904"]
184
"docs_src/security/tutorial005_py310.py" = ["B904"]
185
"docs_src/security/tutorial005_py39.py" = ["B904"]
186
"docs_src/dependencies/tutorial008b.py" = ["B904"]
187
"docs_src/dependencies/tutorial008b_an.py" = ["B904"]
188
"docs_src/dependencies/tutorial008b_an_py39.py" = ["B904"]
189

190

191
[tool.ruff.isort]
192
known-third-party = ["fastapi", "pydantic", "starlette"]
193

194
[tool.ruff.pyupgrade]
195
# Preserve types, even if a file imports `from __future__ import annotations`.
196
keep-runtime-typing = true
197

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.