-
-
Notifications
You must be signed in to change notification settings - Fork 550
Closed
Description
Issue
In my work in #3088, I got appending working, but didn't correctly handle the case where there is no existing configuration parameter to append to.
It wasn't obvious that a KeyError gets raised early in load() in this case, and bypasses my appending logic.
This breaks my entire use-case for #3087. Whoops!
Minimal example
$ cat > setup.cfg <<EOL
[metadata]
name = foo
[options]
py_modules = foo
EOL
$ cat > tox.ini <<EOL
[tox]
[testenv]
install_command = python -c 'import os; assert "foo" in os.environ'
EOL
$ tox -e py311 -x testenv.setenv=foo=bar
...
py311: OK (0.48 seconds)
congratulations :) (0.60 seconds)
$ tox -e py311 -x testenv.setenv+=foo=bar
...
py311: install_package> python -c 'import os; assert "foo" in os.environ' --force-reinstall --no-deps /tmp/toxhax/.tox/.tmp/package/3/foo-0.0.0.tar.gz
Traceback (most recent call last):
File "<string>", line 1, in <module>
AssertionError
...
$ cat >> tox.ini << EOL
> setenv =
> bar=baz
> EOL
$ tox -e py311 -x testenv.setenv+=foo=bar
...
py311: OK (0.45 seconds)
congratulations :) (0.57 seconds)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels