-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathpyproject.toml
277 lines (233 loc) Β· 7.39 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "locust"
description = "Developer-friendly load testing framework"
license = { text = "MIT" }
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.9"
authors = [{ name = "Jonatan Heyman" }, { name = "Lars Holmberg" }]
maintainers = [
{ name = "Lars Holmberg" },
{ name = "Jonatan Heyman" },
{ name = "Andrew Baldwin" },
]
classifiers = [
"Topic :: Software Development :: Testing :: Traffic Generation",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Traffic Generation",
"Topic :: System :: Distributed Computing",
]
dependencies = [
"gevent>=22.10.2; python_version <= '3.12'",
"gevent>=24.10.1; python_version > '3.13'",
"flask>=2.0.0",
"Werkzeug>=2.0.0",
"requests>=2.26.0; python_version <= '3.11'",
"requests>=2.32.2; python_version > '3.11'",
"msgpack>=1.0.0",
"pyzmq>=25.0.0",
"geventhttpclient>=2.3.1",
"ConfigArgParse>=1.5.5",
"tomli>=1.1.0; python_version < '3.11'",
"typing_extensions>=4.6.0; python_version < '3.11'",
"psutil>=5.9.1",
"Flask-Login>=0.6.3",
"Flask-Cors>=3.0.10",
"pywin32; sys_platform == 'win32'",
"setuptools>=70.0.0",
]
[project.urls]
homepage = "https://locust.io/"
repository = "https://github.com/locustio/locust"
documentation = "https://docs.locust.io/"
[tool.uv]
default-groups = ["build", "test", "lint"]
[dependency-groups]
build = ["hatch>=1.14.0", "hatch-vcs>=0.4.0"]
test = [
"cryptography>=43.0.1,<44.0.0",
"mock>=5.1.0,<6.0.0",
"pyquery>=2.0.0,<3.0.0",
"pytest>=8.3.3,<9.0.0",
"retry>=0.9.2,<1.0.0",
]
lint = [
"pre-commit>=3.7.1,<4.0.0",
"ruff==0.7.3",
"mypy>=1.13.0,<2.0.0",
"types-requests>=2.32.0.20240622,<3.0.0",
]
release = ["twine>=5.1.1,<6.0.0"]
docs = [
"sphinx==7.3.7",
"sphinx-rtd-theme==2.0.0",
"readthedocs-sphinx-search==0.3.2",
"Sphinx-Substitution-Extensions==2020.9.30.0",
"Pygments==2.16.1",
"alabaster==0.7.16",
"babel==2.13.0",
"docutils==0.18.1",
"imagesize==1.4.1",
"snowballstemmer==2.2.0",
"sphinx-prompt==1.5.0",
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-jsmath==1.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.10",
"sphinxcontrib-googleanalytics>=0.4",
]
[project.scripts]
locust = "locust.main:main"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "locust/_version.py"
[tool.hatch.build.targets.sdist]
include = ["locust"]
exclude = ["locust/webui/*", "locust/test", "locust/build"]
artifacts = ["locust/webui/dist"]
[tool.hatch.build.targets.wheel]
include = ["locust"]
artifacts = ["locust/webui/dist"]
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.hatch.build.hooks.custom]
[tool.hatch.build.targets.BuildFrontend.hooks.custom]
[tool.ruff]
target-version = "py39"
line-length = 120
extend-exclude = [
"build",
"examples/issue_*.py",
"src/readthedocs-sphinx-search/",
]
lint.ignore = ["E402", "E501", "E713", "E731", "E741"]
lint.select = ["E", "F", "W", "UP", "FA102", "I001"]
[tool.ruff.lint.per-file-ignores]
"examples/*" = ["F841"]
[tool.ruff.lint.isort]
section-order = [
"future",
"locust",
"standard-library",
"third-party",
"first-party",
"local-folder",
]
# Custom selection-order: to ensure locust is imported as first in locustfiles (for successful gevent monkey patching)
[tool.ruff.lint.isort.sections]
locust = ["locust"]
[tool.mypy]
# missing type stubs
ignore_missing_imports = true
python_version = "3.9"
[tool.pyright]
exclude = ["locust/test"]
reportOptionalMemberAccess = "none"
analyzeUnannotatedFunctions = false
# Hatch environments
# List environments using `hatch env show`
# https://hatch.pypa.io/1.13/tutorials/environment/basic-usage/
## Local Testing
# Default hatch environment, used during local development
# List tests using `hatch test -s`
# https://hatch.pypa.io/1.13/tutorials/testing/overview/
[tool.hatch.envs.hatch-test]
default-args = ["locust/test"]
dependencies = [
"cryptography>=43.0.1,<44.0.0",
"mock>=5.1.0,<6.0.0",
"pyquery>=2.0.0,<3.0.0",
"pytest>=8.3.3,<9.0.0",
"retry>=0.9.2,<1.0.0",
]
[tool.hatch.envs.hatch-test.scripts]
run = [
"pytest{env:HATCH_TEST_ARGS:} {args}",
"bash -ec 'PYTHONUNBUFFERED=1 python3 examples/debugging_advanced.py | grep done'",
]
## CI testing
# Run all combinations: `hatch run test:all`
# Run single env: `hatch run +py=3.10 test:all`
[tool.hatch.envs.test]
template = "hatch-test"
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
## Run all unit tests and advanced debugging
[tool.hatch.envs.test.scripts]
# Disable these tests for now, because they are breaking. When someone has time they should be converted into regular unit tests
# bash -ec "PYTHONUNBUFFERED=1 timeout 20s python3 examples/rest.py >{temp_dir}/out.txt 2>/{temp_dir}/err.txt || true"
# grep -qm 1 'my custom error message with response text, response was {"args"' {temp_dir}/out.txt
# grep -qm 1 'ZeroDivisionError: division by zero at.*Response was {"ar' {temp_dir}/out.txt
# bash -ec '! grep . {temp_dir}/err.txt' # should be empty
all = [
"pytest {args:locust/test}",
"bash -ec 'PYTHONUNBUFFERED=1 python3 examples/debugging_advanced.py | grep done'",
]
# Run main test and bail on first error
fail_fast = "pytest -x {args:locust/test/test_main.py}"
## CI integration testing
## Integration testing of build packages on CI, using a pre-built package
[tool.hatch.envs.integration_test_ci]
template = "test"
skip-install = true
path = ".venv"
[[tool.hatch.envs.integration_test_ci.matrix]]
python = ["3.12"]
## Linting
[tool.hatch.envs.lint]
detached = true
dependencies = [
"ruff==0.7.3",
"mypy>=1.13.0,<2.0.0",
"types-requests>=2.32.0.20240622,<3.0.0",
]
[[tool.hatch.envs.lint.matrix]]
python = ["3.12"]
[tool.hatch.envs.lint.scripts]
all = [""]
types = ["mypy locust/"]
format = ["ruff check .", "ruff format --check"]
## Hatch docs building environment
[tool.hatch.envs.docs]
dependencies = [
"sphinx==7.3.7",
"sphinx-rtd-theme==2.0.0",
"readthedocs-sphinx-search==0.3.2",
"Sphinx-Substitution-Extensions==2020.9.30.0",
"Pygments==2.16.1",
"alabaster==0.7.16",
"babel==2.13.0",
"docutils==0.18.1",
"imagesize==1.4.1",
"snowballstemmer==2.2.0",
"sphinx-prompt==1.5.0",
"sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-jsmath==1.0.1",
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.10",
"sphinxcontrib-googleanalytics>=0.4",
]
[[tool.hatch.envs.docs.matrix]]
python = ["3.12"]
[tool.hatch.envs.docs.scripts]
build = ["sphinx-build -b html docs/ docs/_build/"]