@@ -9,13 +9,13 @@ name = "pytest-mqtt"
9
9
version = " 0.4.2"
10
10
description = " pytest-mqtt supports testing systems based on MQTT"
11
11
readme = " README.rst"
12
- requires-python = " >=3.7"
13
- license = {text = " MIT" }
14
- keywords = [" mqtt" , " pytest" , " testing" , " mosquitto" , " paho" ]
12
+ keywords = [ " mosquitto" , " mqtt" , " paho" , " pytest" , " testing" ]
13
+ license = { text = " MIT" }
15
14
authors = [
16
- {name = " Andreas Motl" , email = " andreas.motl@panodata.org" },
17
- {name = " Richard Pobering" , email = " richard.pobering@panodata.org" },
15
+ { name = " Andreas Motl" , email = " andreas.motl@panodata.org" },
16
+ { name = " Richard Pobering" , email = " richard.pobering@panodata.org" },
18
17
]
18
+ requires-python = " >=3.7"
19
19
classifiers = [
20
20
" Development Status :: 5 - Production/Stable" ,
21
21
" Environment :: Console" ,
@@ -33,6 +33,7 @@ classifiers = [
33
33
" Operating System :: POSIX :: Linux" ,
34
34
" Operating System :: Unix" ,
35
35
" Programming Language :: Python" ,
36
+ " Programming Language :: Python :: 3 :: Only" ,
36
37
" Programming Language :: Python :: 3.7" ,
37
38
" Programming Language :: Python :: 3.8" ,
38
39
" Programming Language :: Python :: 3.9" ,
@@ -61,79 +62,79 @@ dependencies = [
61
62
" pytest-docker-fixtures<2" ,
62
63
]
63
64
64
- [project .entry-points .pytest11 ]
65
- capmqtt = " pytest_mqtt.capmqtt"
66
- mosquitto = " pytest_mqtt.mosquitto"
67
-
68
- [project .optional-dependencies ]
69
- test = [
70
- " coverage<8" ,
71
- " pytest<9" ,
72
- " pytest-fixture-order<1" ,
73
- " pytest-ordering<1" ,
74
- ]
75
- develop = [
76
- " isort<6" ,
77
- " black<25" ,
65
+ optional-dependencies.develop = [
66
+ " mypy<1.12" ,
78
67
" poethepoet<1" ,
68
+ " pyproject-fmt<3" ,
79
69
" ruff<0.9" ,
70
+ " validate-pyproject<0.19" ,
80
71
]
81
- release = [
72
+ optional-dependencies. release = [
82
73
" build<2" ,
83
74
" twine<7" ,
84
75
]
76
+ optional-dependencies.test = [
77
+ " coverage<8" ,
78
+ " pytest<9" ,
79
+ " pytest-fixture-order<1" ,
80
+ " pytest-ordering<1" ,
81
+ ]
82
+ urls.changelog = " https://github.com/mqtt-tools/pytest-mqtt/blob/main/CHANGES.rst"
83
+ urls.documentation = " https://github.com/mqtt-tools/pytest-mqtt"
84
+ urls.homepage = " https://github.com/mqtt-tools/pytest-mqtt"
85
+ urls.repository = " https://github.com/mqtt-tools/pytest-mqtt"
86
+ entry-points.pytest11.capmqtt = " pytest_mqtt.capmqtt"
87
+ entry-points.pytest11.mosquitto = " pytest_mqtt.mosquitto"
85
88
86
89
[tool .setuptools ]
87
90
# https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
88
- packages = [" pytest_mqtt" ]
89
-
90
- [project .urls ]
91
- homepage = " https://github.com/mqtt-tools/pytest-mqtt"
92
- documentation = " https://github.com/mqtt-tools/pytest-mqtt"
93
- repository = " https://github.com/mqtt-tools/pytest-mqtt"
94
- changelog = " https://github.com/mqtt-tools/pytest-mqtt/blob/main/CHANGES.rst"
95
-
91
+ packages = [ " pytest_mqtt" ]
96
92
97
93
# ==================
98
94
# Tool configuration
99
95
# ==================
96
+ # Configuration snippets for pytest, coverage, and ruff.
100
97
101
- # Configuration snippets for Black, isort, pytest, coverage, and ruff.
102
-
103
- [tool .black ]
98
+ [tool .ruff ]
104
99
line-length = 120
105
100
106
- [tool .isort ]
107
- profile = " black"
108
- skip_glob = " **/site-packages/**"
109
- skip_gitignore = false
110
- # src_paths = ["pytest_mqtt", "testing"]
111
-
112
101
[tool .pytest .ini_options ]
113
102
minversion = " 2.0"
114
103
addopts = """
115
104
-rfEX -p pytester --strict-markers --verbosity=3
116
105
"""
117
106
log_level = " DEBUG"
118
107
log_cli_level = " DEBUG"
119
- testpaths = [" testing" ]
108
+ testpaths = [ " testing" ]
120
109
xfail_strict = true
121
110
markers = [
122
111
" capmqtt_decode_utf8: Capture MQTT messages as `str`, not `bytes`" ,
123
112
]
124
113
125
114
[tool .coverage .run ]
126
115
branch = false
127
- source = [" pytest_mqtt" ]
116
+ source = [ " pytest_mqtt" ]
128
117
129
118
[tool .coverage .report ]
130
119
fail_under = 0
131
120
show_missing = true
132
121
omit = [
133
122
]
134
123
135
- [tool .ruff ]
136
- line-length = 120
124
+ [tool .mypy ]
125
+ packages = [ " pytest_mqtt" ]
126
+ exclude = [
127
+ ]
128
+ ignore_missing_imports = true
129
+ check_untyped_defs = false
130
+ implicit_optional = true
131
+ install_types = true
132
+ no_implicit_optional = true
133
+ non_interactive = true
134
+ show_error_codes = true
135
+ strict_equality = true
136
+ warn_unused_ignores = true
137
+ warn_redundant_casts = true
137
138
138
139
139
140
# ===================
@@ -148,25 +149,30 @@ check = [
148
149
]
149
150
150
151
format = [
151
- {cmd =" black ." },
152
- {cmd =" isort pytest_mqtt testing" },
152
+ { cmd = " ruff format ." },
153
+ # Configure Ruff not to auto-fix (remove!):
154
+ # unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001).
155
+ { cmd = " ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." },
156
+ { cmd = " pyproject-fmt --keep-full-version pyproject.toml" },
153
157
]
158
+
154
159
lint = [
155
- {cmd =" ruff check ." },
156
- {cmd =" black --check ." },
157
- {cmd =" isort --check pytest_mqtt testing" },
160
+ { cmd = " ruff format --check ." },
161
+ { cmd = " ruff check ." },
162
+ { cmd = " validate-pyproject pyproject.toml" },
163
+ { cmd = " mypy" },
158
164
]
159
165
160
166
# When testing a pytest plugin, `coverage` needs to be
161
167
# started before `pytest`. `pytest-cov` will not work.
162
168
# https://stackoverflow.com/a/62224494
163
169
test = [
164
- {cmd = " coverage run -m pytest" },
165
- {cmd = " coverage report" },
166
- {cmd = " coverage xml" },
170
+ { cmd = " coverage run -m pytest" },
171
+ { cmd = " coverage report" },
172
+ { cmd = " coverage xml" },
167
173
]
168
174
169
175
release = [
170
- {cmd = " python -m build" },
171
- {cmd = " twine upload --skip-existing dist/*.tar.gz dist/*.whl" },
176
+ { cmd = " python -m build" },
177
+ { cmd = " twine upload --skip-existing dist/*.tar.gz dist/*.whl" },
172
178
]
0 commit comments