📝 docs(plugins): document toxfile.py inline plugins#3694
Merged
Conversation
The plugin docs had only auto-generated API references and a single trivial example. Users asking how to provide environments from plugins (issue tox-dev#828) had no practical guidance. Add an "Inline plugins via toxfile.py" section with three examples: adding a CLI flag, appending version info, and dynamically providing environments using tox_extend_envs with MemoryLoader. The last one addresses the original feature request for reusable env definitions like shared linting configs. Also fix RST heading levels in the Migration section that became inconsistent with the new sub-heading style. Closes tox-dev#828
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plugin documentation had only auto-generated API references and a single trivial example showing
tox_append_version_info. Users wanting to provide environments from plugins (#828) had no practical guidance on how to usetoxfile.pywithtox_extend_envsandMemoryLoader.This adds an "Inline plugins via
toxfile.py" section with three progressively complex examples: adding a CLI flag viatox_add_option, appending version info, and dynamically providing environments usingtox_extend_envspaired withMemoryLoader. 📝 The last example shows the exact use case from #828 -- a shared lint environment backed by pre-commit that doesn't require anytox.inientry.All examples are fully type-annotated and the RST heading levels in the Migration section were adjusted to stay consistent with the new sub-heading structure.
Closes #828