-
-
Notifications
You must be signed in to change notification settings - Fork 536
envbindir substitution key not found #246
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
Comments
Original comment by @hpk42 mention of fix issue246: fix regression in config parsing by reordering → <<cset 7e30b4b4591b>> |
Original comment by olliewalsh Fixed in pull request #167 |
Original comment by @The-Compiler I don't really know how to fix this, as I don't fully understand the change in 7f1bcc9. I tried this, but it broke pretty much everything ;) diff -r 6d4378ce9062 tox/config.py
--- a/tox/config.py Mon Jun 15 14:36:26 2015 +0200
+++ b/tox/config.py Mon Jun 15 17:21:55 2015 +0200
@@ -682,6 +682,8 @@
vc = TestenvConfig(config=config, envname=name, factors=factors, reader=reader)
reader.addsubstitutions(**subs)
reader.addsubstitutions(envname=name)
+ reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython,
+ envsitepackagesdir=vc.envsitepackagesdir)
for env_attr in config._testenv_attr:
atype = env_attr.type
@@ -702,9 +704,6 @@
if atype == "path":
reader.addsubstitutions(**{env_attr.name: res})
- if env_attr.name == "install_command":
- reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython,
- envsitepackagesdir=vc.envsitepackagesdir)
return vc
def _getenvdata(self, reader): I also have a test case for this bug, which passes with 1.9.2 and fails with 2.0.x: diff -r 6d4378ce9062 tests/test_config.py
--- a/tests/test_config.py Mon Jun 15 14:36:26 2015 +0200
+++ b/tests/test_config.py Mon Jun 15 17:00:22 2015 +0200
@@ -864,6 +864,18 @@
assert argv[7][0] == config.homedir.join(".tox", "distshare")
assert argv[8][0] == conf.envlogdir
+ def test_substitution_notfound_issue246(tmpdir, newconfig):
+ config = newconfig("""
+ [testenv:py27]
+ setenv =
+ FOO={envbindir}
+ BAR={envsitepackagesdir}
+ """)
+ conf = config.envconfigs['py27']
+ env = conf.setenv
+ assert 'FOO' in env
+ assert 'BAR' in env
+
def test_substitution_positional(self, newconfig):
inisource = """
[testenv:py27] |
Original comment by @The-Compiler This is caused by the changes in 7f1bcc9. I might give fixing this a try later this or next week, but I'm a bit busy right now - so I hope someone else will have the time to look at it :) |
Original comment by @bukzor This prevents me from using tox>=2 whatsoever. |
Original comment by @The-Compiler I can confirm. I currently use |
Original comment by @bukzor {envsitepackagesdir} has the same problem. It's almost certainly the same bug.
|
If tox.ini has {envbindir} you get an exception
tox.ConfigError: ConfigError: substitution key 'envbindir' not found
{envbindir} works with tox<2.0 and it's in the docs:
http://tox.readthedocs.org/en/latest/config.html#substitutions-for-virtualenv-related-sections
The text was updated successfully, but these errors were encountered: