diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..49cbebf --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Ankit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index de25609..2c09dad 100644 --- a/README.md +++ b/README.md @@ -13,30 +13,73 @@ Compare performance results between two Locust runs and show changes relative to - Python 3.8+ (no third-party dependencies). -## Quick Start +## Installation -- Compare two run directories (each containing a `report.csv` and HTML files): +### With uvx (recommended) + +Run directly from GitHub without cloning: + +```bash +uvx --from git+https://github.com/dev-ankit/locust-compare.git locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 +``` + +Or from a local directory: + +```bash +uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 +``` + +Or from a cloned repository: + +```bash +git clone https://github.com/dev-ankit/locust-compare.git +cd locust-compare +uvx --from . locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 +``` + +Once published to PyPI, you can run without any prefix: + +```bash +uvx locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 +``` + +### With pip +```bash +pip install . +locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 ``` + +### Direct execution + +```bash python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 ``` -- Compare two specific CSV files: +## Quick Start +- Compare two run directories (each containing a `report.csv` and HTML files): + +```bash +locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 ``` -python3 compare_runs.py test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv + +- Compare two specific CSV files: + +```bash +locust-compare test_runs/HTML-Report-292/report.csv test_runs/HTML-Report-294/report.csv ``` - JSON output for scripting: -``` -python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json +```bash +locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --json ``` - Colorize output and show verdicts (green=better, red=worse): -``` -python3 compare_runs.py test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color +```bash +locust-compare test_runs/HTML-Report-292 test_runs/HTML-Report-294 --color ``` Exit code is `0` on success and `1` on error. diff --git a/pyproject.toml b/pyproject.toml index 9c7a3bc..5431346 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,31 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "locust-compare" version = "0.1.0" description = "Compare Locust performance metrics between runs" +readme = "README.md" requires-python = ">=3.8" +license = {file = "LICENSE"} +authors = [ + {name = "Ankit", email = "dev@ankit.dev"}, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +[project.scripts] +locust-compare = "compare_runs:main" [project.optional-dependencies] dev = [ @@ -25,3 +48,6 @@ exclude_lines = [ "pragma: no cover", "if __name__ == .__main__.:", ] + +[tool.hatch.build.targets.wheel] +only-include = ["compare_runs.py"]