Add locust-cloud docs

This commit is contained in:
Amadeu Pereira 2025-04-24 11:04:52 +01:00
parent 3b5763ccf0
commit 36b6640d65
4 changed files with 27 additions and 3 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ locustio.egg-info/**
locust/_version.py
locust/test/mock_*.py
docs/_build/**
docs/locust-cloud/**
docs/cli-help-output.txt
docs/config-options.rst
mock.*.egg

View File

@ -7,11 +7,14 @@
# All configuration values have a default value; values that are commented out
# serve to show the default value.
from locust.argument_parser import get_empty_argument_parser, setup_parser_arguments
from locust.argument_parser import get_parser
import os
import shutil
import subprocess
import locust_cloud
# Add fixes for RTD deprecation
# https://about.readthedocs.com/blog/2024/07/addons-by-default/
@ -36,14 +39,24 @@ def save_locust_help_output():
save_locust_help_output()
def get_locust_cloud_docs():
locust_cloud_docs = os.path.join(locust_cloud.__path__[0], "docs/")
print("Copying `locust-cloud` docs/")
shutil.copytree(
locust_cloud_docs, os.path.join(os.path.abspath(os.path.dirname(__file__)), "locust-cloud/"), dirs_exist_ok=True
)
get_locust_cloud_docs()
# Generate RST table with help/descriptions for all available environment variables
def save_locust_env_variables():
env_options_output_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), "config-options.rst")
print(f"Generating RST table for Locust environment variables and storing in {env_options_output_file}")
parser = get_empty_argument_parser()
setup_parser_arguments(parser)
parser = get_parser()
table_data = []
for action in parser._actions:
if action.env_var and action.help != "==SUPPRESS==":

View File

@ -61,6 +61,15 @@ Locust Documentation
api
.. toctree ::
:caption: Locust Cloud
:maxdepth: 2
:glob:
locust-cloud/*
If you have questions or get stuck, feel free to reach out to us at `support@locust.cloud <mailto:support@locust.cloud>`_.
.. toctree ::

View File

@ -98,6 +98,7 @@ docs = [
"sphinxcontrib-qthelp==1.0.3",
"sphinxcontrib-serializinghtml==1.1.10",
"sphinxcontrib-googleanalytics>=0.4",
"locust-cloud>=1.18.0",
]
[project.scripts]