Skip to content

Commit

Permalink
Merge pull request #2434 from locustio/revert-Support-argcomplete-as-…
Browse files Browse the repository at this point in the history
…an-optional-dependency

Revert support for argcomplete
  • Loading branch information
cyberw authored Oct 26, 2023
2 parents 75594db + 7d7033e commit 6cbbf22
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
23 changes: 0 additions & 23 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,6 @@ Installation
3. Done! Now you can :ref:`create your first test <quickstart>`

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 <https://kislyuk.github.io/argcomplete/>`_.

Pre-release builds
------------------
Expand All @@ -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
10 changes: 0 additions & 10 deletions locust/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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'.")
Expand Down Expand Up @@ -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 = {
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit 6cbbf22

Please sign in to comment.