-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
128 lines (108 loc) · 3.42 KB
/
Copy pathpyproject.toml
File metadata and controls
128 lines (108 loc) · 3.42 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
# Rename `integration-template` (PyPI/distribution name, hyphens) and the
# `integration_template/` package directory (import name, underscores) to your own — by
# convention `majordom-<protocol>` / `majordom_<protocol>` (e.g. majordom-homekit /
# majordom_homekit). Keep them matching so poetry-core auto-detects the package, and update
# `pypi-package-name` in the release stub + `--cov=` below to match.
[project]
name = "integration-template"
version = "0.1.0"
description = "A MajorDom integration."
authors = [{ name = "Mark Parker", email = "mark@parker-programs.com" }]
readme = "README.md"
# The template scaffold is Apache-2.0. Relicense your integration as you see fit — note
# that linking a copyleft (GPL/AGPL) protocol library may constrain your choice.
license = "Apache-2.0"
license-files = ["LICENSE"]
keywords = ["majordom", "smart-home", "home-automation", "iot", "integration", "template", "scaffold"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Home Automation",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.12"
dependencies = [
"majordom-integration-sdk (>=0.1.5,<1.0)",
]
[project.urls]
Homepage = "https://majordom.io"
Documentation = "https://docs.majordom.io/device-integration"
Repository = "https://github.com/MajorDom-Systems/integration-template"
[dependency-groups]
dev = [
"poethepoet (>=0.36.0,<1.0.0)",
"ty", # type checker; swap for mypy/pyright by editing the `check` task below
"ruff",
"pip-audit", # dependency vuln scan — gates release (not everyday CI); run locally with `poetry run pip-audit`
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-timeout",
"pytest-repeat",
"pytest-benchmark",
"pytest-profiling",
"pytest-resource-usage",
"coverage",
"pympler", # object memory introspection, leak hunting
"psutil", # process/system resource usage
"faker", # realistic fake data for tests
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
requires-poetry = ">=2.0"
packages = [{ include = "integration_template" }]
[tool.pytest.ini_options]
asyncio_mode = "auto"
pythonpath = ["."]
filterwarnings = ["once"]
[tool.coverage.run]
omit = ["tests/*"]
[tool.ruff]
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"I", # isort
]
fixable = ["ALL"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
docstring-code-format = true
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["E402"]
[tool.poe.tasks.install]
shell = """
poetry install
echo '#!/bin/sh\npoetry run poe check' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "Pre-commit hook installed."
"""
[tool.poe.tasks.check]
shell = """
code=0
echo "\nRunning ruff lint:"
poetry run ruff check --fix || code=1
echo "\nRunning ruff format:"
poetry run ruff format || code=1
echo "\nRunning ty:"
poetry run ty check || code=1
echo "\nRunning pytest:"
poetry run pytest --cov=integration_template --cov-report=xml || code=1
echo "\nRunning poetry build:"
poetry build || code=1
echo "\nRunning poetry check:"
poetry check || code=1
${ci:+git diff --exit-code}
exit $code
"""
args = [{ name = "ci", type = "boolean" }]