-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
217 lines (200 loc) · 5.89 KB
/
pyproject.toml
File metadata and controls
217 lines (200 loc) · 5.89 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
[project]
name = "conson-xp"
dynamic = ["version"]
description = "XP Protocol Communication Tools"
authors = [
{name = "ldvchosal", email = "ldvchosal@github.com"},
]
dependencies = [
"click>=8.3",
"click-help-colors>=0.9",
"pyyaml>=6.0",
"structlog>=22.0",
"fastapi>=0.118",
"uvicorn>=0.37",
"pydantic>=2.11",
"HAP-python[QRCode]>=5.0.0",
"punq>=0.7.0",
"twisted>=25.5.0",
"psygnal>=0.15.0",
"textual>=1.0.0",
"python-statemachine>=2.5.0",
]
requires-python = ">=3.11"
readme = "README.md"
license = {file = "LICENSE"}
[project.urls]
"Homepage" = "https://github.com/lduchosal/xp"
"Bug Reports" = "https://github.com/lduchosal/xp/issues"
"Source" = "https://github.com/lduchosal/xp"
[project.scripts]
xp = "xp.cli:cli"
[dependency-groups]
dev = [
"pdm>=2.26.0",
"pdm-bump>=0.9.0",
"pytest>=8.4",
"pytest-cov>=7.0",
"black>=25.9",
"flake8>=7.3",
"flake8-docstrings>=1.7.0",
"flake8-docstrings-complete>=1.3.0",
"interrogate>=1.7.0",
"mypy>=1.18,<1.20",
"ruff>=0.13.0",
"vulture>=2.14",
"httpx>=0.24.0",
"twine>=6.2.0",
"types-PyYAML",
"refurb>=2.2.0",
"pdm-backend>=2.4.5",
"isort>=6.0.1",
"absolufy-imports>=0.3.1",
"pytest-asyncio>=1.2.0",
"types-docutils>=0.22.2.20251006",
"docformatter>=1.7.7",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"reverseproxy: marks tests as unit tests",
"asyncio: marks tests as asyncio tests",
]
filterwarnings = [
"ignore::DeprecationWarning:click_help_colors.*",
]
[tool.coverage.run]
source = ["src/xp"]
omit = ["tests/*", "src/xp/__main__.py"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.black]
line-length = 88
target-version = ['py39']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
ignore_missing_imports = true
disable_error_code = ["method-assign"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
warn_unreachable = false
[tool.isort]
profile = "black"
src_paths = ["src", "tests"]
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.pdm]
distribution = true
version = {source = "file", path = "src/xp/__init__.py"}
[tool.pdm.scripts]
test = "env PYTHONPATH=src python -m pytest tests/ -v --cov=src/xp --cov-report=term-missing"
test-quick = "env PYTHONPATH=src python -m pytest tests/ --tb=short -qq"
test-ci = "env PYTHONPATH=src python -m pytest tests/ -v --cov=src/xp --cov-branch --cov-report=xml -m 'not reverseproxy'"
test-unit = "env PYTHONPATH=src python -m pytest tests/unit/ -v"
test-integration = "env PYTHONPATH=src python -m pytest tests/integration/ -v"
test-cov = "env PYTHONPATH=src python -m pytest tests/ --quiet --cov=src/xp --cov-report=html --cov-report=term-missing --cov-fail-under=75"
lint = "ruff check --fix src/ tests/"
format = "black src/ tests/"
typecheck = "mypy src/ tests/"
flake8 = "flake8 src/ tests/"
interrogate = "interrogate -vv src/"
vulture = "vulture src/ tests/"
refurb = "refurb src/ tests/"
isort = "isort src/ tests/"
docformatter = "docformatter src/ tests/"
absolufy = {shell = "find src tests -name '*.py' -type f -exec absolufy-imports --application-directories=src:tests {} +"}
update-readme = {shell = "xp help > /tmp/xp-help.txt && if [ \"$(uname)\" = \"Darwin\" ]; then sed -i '' -e '/<!-- BEGIN CLI HELP -->/,/<!-- END CLI HELP -->/{//!d;}' -e '/<!-- BEGIN CLI HELP -->/r /tmp/xp-help.txt' README.md; else sed -i -e '/<!-- BEGIN CLI HELP -->/,/<!-- END CLI HELP -->/{//!d;}' -e '/<!-- BEGIN CLI HELP -->/r /tmp/xp-help.txt' README.md; fi && rm /tmp/xp-help.txt"}
check = {composite = ["clean", "lint", "format", "docformatter", "typecheck", "flake8", "interrogate", "vulture", "refurb", "isort", "absolufy", "test-quick", "test-cov", "update-readme"] }
bump-version = "pdm bump -v minor"
env = "echo ${PATH}"
install = "pdm install"
install-dev = "pdm install -G dev"
clean = {shell = "rm -rf .coverage coverage.xml htmlcov/ .pytest_cache/ log/conbus.log.* log log.* && find . -type d -name '__pycache__' -exec rm -rf {} +"}
version-show = "python -c 'import xp; print(xp.__version__)'"
version-patch = "pdm bump patch"
version-minor = "pdm bump minor"
version-major = "pdm bump major"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.vulture]
exclude = ["src/xp/cli"]
ignore_decorators = ["@click"]
make_whitelist = true
min_confidence = 80
paths = ["src", "tests"]
sort_by_size = true
verbose = false
[tool.pdm-bump]
version-files = [
"src/xp/__init__.py:__version__",
]
[tool.interrogate]
ignore-init-method = true
ignore-init-module = false
fail-under = 95
exclude = ["tests", "docs", "build", "dist"]
verbose = 1
quiet = false
whitelist-regex = []
color = true
generate-badge = "."
badge-format = "svg"
[tool.docformatter]
recursive = true
wrap-summaries = 88
wrap-descriptions = 88
close-quotes-on-newline = true
pre-summary-newline = true
in-place = true