From issues-reply at bitbucket.org Thu Oct 8 15:31:45 2015 From: issues-reply at bitbucket.org (Brecht Machiels) Date: Thu, 08 Oct 2015 13:31:45 -0000 Subject: [Pytest-commit] Issue #275: Allow running commands before and after running tests in all environments (hpk42/tox) Message-ID: <20151008133145.25985.13696@app02.ash-private.bitbucket.org> New issue 275: Allow running commands before and after running tests in all environments https://bitbucket.org/hpk42/tox/issues/275/allow-running-commands-before-and-after Brecht Machiels: This could be useful to combine the coverage data for projects with a unified Python 2/3 codebase. In this case coverage can never be 100% due to Python 2/3-specific code paths, so it makes sense to combine them. From issues-reply at bitbucket.org Fri Oct 9 20:37:24 2015 From: issues-reply at bitbucket.org (=?utf-8?q?Thomas_G=C3=BCttler?=) Date: Fri, 09 Oct 2015 18:37:24 -0000 Subject: [Pytest-commit] Issue #276: remove easy_install (hpk42/tox) Message-ID: <20151009183724.12268.63446@app09.ash-private.bitbucket.org> New issue 276: remove easy_install https://bitbucket.org/hpk42/tox/issues/276/remove-easy_install Thomas G?ttler: AFAIK easy_install is deprecated. It confuses new users. Please remove it from this page: http://tox.readthedocs.org/en/latest/install.html From issues-reply at bitbucket.org Fri Oct 9 20:41:47 2015 From: issues-reply at bitbucket.org (=?utf-8?q?Thomas_G=C3=BCttler?=) Date: Fri, 09 Oct 2015 18:41:47 -0000 Subject: [Pytest-commit] Issue #277: Preferred default directory layout (hpk42/tox) Message-ID: <20151009184147.14980.86865@app09.ash-private.bitbucket.org> New issue 277: Preferred default directory layout https://bitbucket.org/hpk42/tox/issues/277/preferred-default-directory-layout Thomas G?ttler: What is the preferred default directory layout for projects using tox? I could not find a hint on the following page and pages before this page: http://tox.readthedocs.org/en/latest/example/basic.html Inside the module or outside? Related discussion on distutils list: https://mail.python.org/pipermail/distutils-sig/2015-October/027003.html Next step: Please update the basic example an tell new users your preferred directory structure. Thank you. From issues-reply at bitbucket.org Wed Oct 14 00:34:47 2015 From: issues-reply at bitbucket.org (=?utf-8?q?Se=C3=A1n_Hayes?=) Date: Tue, 13 Oct 2015 22:34:47 -0000 Subject: [Pytest-commit] Issue #278: InvocationError: could not find executable (hpk42/tox) Message-ID: <20151013223447.3879.35696@app12.ash-private.bitbucket.org> New issue 278: InvocationError: could not find executable https://bitbucket.org/hpk42/tox/issues/278/invocationerror-could-not-find-executable Se?n Hayes: When I run "tox -e py34-docs" using the following config everything works: [testenv:py27-docs] basepython = python2.7 sitepackages = True deps = Sphinx changedir = docs commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html sphinx-build -W -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/html [testenv:py34-docs] basepython = python3.4 sitepackages = {[testenv:py27-docs]sitepackages} deps = {[testenv:py27-docs]deps} changedir = {[testenv:py27-docs]changedir} commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html sphinx-build -W -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/html But this fails: [testenv:py34-docs] basepython = python3.4 sitepackages = {[testenv:py27-docs]sitepackages} deps = {[testenv:py27-docs]deps} changedir = {[testenv:py27-docs]changedir} commands = {[testenv:py27-docs]commands} $ tox -e py34-docs GLOB sdist-make: /home/sean/dev/django-tastypie/setup.py py34-docs inst-nodeps: /home/sean/dev/django-tastypie/.tox/dist/django-tastypie-0.12.2-dev.zip py34-docs runtests: PYTHONHASHSEED='3354290727' py34-docs runtests: commands[0] | sphinx-build -W -b html -d /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/doctrees . /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/html sphinx-build -W -b doctest -d /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/doctrees . /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/html ERROR: InvocationError: could not find executable 'sphinx-build -W -b html -d /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/doctrees . /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/html\nsphinx-build -W -b doctest -d /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/doctrees . /home/sean/dev/django-tastypie/.tox/py34-docs/tmp/html' ______________________________________________________ summary _______________________________________________________ ERROR: py34-docs: commands failed From issues-reply at bitbucket.org Wed Oct 14 03:52:34 2015 From: issues-reply at bitbucket.org (Sachi King) Date: Wed, 14 Oct 2015 01:52:34 -0000 Subject: [Pytest-commit] Issue #279: commands substitution does not work if commands uses '{posargs}' (hpk42/tox) Message-ID: <20151014015234.28832.35510@app01.ash-private.bitbucket.org> New issue 279: commands substitution does not work if commands uses '{posargs}' https://bitbucket.org/hpk42/tox/issues/279/commands-substitution-does-not-work-if Sachi King: ``` [testenv:sect1] commands = something {posargs} [testenv:sect2] commands = {[testenv:sect1]commands} ``` $ ?tox -e sect2 ``` File "/usr/bin/tox", line 9, in load_entry_point('tox==2.1.1', 'console_scripts', 'tox')() File "/usr/lib/python3.5/site-packages/tox/session.py", line 38, in main config = prepare(args) File "/usr/lib/python3.5/site-packages/tox/session.py", line 26, in prepare config = parseconfig(args) File "/usr/lib/python3.5/site-packages/tox/config.py", line 219, in parseconfig parseini(config, inipath) File "/usr/lib/python3.5/site-packages/tox/config.py", line 669, in __init__ self.make_envconfig(name, section, reader._subs, config) File "/usr/lib/python3.5/site-packages/tox/config.py", line 697, in make_envconfig res = meth(env_attr.name, env_attr.default) File "/usr/lib/python3.5/site-packages/tox/config.py", line 864, in getargvlist return _ArgvlistReader.getargvlist(self, s) File "/usr/lib/python3.5/site-packages/tox/config.py", line 1013, in getargvlist replaced = reader._replace(current_command) File "/usr/lib/python3.5/site-packages/tox/config.py", line 982, in _replace return RE_ITEM_REF.sub(self._replace_match, x) File "/usr/lib/python3.5/site-packages/tox/config.py", line 978, in _replace_match return handler(match) File "/usr/lib/python3.5/site-packages/tox/config.py", line 948, in _replace_substitution val = self._substitute_from_other_section(sub_key) File "/usr/lib/python3.5/site-packages/tox/config.py", line 937, in _substitute_from_other_section return self._replace(x) File "/usr/lib/python3.5/site-packages/tox/config.py", line 982, in _replace return RE_ITEM_REF.sub(self._replace_match, x) File "/usr/lib/python3.5/site-packages/tox/config.py", line 978, in _replace_match return handler(match) File "/usr/lib/python3.5/site-packages/tox/config.py", line 948, in _replace_substitution val = self._substitute_from_other_section(sub_key) File "/usr/lib/python3.5/site-packages/tox/config.py", line 942, in _substitute_from_other_section "substitution key %r not found" % key) tox.ConfigError: ConfigError: substitution key 'posargs' not found ``` From issues-reply at bitbucket.org Tue Oct 27 14:43:46 2015 From: issues-reply at bitbucket.org (ceridwenv) Date: Tue, 27 Oct 2015 18:43:46 -0000 Subject: [Pytest-commit] Issue #280: Having interpreters that aren't installed in envlist causes tox to refuse to run (hpk42/tox) Message-ID: <20151027184346.22412.79319@app07.ash-private.bitbucket.org> New issue 280: Having interpreters that aren't installed in envlist causes tox to refuse to run https://bitbucket.org/hpk42/tox/issues/280/having-interpreters-that-arent-installed ceridwenv: I have a tox.ini that looks like this. ``` [tox] # envlist = py27, py33, py34, py35, pypy, jython, pylint envlist = py27, py33, py34 skip_missing_interpreters = true [testenv] deps = py27,pypy,jython: funcsigs lazy-object-proxy py27,py33,pypy,jython: singledispatch six wrapt pylint: hg+https://bitbucket.org/logilab/pylint commands = python -m unittest discover -s {envsitepackagesdir}/astroid/tests -p "unittest*.py" ``` As I understand it, this should run with any missing interpreters skipped. Instead, running `tox` with CPython 2.7 and 3.4 installed, but not 3.3, gives: ``` ERROR: InterpreterNotFound: python3.3 ERROR: unknown environment 'py27' ``` Different combinations of missing interpreters can give different InterpreterNotFound and unknown environment errors, and it's not deterministic which will be reported. Commenting out the `commands = ` line causes it to run with: ``` py27: commands succeeded SKIPPED: py33: InterpreterNotFound: python3.3 py34: commands succeeded congratulations :) ``` As I'd expect, but of course this then doesn't run the tests. `tox -e` using py27 or py34 will run, `tox -e py33` gives the same error as `tox`. This is on Ubuntu Linux. I've tried both version 1.8.0, the version packaged by Ubuntu, and version 2.1.1 installed with pip, and they exhibit the same behavior. From commits-noreply at bitbucket.org Thu Oct 29 09:56:17 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 29 Oct 2015 13:56:17 -0000 Subject: [Pytest-commit] commit/tox: hpk42: add changelog Message-ID: <20151029135617.32360.81245@app03.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/ea4b7f06272b/ Changeset: ea4b7f06272b User: hpk42 Date: 2015-10-29 13:55:56+00:00 Summary: add changelog Affected #: 4 files diff -r 3ed5dc353a99acf57859a2dd265b5c2e973480e3 -r ea4b7f06272b7cd8b0861532a566fe9872517e8f CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +2.1.2 (dev) +----------- + +- fix issue265 and add LD_LIBRARY_PATH to passenv on linux by default + because otherwise the python interpreter might not start up in + certain configurations (redhat software collections). Thanks David Riddle. + 2.1.1 ---------- diff -r 3ed5dc353a99acf57859a2dd265b5c2e973480e3 -r ea4b7f06272b7cd8b0861532a566fe9872517e8f setup.py --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ description='virtualenv-based automation of test activities', long_description=open("README.rst").read(), url='http://tox.testrun.org/', - version='2.1.1', + version='2.1.2.dev1', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r 3ed5dc353a99acf57859a2dd265b5c2e973480e3 -r ea4b7f06272b7cd8b0861532a566fe9872517e8f tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '2.1.1' +__version__ = '2.1.2.dev1' from .hookspecs import hookspec, hookimpl # noqa Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Oct 29 12:24:25 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 29 Oct 2015 16:24:25 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in olliewalsh/tox (pull request #167) Message-ID: <20151029162425.14274.76946@app10.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/2d13f9d381b1/ Changeset: 2d13f9d381b1 User: hpk42 Date: 2015-10-29 16:24:21+00:00 Summary: Merged in olliewalsh/tox (pull request #167) Reorder the processing of testenv options. Affected #: 2 files diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -927,6 +927,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] diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Oct 29 12:24:26 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 29 Oct 2015 16:24:26 -0000 Subject: [Pytest-commit] commit/tox: 3 new changesets Message-ID: <20151029162426.21601.63209@app15.ash-private.bitbucket.org> 3 new commits in tox: https://bitbucket.org/hpk42/tox/commits/b45da7c8d626/ Changeset: b45da7c8d626 User: olliewalsh Date: 2015-07-03 15:53:51+00:00 Summary: Reorder the processing of testenv options. Fixes issue #246 Affected #: 2 files diff -r 87a9def32696f7ada3b536621f723018ce9667ad -r b45da7c8d626f2df98ac882529d222f5aefa2f1c tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,6 +926,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] diff -r 87a9def32696f7ada3b536621f723018ce9667ad -r b45da7c8d626f2df98ac882529d222f5aefa2f1c tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc https://bitbucket.org/hpk42/tox/commits/1619d99ed2a7/ Changeset: 1619d99ed2a7 User: olliewalsh Date: 2015-07-03 16:02:27+00:00 Summary: Cleanup flakes Affected #: 1 file diff -r b45da7c8d626f2df98ac882529d222f5aefa2f1c -r 1619d99ed2a7c9b287150dce11ef788571b0a733 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,11 +926,11 @@ assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir - def test_substitution_notfound_issue246(tmpdir, newconfig): + def test_substitution_notfound_issue246(tmpdir, newconfig): config = newconfig(""" [testenv:py27] - setenv = - FOO={envbindir} + setenv = + FOO={envbindir} BAR={envsitepackagesdir} """) conf = config.envconfigs['py27'] https://bitbucket.org/hpk42/tox/commits/2d13f9d381b1/ Changeset: 2d13f9d381b1 User: hpk42 Date: 2015-10-29 16:24:21+00:00 Summary: Merged in olliewalsh/tox (pull request #167) Reorder the processing of testenv options. Affected #: 2 files diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -927,6 +927,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] diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Thu Oct 29 12:28:16 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Thu, 29 Oct 2015 16:28:16 -0000 Subject: [Pytest-commit] commit/tox: hpk42: mention of fix issue246: fix regression in config parsing by reordering Message-ID: <20151029162816.17258.76880@app16.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/7e30b4b4591b/ Changeset: 7e30b4b4591b User: hpk42 Date: 2015-10-29 16:28:02+00:00 Summary: mention of fix issue246: fix regression in config parsing by reordering such that {envbindir} can be used again in tox.ini. Thanks Olli Walsh. Affected #: 1 file diff -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 -r 7e30b4b4591bb51fae92791a60adc98fe21733bb CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,10 @@ because otherwise the python interpreter might not start up in certain configurations (redhat software collections). Thanks David Riddle. +- fix issue246: fix regression in config parsing by reordering + such that {envbindir} can be used again in tox.ini. Thanks Olli Walsh. + + 2.1.1 ---------- Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Fri Oct 30 05:26:04 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 30 Oct 2015 09:26:04 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in itxaka/tox/fix_env_use (pull request #169) Message-ID: <20151030092604.32609.50293@app12.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/763eeed49a7c/ Changeset: 763eeed49a7c User: hpk42 Date: 2015-10-30 09:26:00+00:00 Summary: Merged in itxaka/tox/fix_env_use (pull request #169) Tries to fix #99 Affected #: 2 files diff -r 7e30b4b4591bb51fae92791a60adc98fe21733bb -r 763eeed49a7c572a9c31940932cfbeaff8d32ab1 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -254,6 +254,28 @@ ["echo", "cmd", "1", "2", "3", "4", "cmd", "2"], ] + def test_command_env_substitution(self, newconfig): + """Ensure referenced {env:key:default} values are substituted correctly.""" + config = newconfig(""" + [testenv:py27] + setenv = + TEST=testvalue + commands = + ls {env:TEST} + """) + reader = SectionReader("testenv:py27", config._cfg) + x = reader.getargvlist("commands") + assert x == [ + "ls testvalue".split() + ] + assert x != [ + "ls {env:TEST}".split() + ] + y = reader.getargvlist("setenv") + assert y == [ + "TEST=testvalue".split() + ] + class TestIniParser: def test_getstring_single(self, tmpdir, newconfig): diff -r 7e30b4b4591bb51fae92791a60adc98fe21733bb -r 763eeed49a7c572a9c31940932cfbeaff8d32ab1 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -902,6 +902,7 @@ return '\n'.join(filter(None, map(factor_line, lines))) def _replace_env(self, match): + env_list = self.getdict('setenv') match_value = match.group('substitution_value') if not match_value: raise tox.exception.ConfigError( @@ -916,11 +917,14 @@ envkey = match_value if envkey not in os.environ and default is None: - raise tox.exception.ConfigError( - "substitution env:%r: unknown environment variable %r" % - (envkey, envkey)) - - return os.environ.get(envkey, default) + if envkey not in env_list and default is None: + raise tox.exception.ConfigError( + "substitution env:%r: unknown environment variable %r" % + (envkey, envkey)) + if envkey in os.environ: + return os.environ.get(envkey, default) + else: + return env_list.get(envkey, default) def _substitute_from_other_section(self, key): if key.startswith("[") and "]" in key: Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Fri Oct 30 05:26:04 2015 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 30 Oct 2015 09:26:04 -0000 Subject: [Pytest-commit] commit/tox: 6 new changesets Message-ID: <20151030092604.11778.64307@app07.ash-private.bitbucket.org> 6 new commits in tox: https://bitbucket.org/hpk42/tox/commits/a9f2579c2505/ Changeset: a9f2579c2505 Branch: fix_env_use User: itxaka Date: 2015-08-23 18:50:15+00:00 Summary: If the {env:key:default} paremeter is found in the config but there are no environment variables yet, fall back to the current section setenv variables Affected #: 1 file diff -r 3ed5dc353a99acf57859a2dd265b5c2e973480e3 -r a9f2579c2505ddfac7201dda089d6c47ae8acf81 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -903,6 +903,7 @@ return '\n'.join(filter(None, map(factor_line, lines))) def _replace_env(self, match): + env_list = self._build_envs_list() match_value = match.group('substitution_value') if not match_value: raise tox.exception.ConfigError( @@ -917,11 +918,21 @@ envkey = match_value if envkey not in os.environ and default is None: - raise tox.exception.ConfigError( - "substitution env:%r: unknown environment variable %r" % - (envkey, envkey)) + if envkey not in env_list and default is None: + raise tox.exception.ConfigError( + "substitution env:%r: unknown environment variable %r" % + (envkey, envkey)) + if envkey in os.environ: + return os.environ.get(envkey, default) + else: + return env_list.get(envkey, default) - return os.environ.get(envkey, default) + def _build_envs_list(self): + full_envs = self._cfg[self.section_name].get('setenv') + if full_envs: + return {k.split('=')[0]: k.split('=')[1] for k in full_envs.split('\n')} + else: + return {} def _substitute_from_other_section(self, key): if key.startswith("[") and "]" in key: https://bitbucket.org/hpk42/tox/commits/cbd7d04d37b5/ Changeset: cbd7d04d37b5 Branch: fix_env_use User: itxaka Date: 2015-08-24 07:58:06+00:00 Summary: if there is no setenv section, return an empty dict Affected #: 1 file diff -r a9f2579c2505ddfac7201dda089d6c47ae8acf81 -r cbd7d04d37b59a0c46620195538b57b9a8ae0303 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -928,7 +928,7 @@ return env_list.get(envkey, default) def _build_envs_list(self): - full_envs = self._cfg[self.section_name].get('setenv') + full_envs = self._cfg[self.section_name].get('setenv', False) if full_envs: return {k.split('=')[0]: k.split('=')[1] for k in full_envs.split('\n')} else: https://bitbucket.org/hpk42/tox/commits/ab76209b4106/ Changeset: ab76209b4106 Branch: fix_env_use User: itxaka Date: 2015-08-31 09:26:00+00:00 Summary: Add tests Affected #: 1 file diff -r cbd7d04d37b59a0c46620195538b57b9a8ae0303 -r ab76209b41064bcfd9fe9d67e422487daaca9cd0 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -254,6 +254,28 @@ ["echo", "cmd", "1", "2", "3", "4", "cmd", "2"], ] + def test_command_env_substitution(self, newconfig): + """Ensure referenced {env:key:default} values are substituted correctly.""" + config = newconfig(""" + [testenv:py27] + setenv = + TEST=testvalue + commands = + ls {env:TEST} + """) + reader = SectionReader("testenv:py27", config._cfg) + x = reader.getargvlist("commands") + assert x == [ + "ls testvalue".split() + ] + assert x != [ + "ls {env:TEST}".split() + ] + y = reader.getargvlist("setenv") + assert y == [ + "TEST=testvalue".split() + ] + class TestIniParser: def test_getstring_single(self, tmpdir, newconfig): https://bitbucket.org/hpk42/tox/commits/b611c45a558b/ Changeset: b611c45a558b Branch: fix_env_use User: itxaka Date: 2015-08-31 13:08:54+00:00 Summary: better workflow, picks the resolved envs instead of the written string Affected #: 1 file diff -r ab76209b41064bcfd9fe9d67e422487daaca9cd0 -r b611c45a558b9c15687bd5e198a1ba04a0a55067 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -928,11 +928,12 @@ return env_list.get(envkey, default) def _build_envs_list(self): - full_envs = self._cfg[self.section_name].get('setenv', False) - if full_envs: - return {k.split('=')[0]: k.split('=')[1] for k in full_envs.split('\n')} - else: - return {} + full_envs = self.getargvlist('setenv') + return_data = {} + for item in full_envs: + splitted = " ".join(item).split("=") + return_data[splitted[0]] = splitted[1] + return return_data def _substitute_from_other_section(self, key): if key.startswith("[") and "]" in key: https://bitbucket.org/hpk42/tox/commits/d21e7d2340a0/ Changeset: d21e7d2340a0 Branch: fix_env_use User: itxaka Date: 2015-10-30 08:49:50+00:00 Summary: use self.getdict('setenv') instead of extra parsing that fails Affected #: 1 file diff -r b611c45a558b9c15687bd5e198a1ba04a0a55067 -r d21e7d2340a0351b730daa8824786ef666a89e28 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -903,7 +903,7 @@ return '\n'.join(filter(None, map(factor_line, lines))) def _replace_env(self, match): - env_list = self._build_envs_list() + env_list = self.getdict('setenv') match_value = match.group('substitution_value') if not match_value: raise tox.exception.ConfigError( @@ -927,14 +927,6 @@ else: return env_list.get(envkey, default) - def _build_envs_list(self): - full_envs = self.getargvlist('setenv') - return_data = {} - for item in full_envs: - splitted = " ".join(item).split("=") - return_data[splitted[0]] = splitted[1] - return return_data - def _substitute_from_other_section(self, key): if key.startswith("[") and "]" in key: i = key.find("]") https://bitbucket.org/hpk42/tox/commits/763eeed49a7c/ Changeset: 763eeed49a7c User: hpk42 Date: 2015-10-30 09:26:00+00:00 Summary: Merged in itxaka/tox/fix_env_use (pull request #169) Tries to fix #99 Affected #: 2 files diff -r 7e30b4b4591bb51fae92791a60adc98fe21733bb -r 763eeed49a7c572a9c31940932cfbeaff8d32ab1 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -254,6 +254,28 @@ ["echo", "cmd", "1", "2", "3", "4", "cmd", "2"], ] + def test_command_env_substitution(self, newconfig): + """Ensure referenced {env:key:default} values are substituted correctly.""" + config = newconfig(""" + [testenv:py27] + setenv = + TEST=testvalue + commands = + ls {env:TEST} + """) + reader = SectionReader("testenv:py27", config._cfg) + x = reader.getargvlist("commands") + assert x == [ + "ls testvalue".split() + ] + assert x != [ + "ls {env:TEST}".split() + ] + y = reader.getargvlist("setenv") + assert y == [ + "TEST=testvalue".split() + ] + class TestIniParser: def test_getstring_single(self, tmpdir, newconfig): diff -r 7e30b4b4591bb51fae92791a60adc98fe21733bb -r 763eeed49a7c572a9c31940932cfbeaff8d32ab1 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -902,6 +902,7 @@ return '\n'.join(filter(None, map(factor_line, lines))) def _replace_env(self, match): + env_list = self.getdict('setenv') match_value = match.group('substitution_value') if not match_value: raise tox.exception.ConfigError( @@ -916,11 +917,14 @@ envkey = match_value if envkey not in os.environ and default is None: - raise tox.exception.ConfigError( - "substitution env:%r: unknown environment variable %r" % - (envkey, envkey)) - - return os.environ.get(envkey, default) + if envkey not in env_list and default is None: + raise tox.exception.ConfigError( + "substitution env:%r: unknown environment variable %r" % + (envkey, envkey)) + if envkey in os.environ: + return os.environ.get(envkey, default) + else: + return env_list.get(envkey, default) def _substitute_from_other_section(self, key): if key.startswith("[") and "]" in key: Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From issues-reply at bitbucket.org Sat Oct 31 02:23:29 2015 From: issues-reply at bitbucket.org (glyph) Date: Sat, 31 Oct 2015 06:23:29 -0000 Subject: [Pytest-commit] Issue #281: --force-dep breaks when there are deps that include URLs in tox 2.1.1 (hpk42/tox) Message-ID: <20151031062329.31434.73707@app15.ash-private.bitbucket.org> New issue 281: --force-dep breaks when there are deps that include URLs in tox 2.1.1 https://bitbucket.org/hpk42/tox/issues/281/force-dep-breaks-when-there-are-deps-that glyph: See this travis build: https://travis-ci.org/rackerlabs/mimic/jobs/88486237 ``` +tox --recreate --notest --force-dep 'cryptography<1.0' Traceback (most recent call last): File "app_main.py", line 75, in run_toplevel File "/home/travis/.venv/bin/tox", line 11, in sys.exit(cmdline()) File "/home/travis/.venv/site-packages/tox/session.py", line 38, in main config = prepare(args) File "/home/travis/.venv/site-packages/tox/session.py", line 26, in prepare config = parseconfig(args) File "/home/travis/.venv/site-packages/tox/config.py", line 219, in parseconfig parseini(config, inipath) File "/home/travis/.venv/site-packages/tox/config.py", line 669, in __init__ self.make_envconfig(name, section, reader._subs, config) File "/home/travis/.venv/site-packages/tox/config.py", line 706, in make_envconfig res = env_attr.postprocess(testenv_config=vc, value=res) File "/home/travis/.venv/site-packages/tox/config.py", line 117, in postprocess name = self._replace_forced_dep(name, config) File "/home/travis/.venv/site-packages/tox/config.py", line 133, in _replace_forced_dep if self._is_same_dep(forced_dep, name): File "/home/travis/.venv/site-packages/tox/config.py", line 144, in _is_same_dep dep2_name = pkg_resources.Requirement.parse(dep2).project_name File "/home/travis/.venv/site-packages/pkg_resources/__init__.py", line 2986, in parse reqs = list(parse_requirements(s)) File "/home/travis/.venv/site-packages/pkg_resources/__init__.py", line 2930, in parse_requirements "version spec") File "/home/travis/.venv/site-packages/pkg_resources/__init__.py", line 2895, in scan_list raise RequirementParseError(msg, line, "at", line[p:]) RequirementParseError: Expected version spec in https://github.com/twisted/twisted/tarball/trunk at ://github.com/twisted/twisted/tarball/trunk ``` The offending lines in the `tox.ini` are: ``` [testenv:py34] deps = "https://github.com/twisted/twisted/tarball/trunk#egg=twisted" "https://github.com/twisted/treq/tarball/master#egg=treq" "https://github.com/twisted/klein/tarball/master#egg=klein" {[testenv]deps} ``` py34 isn't even the environment being built.