Skip to content

Commit

Permalink
config: Revert removal of {packages}/{opts} hack
Browse files Browse the repository at this point in the history
This was removed in e4d0d60, and replaced with a
neater approach, however the newer approach doesnt
work for replacements from other sections.

Fixes #1777
  • Loading branch information
jayvdb authored and gaborbernat committed Jan 12, 2021
1 parent c1c1c5b commit ff4bd47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/1777.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix regression that broke using install_command in config replacements - by :user:`jayvdb`
6 changes: 6 additions & 0 deletions src/tox/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,12 @@ def _replace_match(self, match):
return os.pathsep

default_value = g["default_value"]
# special case: opts and packages. Leave {opts} and
# {packages} intact, they are replaced manually in
# _venv.VirtualEnv.run_install_command.
if sub_value in ("opts", "packages"):
return "{{{}}}".format(sub_value)

if sub_value == "posargs":
return self.reader.getposargs(default_value)

Expand Down

0 comments on commit ff4bd47

Please sign in to comment.