-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature locust launcher useful for run/debug on IDEs like PyCharm #1656
Conversation
Borrowed from the virtualenv installed package used for execute locust in the commandline
How about the suggestion in this comment: #613 (comment) ? Doesn't that work? If so, I think the fix should be to just write proper documentation for that. I'm not keen on adding a |
@heyman I have used that way until I needed to start to develop and debug locust itself. It will not use your locust project files, it will be using the installed locust package instead so any modification to locust itself wouldn't be effective to be run without an issue of the command |
What if you install locust using |
I guess that could be an option but for some users but in my case I will prefer to have a way to directly run/debug locust without |
If you don't want to use pip you could use |
It's the same, and don't answer my previous question |
Sorry, I'm not sure I understand your question. Do you know of other python libraries that expose console script entrypoints that does this?
If you use |
Yes, I'm aware that others do this. It's ok. I was asking about why locust doesn't provide the launcher script physically and have the console script entrypoint to call/use it. |
I think we could maybe add an entrypoint file called |
The
That's the main reason to have an script importing locust package at the root level having the locust package imported and available to all the scripts that issue imports like: from .main import main from . import log
from .argument_parser import parse_locustfile_option, parse_options
from .env import Environment
from .log import setup_logging, greenlet_exception_logger
from . import stats
from .stats import print_error_report, print_percentile_stats, print_stats, stats_printer, stats_history
from .stats import StatsCSV, StatsCSVFileWriter
from .user import User
from .user.inspectuser import get_task_ratio_dict, print_task_ratio
from .util.timespan import parse_timespan
from .exception import AuthCredentialsError
from .shape import LoadTestShape
from .input_events import input_listener
from .html import get_html_report |
Add feature locust launcher useful for run/debug on IDEs like PyCharm
Borrowed from the virtualenv installed package used for execute locust in the command-line
This will help to setup locust in an IDE like the following image

Using this script to run locust in the IDE will fix import errors related to the usage of others scripts like
main.py
,__init__.py
and__main__.py
It's only an utility file to easy the develop of locust. An entry in the documentation will be needed if this PR become merged. I could include it as part of this PR.
This PR is related to the issue #613