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

This plugin relies on a private API #3

Closed
masenf opened this issue Jan 15, 2023 · 0 comments · Fixed by #4
Closed

This plugin relies on a private API #3

masenf opened this issue Jan 15, 2023 · 0 comments · Fixed by #4

Comments

@masenf
Copy link
Owner

masenf commented Jan 15, 2023

Currently the plugin is sneaking around the public API, tox.tox_env.info.Info.compare

and directly munging a known key inside of _content.

The better course of action is to wrap compare directly and filter out the name tuple if/when it pops in.

ToxEnv.cache and Info.compare appear to be public APIs accessible to the registered runner class.

masenf added a commit that referenced this issue Jan 15, 2023
issue #3

TODO: mypy
masenf added a commit that referenced this issue Jan 15, 2023
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
@masenf masenf mentioned this issue Jan 15, 2023
@masenf masenf closed this as completed in #4 Jan 15, 2023
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 a pull request may close this issue.

1 participant