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

Use Public API #4

Merged
merged 6 commits into from
Jan 15, 2023
Merged

Use Public API #4

merged 6 commits into from
Jan 15, 2023

Conversation

masenf
Copy link
Owner

@masenf masenf commented Jan 15, 2023

[BREAKING] Override public API to filter cached name key

Rewrite the plugin to avoid private APIs:

  • Remove custom testenv conf key: ignore_env_name_mismatch and ignore_envname_mismatch
  • Use existing conf key runner to opt-in to ignore_env_name_mismatch behavior
  • Return a subclass of Info that filters out the "name" key from ToxEnv.__name__ section
    • When this plugin is active, the ToxEnv cached info will NOT contain a "name" key at all, so there will be no name key to conflict, thus nothing needs to be overridden in the private _content dictionary.

All tests are rewritten and vastly simplified, as there are fewer branch points in the new implementation.

fix #3

Rewrite the plugin to avoid private APIs:

  * Remove custom testenv conf key: ignore_env_name_mismatch and
    ignore_envname_mismatch
  * Use existing conf key `runner` to opt-in to ignore_env_name_mismatch
    behavior
  * Return a subclass of `Info` that filters out the "name" key from
    `ToxEnv.__name__` section
    * When this plugin is active, the ToxEnv cached info will NOT contain a
      "name" key at all, so there will be no name key to conflict, thus nothing
      needs to be overridden in the private `_content` dictionary.

All tests are rewritten and vastly simplified, as there are fewer branch points
in the new implementation.

fix #3
Update copyright year to 2023
Add links to tox documentation

Add section about vendoring the plugin
Since FilteredInfo can accept generic filter_keys and filter_section, add test
cases to ensure the less common default branches are covered, even though the
plugins don't directly use them (yet)
@masenf
Copy link
Owner Author

masenf commented Jan 15, 2023

Just a heads up to my early adopters @broken-wheel and @ssbarnea that this is a breaking change in how the plugin gets activated.

Thankfully I'm able to make this change early in the plugin development and hopefully will not need additional breaking changes down the road.

@masenf masenf merged commit 683e4d9 into main Jan 15, 2023
@masenf masenf deleted the public-api branch January 15, 2023 20:22
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.

This plugin relies on a private API
1 participant