-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
172 lines (155 loc) · 4.44 KB
/
pyproject.toml
File metadata and controls
172 lines (155 loc) · 4.44 KB
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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "tmt-web"
dynamic = ["version"]
description = 'Web app for checking tmt tests, plans and stories'
readme = "README.md"
requires-python = ">=3.12"
license = "MIT"
keywords = []
authors = [
{ name = "Petr Splichal", email = "[email protected]" },
{ name = "Tomas Koscielniak", email = "[email protected]" }
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Framework :: FastAPI",
"Topic :: Software Development :: Testing",
"Operating System :: POSIX :: Linux",
]
dependencies = [
"tmt~=1.36",
"fastapi~=0.115",
"httpx~=0.27",
"uvicorn~=0.30",
"valkey",
]
[project.urls]
Source = "https://github.com/teemtee/web"
[tool.hatch.version]
source = "vcs"
raw-options.version_scheme = "release-branch-semver"
[tool.hatch.build.targets.wheel]
packages = ["src/tmt_web"]
[tool.hatch.build.targets.wheel.shared-data]
"src/tmt_web/py.typed" = "tmt_web/py.typed"
[tool.hatch.envs.default]
extra-dependencies = [
"pre-commit",
"hatch",
]
post-install-commands = [
"pre-commit install",
]
[tool.hatch.envs.dev]
extra-dependencies = [
"ruff",
"mypy",
"podman-compose",
"pytest",
"pytest-cov",
"pytest-mock",
]
[tool.hatch.envs.dev.scripts]
test = "podman-compose down && podman-compose up -d --build && pytest"
start = "podman-compose up -d --build"
stop = "podman-compose down"
coverage = "pytest --cov=tmt_web --cov-report=term-missing:skip-covered"
retest = "pytest --last-failed" # Without rebuilding the image
check = "mypy --install-types --non-interactive src/tmt_web"
[tool.ruff]
# Based on teemtee/tmt/pyproject.toml
line-length = 100
target-version = "py312"
lint.select = [
"F", # pyflakes
"E", # pycodestyle error
"W", # pycodestyle warning
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
"ASYNC", # flake8-async
"S", # flake8-bandit
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"G", # flake8-logging-format
"PIE", # flake8-pie
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q003", # avoidable-escaped-quote
"Q004", # unnecessary-escaped-quote
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"INT", # flake8-gettext
"PTH", # flake8-use-pathlib
"PGH", # pygrep-hooks
"PLC", # pylint-convention
"PLE", # pylint-error
"PLR", # pylint-refactor
"FLY", # flynt
"FAST", # FastAPI (in preview)
"PERF", # Perflint
"RUF", # ruff
]
lint.ignore = [
"PLR0913", # Too many arguments
"G004", # Logging statement uses f-string
"D1", # Missing docstring
"D401", # First line should be in imperative mood
# ruff format conflicts
"COM812",
"ISC001",
]
[tool.ruff.lint.per-file-ignores]
# Less strict security checks in tests
"tests/*" = [
"S101", # Assert usage
"PLR", # Pylint refactor
"E501", # Line length
]
"src/tmt_web/generators/html_generator.py" = [
"E501", # Line length
]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.pylint]
max-returns = 8
[tool.mypy]
plugins = [
"pydantic.mypy"
]
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
python_version = "3.12"
files = ["src/"]
[tool.pytest.ini_options]
# Filter out specific warnings
filterwarnings = [
# Ignore pytest collection warnings for model classes that start with 'Test'
"ignore:cannot collect test class 'TestData' because it has a __init__ constructor:pytest.PytestCollectionWarning",
"ignore:cannot collect test class 'TestPlanData' because it has a __init__ constructor:pytest.PytestCollectionWarning",
# Ignore pint and docutils deprecations from tmt
"ignore:The frontend.OptionParser class will be replaced:DeprecationWarning",
"ignore:The frontend.Option class will be removed:DeprecationWarning",
"ignore:This function will be removed in future versions of pint.:DeprecationWarning"
]