Skip to content

Commit ff4bd47

Browse files
jayvdbgaborbernat
authored andcommitted
config: Revert removal of {packages}/{opts} hack
This was removed in e4d0d60, and replaced with a neater approach, however the newer approach doesnt work for replacements from other sections. Fixes #1777
1 parent c1c1c5b commit ff4bd47

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docs/changelog/1777.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix regression that broke using install_command in config replacements - by :user:`jayvdb`

src/tox/config/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,12 @@ def _replace_match(self, match):
18481848
return os.pathsep
18491849

18501850
default_value = g["default_value"]
1851+
# special case: opts and packages. Leave {opts} and
1852+
# {packages} intact, they are replaced manually in
1853+
# _venv.VirtualEnv.run_install_command.
1854+
if sub_value in ("opts", "packages"):
1855+
return "{{{}}}".format(sub_value)
1856+
18511857
if sub_value == "posargs":
18521858
return self.reader.getposargs(default_value)
18531859

0 commit comments

Comments
 (0)