-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathpyproject.toml
167 lines (150 loc) · 4.65 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
[tool.poetry]
name = "fastapi-sqla"
version = "2.5.0"
description = "SQLAlchemy extension for FastAPI with support for pagination, asyncio and pytest, ready for production."
authors = [
"Hadrien David <[email protected]>",
"Victor Repkow <[email protected]>",
]
license = "MIT"
readme = "README.md"
repository = "https://github.com/dialoguemd/fastapi-sqla"
keywords = ["FastAPI", "SQLAlchemy", "asyncio", "pytest", "alembic"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: AsyncIO",
"Framework :: FastAPI",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
"Programming Language :: SQL",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Typing :: Typed",
]
[tool.poetry.dependencies]
python = "^3.7"
fastapi = ">=0.61"
pydantic = "<2"
sqlalchemy = "<2"
structlog = ">=20"
alembic = { version = "^1.4.3", optional = true}
asgi_lifespan = { version = "^1.0.1", optional = true}
asyncpg = {version = "^0.25.0", optional = true}
black = {version = "^22.8.0", optional = true}
Faker = {version = "^14.2.0", optional = true}
httpx = {version = "^0.23.0", optional = true}
isort = { version = "^5.5.3", optional = true}
pdbpp = { version = "^0.10.2", optional = true}
psycopg2 = { version = "^2.8.6", optional = true}
pylama = {version = "^8.4.1", optional = true}
pytest = {version = "^7.1.3", optional = true}
pytest-asyncio = {version = "^0.19.0", optional = true}
pytest-cov = { version = "^2.10.1", optional = true}
tox = {version = "^3.26.0", optional = true}
boto3 = {version = "^1.24.74", optional = true}
greenlet = {version = "^1.1.3", optional = true}
[tool.poetry.extras]
# Test dependencies as extras so they can be set as extras in tox config
# More info on https://github.com/python-poetry/poetry/issues/1941
tests = [
"alembic",
"asgi_lifespan",
"black",
"coverage",
"Faker",
"greenlet",
"httpx",
"isort",
"pdbpp",
"psycopg2",
"pylama",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-watch",
"tox",
]
asyncpg = ["asyncpg"]
aws_rds_iam = ["boto3"]
[build-system]
requires = ["poetry>=1.2.0"]
build-backend = "poetry.masonry.api"
[tool.semantic_release]
version_variable = "pyproject.toml:version"
upload_to_pypi = false
commit_message = "Version generated by python-semantic-release [ci skip]"
[tool.poetry.plugins."pytest11"]
fastapi-sqla = "fastapi_sqla._pytest_plugin"
[tool.pylama]
paths = "fastapi_sqla tests"
linters = "pycodestyle,mccabe,pyflakes"
[tool.pylama.linter.pycodestyle]
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
max_line_length = 88
[tool.isort]
profile = "black"
lines_between_sections = 1
multi_line_output = 3
include_trailing_comma = "True"
line_length = 88
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = "tests"
norecursedirs = ".git,.venv"
xfail_strict = "true"
addopts = """
-p no:fastapi-sqla
--cov-config pyproject.toml
--cov-report term
--cov-report term-missing
"""
# https://nedbatchelder.com/blog/201810/why_warnings_is_mysterious.html
filterwarnings = [
"error:.*removed in version 2.0.*:",
]
[tool.pytest-watch.run]
ext = ".py, .yaml, .cfg"
[tool.coverage.run]
branch = true
omit = [
"tests/*",
".venv/*"
]
concurrency = ["thread", "greenlet"]
[tool.coverage.report]
skip_covered = true
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = sqlalchemy{ 1.3, 1.4 }-{ asyncpg, noasyncpg }-{aws_rds_iam, noaws_rds_iam }
[testenv]
passenv = CI
deps =
sqlalchemy1.3: sqlalchemy<1.4
sqlalchemy1.4: sqlalchemy>=1.4,<2
asyncpg: asyncpg
aws_rds_iam: boto3
extras =
tests
commands = pytest -vv --cov={envsitepackagesdir}/fastapi_sqla --cov-report xml --cov-report html --junitxml=test-reports/pytest/junit.xml
"""
[tool.black]
exclude = ".mypy_cache|.pytest_cache|.vscode|.eggs|venv"
--skip-magic-trailing-comma = true