From 0357586289c4ba66b86791bbd76e8bfcd2d126d5 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Thu, 26 Oct 2023 11:58:13 +0200 Subject: [PATCH 1/2] Revert "Support argcomplete as an optional dependency" This reverts commit bf0aacb7db03e46e2b8782605f327afb9aed1c91. --- locust/argument_parser.py | 10 ---------- pyproject.toml | 3 --- 2 files changed, 13 deletions(-) diff --git a/locust/argument_parser.py b/locust/argument_parser.py index 5fe9ba6373..f6d524a77d 100644 --- a/locust/argument_parser.py +++ b/locust/argument_parser.py @@ -5,14 +5,6 @@ from typing import Dict, List, NamedTuple, Optional, Any import configargparse -try: - from argcomplete import autocomplete -except ImportError: - - def autocomplete(parser): - return None - - import locust version = locust.__version__ @@ -614,7 +606,6 @@ def get_parser(default_config_files=DEFAULT_CONFIG_FILES) -> LocustArgumentParse def parse_options(args=None) -> configargparse.Namespace: parser = get_parser() - autocomplete(parser) parsed_opts = parser.parse_args(args=args) if parsed_opts.stats_history_enabled and (parsed_opts.csv_prefix is None): parser.error("'--csv-full-history' requires '--csv'.") @@ -642,7 +633,6 @@ def ui_extra_args_dict(args=None) -> Dict[str, Dict[str, Any]]: locust_args = default_args_dict() parser = get_parser() - autocomplete(parser) all_args = vars(parser.parse_args(args)) extra_args = { diff --git a/pyproject.toml b/pyproject.toml index 88625abde7..6427931ce3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,9 +42,6 @@ classifiers = [ "Topic :: System :: Distributed Computing", ] -[project.optional-dependencies] -completion = ["argcomplete"] - [project.urls] Homepage = "https://locust.io/" Documentation = "https://docs.locust.io/" From 7d7033e734dc6daa8323adfcd8ab10755bfd7e4c Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Thu, 26 Oct 2023 11:58:18 +0200 Subject: [PATCH 2/2] Revert "document argcomplete system" This reverts commit 4a8bc2950e65f7c112e90789c07a8043324597b7. --- docs/installation.rst | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 00bb2781e0..4bb78a1193 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -21,27 +21,6 @@ Installation 3. Done! Now you can :ref:`create your first test ` -Optional: CLI tab completion ----------------------------- - -Locust uses the argcomplete_ module to provide tab completions for the ``locust`` command line interface. -This is entirely optional; if you don't care about tab completion, you can skip this section entirely! -If you do want to enable tab completion, first install the ``argcomplete`` module -into the same environment where you installed ``locust``: - -.. code-block:: console - - $ pip3 install argcomplete - -Then add this line to your shell config file -(``~/.bashrc`` if you use ``bash``, ``~/.zshrc`` if you use ``zsh``): - -.. code-block:: console - - eval "$(register-python-argcomplete locust)" - -Restart your shell, and you should have working tab completion for the ``locust`` CLI! -If this doesn't work, `check the argcomplete documentation `_. Pre-release builds ------------------ @@ -58,5 +37,3 @@ Install for development ----------------------- If you want to modify Locust, or contribute to the project, see :ref:`developing-locust`. - -.. _argcomplete: https://github.com/kislyuk/argcomplete \ No newline at end of file