-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
180 lines (156 loc) · 4.39 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
168
169
170
171
172
173
174
175
176
177
178
179
180
[tool.poetry]
name = "torchlite"
version = "0.0.0"
description = "Torchlite API backend service"
authors = [
"capitanu <[email protected]>",
"Sandeep Puthanveetil Satheesan <[email protected]>"
]
readme = "README.md"
packages = [{include = "htrc"}]
repository = "https://github.com/htrc/torchlite-backend"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"
dirty = true
[tool.poetry.dependencies]
python = "^3.12"
fastapi = {extras = ["all"], version = "^0.115.2"}
uvicorn = {extras = ["standard"], version = "^0.29.0"}
fastapi-healthchecks = "^1.0.7"
authlib = "^1.3.1"
python-dotenv = "^1.0.0"
motor = "^3.3.1"
httpx = "^0.27.0"
pydantic = "^2.4.2"
regex = "^2024.5.10"
ruamel-yaml = "^0.18.6"
fastapi-cache2 = {version = "^0.2.2", extras = ["redis"]}
[tool.poetry.group.test.dependencies]
pytest = "^7.2.2"
pytest-asyncio = "^0.18.3"
pytest-cov = "^3.0.0"
pytest-html = "^3.1.1"
pytest-lazy-fixture = "^0.6.3"
coverage = { version = "^7.0.5", extras = ["toml"]}
Faker = "^13.11.0"
tox = "^4.0.0"
[tool.poetry.group.lint.dependencies]
ruff = "^0.0.262"
black = "^24.3.0"
mypy = "^0.950"
pyflakes = "^3.0.1"
types-requests = "^2.28.11.17"
types-setuptools = "^67.6.0.8"
types-ujson = "^5.7.0.3"
types-pyyaml = "^6.0.12.9"
[tool.poetry.group.docs.dependencies]
sphinx = "*"
sphinx-autodoc-typehints = "*"
[tool.mypy]
no_implicit_optional = true
show_error_codes = true
warn_unused_ignores = true
disallow_untyped_defs = true
[[tool.mypy.overrides]]
module = [
"fastapi_healthchecks.api.router.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -vl --tb=native --junitxml=test-results/junit.xml --html test-results/report.html --self-contained-html --cov --cov-report html --cov-report xml --cov-report term"
markers = [
"integration: mark a test as integration",
"unit: mark a test as a unit test",
"slow: mark a test as being slow",
]
testpaths = ["tests"]
norecursedirs = [
".eggs",
".pytest_cache",
".xprocess",
".git",
"tests/test-data",
"test/test-cases",
".tox",
".toxenv",
".toxenv38",
".toxenv39",
"*site-packages*",
]
asyncio_mode = "auto"
[tool.coverage.run]
source = ["htrc"]
[tool.coverage.xml]
output = "test-results/coverage/cov.xml"
[tool.coverage.html]
directory = "test-results/coverage/cov_html"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about missing debug-only code:
'def __repr__',
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
'raise AssertionError',
'raise NotImplementedError',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
]
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4.0
envlist = py{311}, ruff, mypy, pyflakes
skipsdist = true
requires = poetry==1.7.1
[testenv]
description = run the tests with {basepython}
allowlist_externals =
mkdir
poetry
commands_pre =
commands =
poetry install --no-interaction --no-root --without=lint,docs --sync
mkdir -p test-results
poetry run pytest {posargs} --junit-xml test-results/{envname}/junit.xml --cov-report html:test-results/{envname}/coverage/cov_html --cov-report xml:test-results/{envname}/coverage/cov.xml --html=test-results/{envname}/report.html
[testenv:ruff]
description = perform style checking
commands =
poetry install --no-interaction --no-root --only=lint
poetry run ruff htrc tests
[testenv:mypy]
description = perform type checking
commands =
poetry install --no-interaction --no-root --only=lint
poetry run mypy .
[testenv:pyflakes]
description = perform error checking
commands =
poetry install --no-interaction --no-root --only=lint
poetry run pyflakes htrc tests
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.11
deps = sphinx
sphinx-autodoc-typehints
commands =
poetry install --no-interaction --no-root --only=docs
sphinx-build docs/sphinx/source html-doc --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under html-docs/index.html")'
"""
[tool.black]
line-length = 120
target-version = ['py311']
[tool.ruff]
# Same as Black.
line-length = 120
target-version = 'py311'
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"