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

Injecting whitelist_externals break tox.ini files using newer allowlist_externals #45

Closed
ssbarnea opened this issue Dec 13, 2021 · 4 comments · Fixed by #47
Closed

Injecting whitelist_externals break tox.ini files using newer allowlist_externals #45

ssbarnea opened this issue Dec 13, 2021 · 4 comments · Fixed by #47
Assignees
Labels
bug Something isn't working

Comments

@ssbarnea
Copy link
Contributor

The line at

config.envconfigs[testenv].whitelist_externals = "*"
effectively breaks any tox.ini file that used the newer allowlist_externals by causing something like:

...
  File "/usr/lib/python3.9/site-packages/tox/venv.py", line 217, in _check_external_allowed_and_warn
    if not self.is_allowed_external(path):
  File "/usr/lib/python3.9/site-packages/tox/venv.py", line 237, in is_allowed_external
    raise tox.exception.ConfigError(
tox.exception.ConfigError: ConfigError: Either whitelist_externals or allowlist_externals might be specified, not both
@hroncok hroncok added the bug Something isn't working label Dec 13, 2021
@hroncok
Copy link
Member

hroncok commented Dec 13, 2021

Thanks for the report. I guess we need to check what value to set -- note that we support tox 3.15 but can migrate to 3.18 and prefer allowlist_externals.

"tox>=3.15",

@hroncok
Copy link
Member

hroncok commented Dec 13, 2021

@ssbarnea Do you wish to attempt to tackle this?

@ssbarnea
Copy link
Contributor Author

I can try, I already had to do something like this for another plugin. In fact we can even neuter the feature and avoid altering the config to avoid it.

@ssbarnea
Copy link
Contributor Author

@hroncok In fact bumping tox version is not enough because newer versions of tox did not remove the support for old whitelist_externals, only added a warning. LOTS of project did not act on these for various reasons.

The only workaround for this is to detect which one is used in current file. Have a look at another plugin where I had to do something similar: https://github.com/tox-dev/tox-ansible/blob/a26989e4144933d323f8bf443326b73bf710c3c6/src/tox_ansible/tox_helper.py#L144

In general I am ok to bump deps to avoid adding extra complexity but that one is more difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants