diff --git a/locust_swarm/swarm.py b/locust_swarm/swarm.py index 534b0cc..a99e24b 100644 --- a/locust_swarm/swarm.py +++ b/locust_swarm/swarm.py @@ -41,7 +41,7 @@ Example: swarm -f test.py --loadgen-list loadgen1.domain.com,loadgen2.domain.com --users 50""", epilog="""Any parameters not listed here are forwarded to locust master unmodified, so go ahead and use things like --users, --host, --run-time, ... - + Swarm config can also be set using config file (~/.locust.conf, locust.conf, ~/.swarm.conf or swarm.conf). Parameters specified on command line override env vars, which in turn override config files.""", add_config_file_help=False, @@ -318,7 +318,7 @@ def start_worker_process(server, port): "-R", f"{port}:localhost:{port}", "-R", - f"{port+1}:localhost:{port+1}", + f"{port + 1}:localhost:{port + 1}", ] ensure_remote_kill = ["& read; kill -9 $!"] nohup = [] @@ -336,31 +336,29 @@ def start_worker_process(server, port): if args.test_env: extra_env.append("LOCUST_TEST_ENV=" + args.test_env) - cmd = " ".join( - [ - "ssh", - "-q", - *port_forwarding_parameters, - server, - "'", - *extra_env, - *nohup, - "locust", - "--worker", - "--processes", - str(args.processes), - "--master-port", - str(port), - *master_parameters, - "--headless", - "--expect-workers-max-wait", - "30", - "-f", - "-", - *ensure_remote_kill, - "'", - ] - ) + cmd = " ".join([ + "ssh", + "-q", + *port_forwarding_parameters, + server, + "'", + *extra_env, + *nohup, + "locust", + "--worker", + "--processes", + str(args.processes), + "--master-port", + str(port), + *master_parameters, + "--headless", + "--expect-workers-max-wait", + "30", + "-f", + "-", + *ensure_remote_kill, + "'", + ]) logging.info("workers started " + cmd) procs.append( diff --git a/pyproject.toml b/pyproject.toml index d055351..27ec108 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,8 @@ [tool.ruff] line-length = 120 -select = ["E", "F", "W", "UP", "FA102", "I001"] -extend-select = [ +lint.select = ["E", "F", "W", "UP", "FA102", "I"] +lint.extend-select = [ "D419", # empty-docstring - # "E501", # line-too-long "W291", # trailing-whitespace "PLC0414", # useless-import-alias "PLC2401", # non-ascii-name @@ -20,13 +19,13 @@ extend-select = [ "PLE0605", # invalid-all-format "PLE0704", # misplaced-bare-raise ] - -ignore = [ +lint.ignore = [ "PLR0912", # too-many-branches "PLR0913", # too-many-arguments "PLR0914", # too-many-locals "PLR0915", # too-many-statements "PLW0603", # global-statement + "E501", # line-too-long ] [tool.mypy] diff --git a/setup.py b/setup.py index fc18752..a5c1910 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- import os import sys + from setuptools import find_packages, setup -from setuptools.command.install import install -from setuptools.command.egg_info import egg_info from setuptools.command.develop import develop +from setuptools.command.egg_info import egg_info +from setuptools.command.install import install def install_check(self, command): diff --git a/tox.ini b/tox.ini index 9f60cd7..898e258 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{38,39,310,311,312} [testenv] deps = - ruff + ruff==0.2.2 mypy==1.8.0 commands = ruff check --preview