-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
203 lines (157 loc) · 4.96 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name="captura"
packages = [
{include="captura", from="src"},
{include="legere", from="src"},
{include="simulatus", from="src"}
]
include = [
"src/captura/logging.yaml",
"src/simulatus/assets/*.yaml",
]
version = "0.1.10"
description = "A framework for adding sharing and collections to existing API projects."
authors = ["Adrian Cederberg <[email protected]>"]
license = "MIT"
readme = "README.rst"
[tool.poetry.scripts]
captura = "captura.__main__:main"
plugin = "plugin.__main__:main"
legere = "legere.__main__:main"
simulatus = "simulatus.__main__:main"
[tool.poetry.dependencies]
python = "^3.11"
fastapi = "^0.112.0"
pydantic = "^2.8.2"
pydantic-settings = "^2.4.0"
SQLAlchemy = "^2.0.32"
yaml-settings-pydantic = "^2.3.2"
PyMySQL = {extras = ["rsa"], version = "^1.1.1"}
uvicorn = "^0.30.5"
typer = "^0.12.3"
python-multipart = "^0.0.9"
rich = "^13.7.1"
pyjwt = "^2.9.0"
itsdangerous = "^2.2.0"
httpx = "^0.27.0"
types-pyyaml = "^6.0.12.20240808"
jinja2 = "^3.1.4"
[tool.poetry.group.dev.dependencies]
black = "^24.8.0"
flake8 = "^7.1.1"
mypy = "^1.11.1"
isort = "^5.13.2"
autoflake = "^2.3.1"
jedi-language-server = "^0.41.4"
docker = "^7.1.0"
yamllint = "^1.35.1"
pylsp-mypy = "^0.6.8"
python-lsp-server = "^1.11.0"
[tool.poetry.group.ci.dependencies]
build = "^1.2.1"
twine = "^5.1.1"
[tool.poetry.group.plugin.dependencies]
gitpython = "^3.1.43"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
pytest-asyncio = "^0.23.8"
pytest-html = "^4.1.1"
pytest-xdist = "^3.6.1"
faker = "^26.3.0"
[tool.black]
# NOTE: See the documentation for the various configuration fields here:
#
# .. code:: txt
#
# https://pycqa.github.io/isort/docs/configuration/options.html
#
# NOTE: Does not support multiline headings. Is not indempotent.
[tool.isort]
profile = "black"
import_heading_stdlib = "=========================================================================== #"
import_heading_firstparty = "--------------------------------------------------------------------------- #" #\n# Captura\n"
skip = [".venv-local", ".venv"]
src_paths = ["src", "tests"]
[tool.flake8]
# Read the [enumeration of available properties](https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-color).
indent_size = 4
max_line_length = 120
hang_closing = true
color = "always"
filename = "**/*.py"
ignore = [
"E133", # Stupid closing backet requires indentation
]
[tool.autoflake]
in_place = true
remove_all_unused_imports = true
recursive = true
[tool.mypy]
ignore_missing_imports = true
plugins = ["pydantic.mypy"]
exclude = [
"^tests/(.*/)?test_.*.py",
"^tests/junk",
]
# NOTE: See the following reference for this plugin:
#
# .. code::text
#
# https://docs.pydantic.dev/latest/integrations/mypy/#configuring-the-plugin
#
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false
warn_required_dynamic_aliases = true
[tool.bumpver]
current_version = "0.1.10"
version_pattern = "MAJOR.MINOR.PATCH[-TAG]"
commit_message = "chore(version): Bump version {old_version} -> {new_version}"
commit = true
tag = true
push = false
[tool.bumpver.file_patterns]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"src/captura/__init__.py" = ["{version}"]
"docker/compose.yaml" = ["image: acederberg/captura-development:{version}"]
# NOTE: Adding an image tag that is version specific should not be done
# as this must be consistent with the caching config - updating the
# version string in the caching config requires the ``workflow``
# permission for the pipeline, which is overkill imo.
# "docker/compose.ci.yaml" = ["image: acederberg/captura-ci:{version}"]
# ".github/workflows/pr_checks.yaml" = ["tags: acederberg/captura-ci:{version}"]
[tool.setuptools_scm]
# NOTE: Look at this later: https://docs.pytest.org/en/6.2.x/usage.html#dropping-to-pdb-python-debugger-on-failures
[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--ignore tests/junk --ignore-glob ./tests/test_controllers/test_delete.py --ignore ./tests/test_controllers/test_upsert.py --last-failed --last-failed-no-failures all"
count = 10
flakey_ignore = [
"test_not_found_404",
]
flakey_ignore_err = [
"All filtered data is empty.",
]
# NOTE: Reference https://coverage.readthedocs.io/en/latest/config.html#sample-file
[tool.coverage.run]
branch = true
include = ["./src/captura/**/*.py", "./src/legere/**/*.py"]
omit = ["./tests/**/*.py"]
[tool.coverage.report]
fail_under = 75
# format = "html"
include = ["./src/captura/**/*.py", "./src/legere/**/*.py"]
omit = ["./tests/**/*.py"]
skip_covered = true
skip_empty = true
sort = "-cover" # NOTE: Sort from least to greatest coverage.
# NOTE: Can be used to overwrite settings from `tool.coverage.report`.
[tool.coverage.html]
directory = "./src/app/static/cov"
title = "Captura PyTest Coverage Report"
[tool.ruff]
exclude = ["./tests/**/test_*.py"]