Skip to content

Commit 6fb17a1

Browse files
authored
Merge pull request #1 from dev-ankit/copilot/convert-compare-runs-to-uvx-tool
2 parents a47bc5a + 8a60315 commit 6fb17a1

3 files changed

Lines changed: 98 additions & 8 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Ankit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,73 @@ Compare performance results between two Locust runs and show changes relative to
1313

1414
- Python 3.8+ (no third-party dependencies).
1515

16-
## Quick Start
16+
## Installation
1717

18-
- Compare two run directories (each containing a `report.csv` and HTML files):
18+
### With uvx (recommended)
19+
20+
Run directly from GitHub without cloning:
21+
22+
```bash
23+
uvx --from git+https://github.com/dev-ankit/locust-compare.git locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
24+
```
25+
26+
Or from a local directory:
27+
28+
```bash
29+
uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
30+
```
31+
32+
Or from a cloned repository:
33+
34+
```bash
35+
git clone https://github.com/dev-ankit/locust-compare.git
36+
cd locust-compare
37+
uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
38+
```
39+
40+
Once published to PyPI, you can run without any prefix:
41+
42+
```bash
43+
uvx locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
44+
```
45+
46+
### With pip
1947

48+
```bash
49+
pip install .
50+
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
2051
```
52+
53+
### Direct execution
54+
55+
```bash
2156
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294
2257
```
2358

24-
- Compare two specific CSV files:
59+
## Quick Start
2560

61+
- Compare two run directories (each containing a `report.csv` and HTML files):
62+
63+
```bash
64+
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294
2665
```
27-
python3 compare_runs.py test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv
66+
67+
- Compare two specific CSV files:
68+
69+
```bash
70+
locust-compare test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv
2871
```
2972

3073
- JSON output for scripting:
3174

32-
```
33-
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json
75+
```bash
76+
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json
3477
```
3578

3679
- Colorize output and show verdicts (green=better, red=worse):
3780

38-
```
39-
python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color
81+
```bash
82+
locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color
4083
```
4184

4285
Exit code is `0` on success and `1` on error.

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
15
[project]
26
name = "locust-compare"
37
version = "0.1.0"
48
description = "Compare Locust performance metrics between runs"
9+
readme = "README.md"
510
requires-python = ">=3.8"
11+
license = {file = "LICENSE"}
12+
authors = [
13+
{name = "Ankit", email = "dev@ankit.dev"},
14+
]
15+
classifiers = [
16+
"Development Status :: 4 - Beta",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: MIT License",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
25+
]
26+
27+
[project.scripts]
28+
locust-compare = "compare_runs:main"
629

730
[project.optional-dependencies]
831
dev = [
@@ -25,3 +48,6 @@ exclude_lines = [
2548
"pragma: no cover",
2649
"if __name__ == .__main__.:",
2750
]
51+
52+
[tool.hatch.build.targets.wheel]
53+
only-include = ["compare_runs.py"]

0 commit comments

Comments
 (0)