Skip to content
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

Implement pyproject.toml support for Locust configuration #2612

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

alzex3
Copy link
Contributor

@alzex3 alzex3 commented Feb 24, 2024

Issue Addressed:

This PR implements support for TOML files as configuration files and sets pyproject.toml as the default. It addresses the #2298 issue.

Implementation Details:

  1. Used the built-in CompositeConfigParser with TomlConfigParser and DefaultConfigFileParser, which allow the configargparse lib to automatically parse options from defined .conf and .toml files.
  2. Added pyproject.toml to DEFAULT_CONFIG_FILES.
  3. Introduced a new project dependency - toml, which is required for the configargparse TOML parser to work.
  4. Added tests to check the correct parsing of .conf and .toml configuration files.
  5. Reworked the Configuration File documentation section.

locust/argument_parser.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@alzex3
Copy link
Contributor Author

alzex3 commented Feb 26, 2024

@cyberw Hello! I've replaced the toml lib and added a custom parser.

@cyberw
Copy link
Collaborator

cyberw commented Feb 27, 2024

Awesome.

@cyberw cyberw merged commit 40d3e32 into locustio:master Feb 27, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants