From issues-reply at bitbucket.org Thu Jun 2 08:56:11 2016 From: issues-reply at bitbucket.org (cpdean) Date: Thu, 02 Jun 2016 12:56:11 -0000 Subject: [Pytest-commit] Issue #334: tox always uses python 2.7 to build envs. can't work on projects with python3 code in setup.py (hpk42/tox) Message-ID: <20160602125611.6001.71134@celery-worker-104.ash1.bb-inf.net> New issue 334: tox always uses python 2.7 to build envs. can't work on projects with python3 code in setup.py https://bitbucket.org/hpk42/tox/issues/334/tox-always-uses-python-27-to-build-envs cpdean: I've added the following to my setup.py: ``` import sys with open("what.version.is.this.txt", "w") as f: f.write(str(sys.version_info) + "\n") ``` my tox file looks like this: ``` [tox] basepython=python3 envlist = py35 [testenv] basepython=python3 deps = [testenv:py35] basepython=python3 skip_install = true skipsdist = true deps = mypy-lang commands = mypy --py2 zulip ``` and the following gets written out: ``` $ cat what.version.is.this.txt sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0) ``` This is a problem because the project I'm trying to add tox to uses a module found only in python3. ``` tox GLOB sdist-make: /Users/cdean/dev/foss/python/zulip/api/setup.py ERROR: invocation failed (exit code 1), logfile: /Users/cdean/dev/foss/python/zulip/api/.tox/log/tox-0.log ERROR: actionid: tox msg: packaging cmdargs: ['/usr/local/opt/python/bin/python2.7', local('/Users/cdean/dev/foss/python/zulip/api/setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('/Users/cdean/dev/foss/python/zulip/api/.tox/dist')] env: None Traceback (most recent call last): File "setup.py", line 9, in from typing import Any, Generator, List, Tuple ImportError: No module named typing ERROR: FAIL could not package project - v = InvocationError('/usr/local/opt/python/bin/python2.7 /Users/cdean/dev/foss/python/zulip/api/setup.py sdist --formats=zip --dist-dir /Users/cdean/dev/foss/python/zulip/api/.tox/dist (see /Users/cdean/dev/foss/python/zulip/api/.tox/log/tox-0.log)', 1) ``` What am I doing wrong here? From issues-reply at bitbucket.org Fri Jun 10 12:24:03 2016 From: issues-reply at bitbucket.org (Joey Wilhelm) Date: Fri, 10 Jun 2016 16:24:03 -0000 Subject: [Pytest-commit] Issue #335: Instructions for Jenkins setup are failing (hpk42/tox) Message-ID: <20160610162403.12015.44068@celery-worker-104.ash1.bb-inf.net> New issue 335: Instructions for Jenkins setup are failing https://bitbucket.org/hpk42/tox/issues/335/instructions-for-jenkins-setup-are-failing Joey Wilhelm: I set up a Jenkins project according to http://tox.readthedocs.io/en/latest/example/jenkins.html and every build is following with an error along the lines of: [py27-django19] $ python /tmp/hudson1061348873889474121.py Additionally, and I don't know if this is related, the project tried building continually until I killed it, even though it was set to trigger only on new pushes to Github. From commits-noreply at bitbucket.org Mon Jun 20 09:19:32 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:19:32 -0000 Subject: [Pytest-commit] commit/tox: nakatoio: Add test for issue #307 Message-ID: <20160620131932.13548.23025@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/62c553e32ce9/ Changeset: 62c553e32ce9 User: nakatoio Date: 2016-05-10 03:16:44+00:00 Summary: Add test for issue #307 This adds a test to address the second example in issue #307, the first example is already addressed. Closes issue #307 Affected #: 1 file diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r 62c553e32ce9e20de98d035721ce3f5313903ea6 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -288,6 +288,20 @@ x = reader.getargvlist("commands") assert x == [['thing', 'argpos', 'arg2']] + def test_command_section_and_posargs_substitution(self, newconfig): + """Ensure subsitition from other section with posargs succeeds""" + config = newconfig(""" + [section] + key = thing arg1 + [testenv] + commands = + {[section]key} {posargs} endarg + """) + reader = SectionReader("testenv", config._cfg) + reader.addsubstitutions([r"argpos"]) + x = reader.getargvlist("commands") + assert x == [['thing', 'arg1', 'argpos', 'endarg']] + def test_command_env_substitution(self, newconfig): """Ensure referenced {env:key:default} values are substituted correctly.""" config = newconfig(""" 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 Mon Jun 20 09:22:21 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:22:21 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620132221.6475.54401@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/c2f995a5688f/ Changeset: c2f995a5688f User: nakatoio Date: 2016-02-29 04:45:11+00:00 Summary: Process minversion before all else Reading the tox.ini config file and processing it is done as one task, yet processing the minversion is done much later, as such if there is a bug fix in a newer version or a change that makes the tox.ini file incompatable with older versions tox will bail with a stack trace instead of a "Your tox is too old" message. This moves the version check as early as it can possibly be done, the very first value read out of tox.ini is minversion and it is immedeiatly compared to tox.__version__. Affected #: 4 files diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r c2f995a5688fee4c4dd6da8bfaf13132ef161590 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1426,8 +1426,8 @@ [tox] minversion = 3.0 """ - config = newconfig([], inisource) - assert config.minversion == "3.0" + with py.test.raises(tox.exception.MinVersionError): + config = newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r c2f995a5688fee4c4dd6da8bfaf13132ef161590 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -23,5 +23,11 @@ """ a directory did not exist. """ class MissingDependency(Error): """ a dependency could not be found or determined. """ + class MinVersionError(Error): + """ the installed tox version is lower than requested minversion. """ + + def __init__(self, message): + self.message = message + super(exception.MinVersionError, self).__init__(message) from tox.session import main as cmdline # noqa diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r c2f995a5688fee4c4dd6da8bfaf13132ef161590 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -12,6 +12,7 @@ import tox.interpreters from tox import hookspecs +from tox._verlib import NormalizedVersion import py @@ -664,8 +665,18 @@ reader.addsubstitutions(toxinidir=config.toxinidir, homedir=config.homedir) + # As older versions of tox may have bugs or incompatabilities that + # prevent parsing of tox.ini this must be the first thing checked. + config.minversion = reader.getstring("minversion", None) + # Parse our compatability immediately + if config.minversion: + minversion = NormalizedVersion(self.config.minversion) + toxversion = NormalizedVersion(tox.__version__) + if toxversion < minversion: + raise tox.exception.MinVersionError( + "tox version is %s, required is at least %s" % ( + toxversion, minversion)) config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") - config.minversion = reader.getstring("minversion", None) if not config.option.skip_missing_interpreters: config.option.skip_missing_interpreters = \ diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r c2f995a5688fee4c4dd6da8bfaf13132ef161590 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -40,6 +40,10 @@ raise SystemExit(retcode) except KeyboardInterrupt: raise SystemExit(2) + except tox.exception.MinVersionError as e: + r = Reporter(None) + r.error(e.message) + raise SystemExit(1) def show_help(config): @@ -233,6 +237,12 @@ self._reportedlines = [] # self.cumulated_time = 0.0 + def _get_verbosity(self): + if self.session: + return self.session.config.option.verbosity + else: + return 2 + def logpopen(self, popen, env): """ log information about the action.popen() created process. """ cmd = " ".join(map(str, popen.args)) @@ -257,11 +267,11 @@ self.tw.sep("_", "summary") def info(self, msg): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline(msg) def using(self, msg): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("using %s" % (msg,), bold=True) def keyboard_interrupt(self): @@ -297,15 +307,15 @@ self.tw.line("%s" % msg, **opts) def verbosity0(self, msg, **opts): - if self.session.config.option.verbosity >= 0: + if self._get_verbosity() >= 0: self.logline("%s" % msg, **opts) def verbosity1(self, msg, **opts): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("%s" % msg, **opts) def verbosity2(self, msg, **opts): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline("%s" % msg, **opts) # def log(self, msg): @@ -359,14 +369,6 @@ def runcommand(self): self.report.using("tox-%s from %s" % (tox.__version__, tox.__file__)) - if self.config.minversion: - minversion = NormalizedVersion(self.config.minversion) - toxversion = NormalizedVersion(tox.__version__) - if toxversion < minversion: - self.report.error( - "tox version is %s, required is at least %s" % ( - toxversion, minversion)) - raise SystemExit(1) if self.config.option.showconfig: self.showconfig() elif self.config.option.listenvs: https://bitbucket.org/hpk42/tox/commits/c07a95573512/ Changeset: c07a95573512 User: obestwalter Date: 2016-06-20 13:22:16+00:00 Summary: Merged in nakatoio/tox (pull request #190) Process minversion before all else Affected #: 4 files diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1440,8 +1440,8 @@ [tox] minversion = 3.0 """ - config = newconfig([], inisource) - assert config.minversion == "3.0" + with py.test.raises(tox.exception.MinVersionError): + config = newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -23,5 +23,11 @@ """ a directory did not exist. """ class MissingDependency(Error): """ a dependency could not be found or determined. """ + class MinVersionError(Error): + """ the installed tox version is lower than requested minversion. """ + + def __init__(self, message): + self.message = message + super(exception.MinVersionError, self).__init__(message) from tox.session import main as cmdline # noqa diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -12,6 +12,7 @@ import tox.interpreters from tox import hookspecs +from tox._verlib import NormalizedVersion import py @@ -664,8 +665,18 @@ reader.addsubstitutions(toxinidir=config.toxinidir, homedir=config.homedir) + # As older versions of tox may have bugs or incompatabilities that + # prevent parsing of tox.ini this must be the first thing checked. + config.minversion = reader.getstring("minversion", None) + # Parse our compatability immediately + if config.minversion: + minversion = NormalizedVersion(self.config.minversion) + toxversion = NormalizedVersion(tox.__version__) + if toxversion < minversion: + raise tox.exception.MinVersionError( + "tox version is %s, required is at least %s" % ( + toxversion, minversion)) config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") - config.minversion = reader.getstring("minversion", None) if not config.option.skip_missing_interpreters: config.option.skip_missing_interpreters = \ diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -40,6 +40,10 @@ raise SystemExit(retcode) except KeyboardInterrupt: raise SystemExit(2) + except tox.exception.MinVersionError as e: + r = Reporter(None) + r.error(e.message) + raise SystemExit(1) def show_help(config): @@ -233,6 +237,12 @@ self._reportedlines = [] # self.cumulated_time = 0.0 + def _get_verbosity(self): + if self.session: + return self.session.config.option.verbosity + else: + return 2 + def logpopen(self, popen, env): """ log information about the action.popen() created process. """ cmd = " ".join(map(str, popen.args)) @@ -257,11 +267,11 @@ self.tw.sep("_", "summary") def info(self, msg): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline(msg) def using(self, msg): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("using %s" % (msg,), bold=True) def keyboard_interrupt(self): @@ -297,15 +307,15 @@ self.tw.line("%s" % msg, **opts) def verbosity0(self, msg, **opts): - if self.session.config.option.verbosity >= 0: + if self._get_verbosity() >= 0: self.logline("%s" % msg, **opts) def verbosity1(self, msg, **opts): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("%s" % msg, **opts) def verbosity2(self, msg, **opts): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline("%s" % msg, **opts) # def log(self, msg): @@ -359,14 +369,6 @@ def runcommand(self): self.report.using("tox-%s from %s" % (tox.__version__, tox.__file__)) - if self.config.minversion: - minversion = NormalizedVersion(self.config.minversion) - toxversion = NormalizedVersion(tox.__version__) - if toxversion < minversion: - self.report.error( - "tox version is %s, required is at least %s" % ( - toxversion, minversion)) - raise SystemExit(1) if self.config.option.showconfig: self.showconfig() elif self.config.option.listenvs: 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 Mon Jun 20 09:22:21 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:22:21 -0000 Subject: [Pytest-commit] commit/tox: obestwalter: Merged in nakatoio/tox (pull request #190) Message-ID: <20160620132221.21359.30554@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/c07a95573512/ Changeset: c07a95573512 User: obestwalter Date: 2016-06-20 13:22:16+00:00 Summary: Merged in nakatoio/tox (pull request #190) Process minversion before all else Affected #: 4 files diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1440,8 +1440,8 @@ [tox] minversion = 3.0 """ - config = newconfig([], inisource) - assert config.minversion == "3.0" + with py.test.raises(tox.exception.MinVersionError): + config = newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -23,5 +23,11 @@ """ a directory did not exist. """ class MissingDependency(Error): """ a dependency could not be found or determined. """ + class MinVersionError(Error): + """ the installed tox version is lower than requested minversion. """ + + def __init__(self, message): + self.message = message + super(exception.MinVersionError, self).__init__(message) from tox.session import main as cmdline # noqa diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -12,6 +12,7 @@ import tox.interpreters from tox import hookspecs +from tox._verlib import NormalizedVersion import py @@ -664,8 +665,18 @@ reader.addsubstitutions(toxinidir=config.toxinidir, homedir=config.homedir) + # As older versions of tox may have bugs or incompatabilities that + # prevent parsing of tox.ini this must be the first thing checked. + config.minversion = reader.getstring("minversion", None) + # Parse our compatability immediately + if config.minversion: + minversion = NormalizedVersion(self.config.minversion) + toxversion = NormalizedVersion(tox.__version__) + if toxversion < minversion: + raise tox.exception.MinVersionError( + "tox version is %s, required is at least %s" % ( + toxversion, minversion)) config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") - config.minversion = reader.getstring("minversion", None) if not config.option.skip_missing_interpreters: config.option.skip_missing_interpreters = \ diff -r 62c553e32ce9e20de98d035721ce3f5313903ea6 -r c07a9557351251619b76cbefb9622fcdf9377ca6 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -40,6 +40,10 @@ raise SystemExit(retcode) except KeyboardInterrupt: raise SystemExit(2) + except tox.exception.MinVersionError as e: + r = Reporter(None) + r.error(e.message) + raise SystemExit(1) def show_help(config): @@ -233,6 +237,12 @@ self._reportedlines = [] # self.cumulated_time = 0.0 + def _get_verbosity(self): + if self.session: + return self.session.config.option.verbosity + else: + return 2 + def logpopen(self, popen, env): """ log information about the action.popen() created process. """ cmd = " ".join(map(str, popen.args)) @@ -257,11 +267,11 @@ self.tw.sep("_", "summary") def info(self, msg): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline(msg) def using(self, msg): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("using %s" % (msg,), bold=True) def keyboard_interrupt(self): @@ -297,15 +307,15 @@ self.tw.line("%s" % msg, **opts) def verbosity0(self, msg, **opts): - if self.session.config.option.verbosity >= 0: + if self._get_verbosity() >= 0: self.logline("%s" % msg, **opts) def verbosity1(self, msg, **opts): - if self.session.config.option.verbosity >= 1: + if self._get_verbosity() >= 1: self.logline("%s" % msg, **opts) def verbosity2(self, msg, **opts): - if self.session.config.option.verbosity >= 2: + if self._get_verbosity() >= 2: self.logline("%s" % msg, **opts) # def log(self, msg): @@ -359,14 +369,6 @@ def runcommand(self): self.report.using("tox-%s from %s" % (tox.__version__, tox.__file__)) - if self.config.minversion: - minversion = NormalizedVersion(self.config.minversion) - toxversion = NormalizedVersion(tox.__version__) - if toxversion < minversion: - self.report.error( - "tox version is %s, required is at least %s" % ( - toxversion, minversion)) - raise SystemExit(1) if self.config.option.showconfig: self.showconfig() elif self.config.option.listenvs: 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 Mon Jun 20 09:33:31 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:33:31 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620133331.14030.73250@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/970de3ef8e9b/ Changeset: 970de3ef8e9b Branch: d0ugal/correct-forcedeps-to-be-forcedep-in-the--1457531878676 User: d0ugal Date: 2016-03-09 13:58:01+00:00 Summary: Correct --force-deps to be --force-dep in the CHANGELOG. Affected #: 1 file diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r 970de3ef8e9b2abbb2e3484bee7cf496c6fc892c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -63,7 +63,7 @@ - fix issue99: the {env:...} substitution now properly uses environment settings from the ``setenv`` section. Thanks Itxaka Serrano. -- fix issue281: make --force-deps work when urls are present in +- fix issue281: make --force-dep work when urls are present in dependency configs. Thanks Glyph Lefkowitz for reporting. - fix issue174: add new ``ignore_outcome`` testenv attribute which @@ -182,7 +182,7 @@ 1.9.2 ----------- -- backout ability that --force-deps substitutes name/versions in +- backout ability that --force-dep substitutes name/versions in requirement files due to various issues. This fixes issue228, fixes issue230, fixes issue231 which popped up with 1.9.1. @@ -193,7 +193,7 @@ - use a file instead of a pipe for command output in "--result-json". Fixes some termination issues with python2.6. -- allow --force-deps to override dependencies in "-r" requirements +- allow --force-dep to override dependencies in "-r" requirements files. Thanks Sontek for the PR. - fix issue227: use "-m virtualenv" instead of "-mvirtualenv" to make https://bitbucket.org/hpk42/tox/commits/b73716454bbf/ Changeset: b73716454bbf User: d6e Date: 2016-06-20 13:33:27+00:00 Summary: Merged in d0ugal/tox/d0ugal/correct-forcedeps-to-be-forcedep-in-the--1457531878676 (pull request #191) Correct --force-deps to be --force-dep in the CHANGELOG. Affected #: 1 file diff -r c07a9557351251619b76cbefb9622fcdf9377ca6 -r b73716454bbfee66e9b8db5a563d660114ffdbfa CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -63,7 +63,7 @@ - fix issue99: the {env:...} substitution now properly uses environment settings from the ``setenv`` section. Thanks Itxaka Serrano. -- fix issue281: make --force-deps work when urls are present in +- fix issue281: make --force-dep work when urls are present in dependency configs. Thanks Glyph Lefkowitz for reporting. - fix issue174: add new ``ignore_outcome`` testenv attribute which @@ -182,7 +182,7 @@ 1.9.2 ----------- -- backout ability that --force-deps substitutes name/versions in +- backout ability that --force-dep substitutes name/versions in requirement files due to various issues. This fixes issue228, fixes issue230, fixes issue231 which popped up with 1.9.1. @@ -193,7 +193,7 @@ - use a file instead of a pipe for command output in "--result-json". Fixes some termination issues with python2.6. -- allow --force-deps to override dependencies in "-r" requirements +- allow --force-dep to override dependencies in "-r" requirements files. Thanks Sontek for the PR. - fix issue227: use "-m virtualenv" instead of "-mvirtualenv" to make 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 Mon Jun 20 09:33:32 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:33:32 -0000 Subject: [Pytest-commit] commit/tox: d6e: Merged in d0ugal/tox/d0ugal/correct-forcedeps-to-be-forcedep-in-the--1457531878676 (pull request #191) Message-ID: <20160620133332.32328.90376@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/b73716454bbf/ Changeset: b73716454bbf User: d6e Date: 2016-06-20 13:33:27+00:00 Summary: Merged in d0ugal/tox/d0ugal/correct-forcedeps-to-be-forcedep-in-the--1457531878676 (pull request #191) Correct --force-deps to be --force-dep in the CHANGELOG. Affected #: 1 file diff -r c07a9557351251619b76cbefb9622fcdf9377ca6 -r b73716454bbfee66e9b8db5a563d660114ffdbfa CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -63,7 +63,7 @@ - fix issue99: the {env:...} substitution now properly uses environment settings from the ``setenv`` section. Thanks Itxaka Serrano. -- fix issue281: make --force-deps work when urls are present in +- fix issue281: make --force-dep work when urls are present in dependency configs. Thanks Glyph Lefkowitz for reporting. - fix issue174: add new ``ignore_outcome`` testenv attribute which @@ -182,7 +182,7 @@ 1.9.2 ----------- -- backout ability that --force-deps substitutes name/versions in +- backout ability that --force-dep substitutes name/versions in requirement files due to various issues. This fixes issue228, fixes issue230, fixes issue231 which popped up with 1.9.1. @@ -193,7 +193,7 @@ - use a file instead of a pipe for command output in "--result-json". Fixes some termination issues with python2.6. -- allow --force-deps to override dependencies in "-r" requirements +- allow --force-dep to override dependencies in "-r" requirements files. Thanks Sontek for the PR. - fix issue227: use "-m virtualenv" instead of "-mvirtualenv" to make 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 Mon Jun 20 09:42:10 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:42:10 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: #317 raise minversion in test to avoid breakage on next major update Message-ID: <20160620134210.35134.11291@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/97b5ffbd5f5e/ Changeset: 97b5ffbd5f5e User: Oliver Bestwalter Date: 2016-06-20 13:41:56+00:00 Summary: #317 raise minversion in test to avoid breakage on next major update Affected #: 1 file diff -r b73716454bbfee66e9b8db5a563d660114ffdbfa -r 97b5ffbd5f5ef876f4275d52320a3eb30f1b841d tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1438,7 +1438,7 @@ def test_minversion(self, tmpdir, newconfig, monkeypatch): inisource = """ [tox] - minversion = 3.0 + minversion = 10.0 """ with py.test.raises(tox.exception.MinVersionError): config = newconfig([], inisource) 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 Mon Jun 20 09:42:28 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 13:42:28 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: update CHANGELOG Message-ID: <20160620134228.36829.94835@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/8ced7a0120e1/ Changeset: 8ced7a0120e1 User: Oliver Bestwalter Date: 2016-06-20 13:42:23+00:00 Summary: update CHANGELOG Affected #: 1 file diff -r 97b5ffbd5f5ef876f4275d52320a3eb30f1b841d -r 8ced7a0120e13d5137921de68c2a362a35bc8c6e CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,8 @@ - fix issue279: allow cross-section substitution when the value contains posargs. Thanks Sachi King for the PR. +- fix issue317: evaluate minversion before tox config is parsed completely. + Thanks Sachi King for the PR. 2.3.1 ----- @@ -20,8 +22,8 @@ devpi system for managing indexes for pip. - fix issue285: make setenv processing fully lazy to fix regressions - of tox-2.2.X and so that we can now have testenv attributes like - "basepython" depend on environment variables that are set in + of tox-2.2.X and so that we can now have testenv attributes like + "basepython" depend on environment variables that are set in a setenv section. Thanks Nelfin for some tests and initial work on a PR. @@ -34,11 +36,11 @@ - fix issue252: allow environment names with special characters. Thanks Julien Castets for initial PR and patience. -- introduce experimental tox_testenv_create(venv, action) and +- introduce experimental tox_testenv_create(venv, action) and tox_testenv_install_deps(venv, action) hooks to allow plugins to do additional work on creation or installing deps. These hooks are experimental mainly because of - the involved "venv" and session objects whose current public + the involved "venv" and session objects whose current public API is not fully guranteed. - internal: push some optional object creation into tests because @@ -57,7 +59,7 @@ 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 +- fix issue246: fix regression in config parsing by reordering such that {envbindir} can be used again in tox.ini. Thanks Olli Walsh. - fix issue99: the {env:...} substitution now properly uses environment @@ -68,7 +70,7 @@ - fix issue174: add new ``ignore_outcome`` testenv attribute which can be set to True in which case it will produce a warning instead - of an error on a failed testenv command outcome. + of an error on a failed testenv command outcome. Thanks Rebecka Gulliksson for the PR. - fix issue280: properly skip missing interpreter if @@ -85,7 +87,7 @@ 2.1.0 ---------- -- fix issue258, fix issue248, fix issue253: for non-test commands +- fix issue258, fix issue248, fix issue253: for non-test commands (installation, venv creation) we pass in the full invocation environment. - remove experimental --set-home option which was hardly used and @@ -106,7 +108,7 @@ 2.0.2 ---------- -- fix issue247: tox now passes the LANG variable from the tox invocation +- fix issue247: tox now passes the LANG variable from the tox invocation environment to the test environment by default. - add SYSTEMDRIVE into default passenv on windows to allow pip6 to work. @@ -123,9 +125,9 @@ - (new) introduce environment variable isolation: tox now only passes the PATH and PIP_INDEX_URL variable from the tox - invocation environment to the test environment and on Windows + invocation environment to the test environment and on Windows also ``SYSTEMROOT``, ``PATHEXT``, ``TEMP`` and ``TMP`` whereas - on unix additionally ``TMPDIR`` is passed. If you need to pass + on unix additionally ``TMPDIR`` is passed. If you need to pass through further environment variables you can use the new ``passenv`` setting, a space-separated list of environment variable names. Each name can make use of fnmatch-style glob patterns. All environment @@ -136,9 +138,9 @@ their defaults. - (new) introduce a way to specify on which platform a testenvironment is to - execute: the new per-venv "platform" setting allows to specify + execute: the new per-venv "platform" setting allows to specify a regular expression which is matched against sys.platform. - If platform is set and doesn't match the platform spec in the test + If platform is set and doesn't match the platform spec in the test environment the test environment is ignored, no setup or tests are attempted. - (new) add per-venv "ignore_errors" setting, which defaults to False. @@ -169,7 +171,7 @@ See tox/hookspecs.py for the current hooks. - introduce parser.add_testenv_attribute() to register an ini-variable - for testenv sections. Can be used from plugins through the + for testenv sections. Can be used from plugins through the tox_add_option hook. - rename internal files -- tox offers no external API except for the @@ -208,7 +210,7 @@ dependencies. Use ``pip_pre = true`` in a testenv or the ``--pre`` command-line option to restore the previous behavior. -- fix issue199: fill resultlog structure ahead of virtualenv creation +- fix issue199: fill resultlog structure ahead of virtualenv creation - refine determination if we run from Jenkins, thanks Borge Lanes. @@ -266,7 +268,7 @@ - fix issue59: add a config variable ``skip-missing-interpreters`` as well as command line option ``--skip-missing-interpreters`` which won't fail the - build if Python interpreters listed in tox.ini are missing. Thanks + build if Python interpreters listed in tox.ini are missing. Thanks Alexandre Conrad for PR104. - fix issue164: better traceback info in case of failing test commands. @@ -284,29 +286,29 @@ - fix issue162: don't list python 2.5 as compatibiliy/supported - fix issue158 and fix issue155: windows/virtualenv properly works now: - call virtualenv through "python -m virtualenv" with the same + call virtualenv through "python -m virtualenv" with the same interpreter which invoked tox. Thanks Chris Withers, Ionel Maries Cristian. 1.7.0 --------- -- don't lookup "pip-script" anymore but rather just "pip" on windows - as this is a pip implementation detail and changed with pip-1.5. - It might mean that tox-1.7 is not able to install a different pip +- don't lookup "pip-script" anymore but rather just "pip" on windows + as this is a pip implementation detail and changed with pip-1.5. + It might mean that tox-1.7 is not able to install a different pip version into a virtualenv anymore. - drop Python2.5 compatibility because it became too hard due - to the setuptools-2.0 dropping support. tox now has no + to the setuptools-2.0 dropping support. tox now has no support for creating python2.5 based environments anymore and all internal special-handling has been removed. -- merged PR81: new option --force-dep which allows to +- merged PR81: new option --force-dep which allows to override tox.ini specified dependencies in setuptools-style. For example "--force-dep 'django<1.6'" will make sure - that any environment using "django" as a dependency will - get the latest 1.5 release. Thanks Bruno Oliveria for + that any environment using "django" as a dependency will + get the latest 1.5 release. Thanks Bruno Oliveria for the complete PR. - + - merged PR125: tox now sets "PYTHONHASHSEED" to a random value and offers a "--hashseed" option to repeat a test run with a specific seed. You can also use --hashsheed=noset to instruct tox to leave the value @@ -324,9 +326,9 @@ - fix issue130: you can now set install_command=easy_install {opts} {packages} and expect it to work for repeated tox runs (previously it only worked - when always recreating). Thanks jenisys for precise reporting. + when always recreating). Thanks jenisys for precise reporting. -- fix issue129: tox now uses Popen(..., universal_newlines=True) to force +- fix issue129: tox now uses Popen(..., universal_newlines=True) to force creation of unicode stdout/stderr streams. fixes a problem on specific platform configs when creating virtualenvs with Python3.3. Thanks Jorgen Sch?fer or investigation and solution sketch. @@ -344,7 +346,7 @@ requiring networks - introduce --sitepackages to force sitepackages=True in all - environments. + environments. - fix issue105 -- don't depend on an existing HOME directory from tox tests. @@ -354,8 +356,8 @@ - fix issue119: {envsitepackagesdir} is now correctly computed and has a better test to prevent regression. -- fix issue116: make 1.6 introduced behaviour of changing to a - per-env HOME directory during install activities dependent +- fix issue116: make 1.6 introduced behaviour of changing to a + per-env HOME directory during install activities dependent on "--set-home" for now. Should re-establish the old behaviour when no option is given. @@ -365,9 +367,9 @@ - fix test runs on environments without a home directory (in this case we use toxinidir as the homedir) -- fix issue117: python2.5 fix: don't use ``--insecure`` option because +- fix issue117: python2.5 fix: don't use ``--insecure`` option because its very existence depends on presence of "ssl". If you - want to support python2.5/pip1.3.1 based test environments you need + want to support python2.5/pip1.3.1 based test environments you need to install ssl and/or use PIP_INSECURE=1 through ``setenv``. section. - fix issue102: change to {toxinidir} when installing dependencies. @@ -380,11 +382,11 @@ configure the installation command with options for dep/pkg install. Thanks Carl Meyer for the PR and docs. -- fix issue91: python2.5 support by vendoring the virtualenv-1.9.1 - script and forcing pip<1.4. Also the default [py25] environment +- fix issue91: python2.5 support by vendoring the virtualenv-1.9.1 + script and forcing pip<1.4. Also the default [py25] environment modifies the default installer_command (new config option) - to use pip without the "--pre" option which was introduced - with pip-1.4 and is now required if you want to install non-stable + to use pip without the "--pre" option which was introduced + with pip-1.4 and is now required if you want to install non-stable releases. (tox defaults to install with "--pre" everywhere). - during installation of dependencies HOME is now set to a pseudo @@ -421,7 +423,7 @@ - fix issue104: use setuptools by default, instead of distribute, now that setuptools has distribute merged. -- make sure test commands are searched first in the virtualenv +- make sure test commands are searched first in the virtualenv - re-fix issue2 - add whitelist_externals to be used in ``[testenv*]`` sections, allowing to avoid warnings for commands such as ``make``, @@ -432,12 +434,12 @@ - fix issue92 - fix {envsitepackagesdir} to actually work again -- show (test) command that is being executed, thanks +- show (test) command that is being executed, thanks Lukasz Balcerzak - re-license tox to MIT license -- depend on virtualenv-1.9.1 +- depend on virtualenv-1.9.1 - rename README.txt to README.rst to make bitbucket happier @@ -452,7 +454,7 @@ (thanks Lukasz Balcerzak) - fix downloadcache determination to work according to docs: Only - make pip use a download cache if PIP_DOWNLOAD_CACHE or a + make pip use a download cache if PIP_DOWNLOAD_CACHE or a downloadcache=PATH testenv setting is present. (The ENV setting takes precedence) @@ -476,7 +478,7 @@ - fix #48 - win32 detection of pypy and other interpreters that are on PATH (thanks Gustavo Picon) -- fix grouping of index servers, it is now done by name instead of +- fix grouping of index servers, it is now done by name instead of indexserver url, allowing to use it to separate dependencies into groups even if using the same default indexserver. @@ -512,7 +514,7 @@ which would formerly raise irritating errors because the ";" was considered a comment - tweak and improve reporting -- refactor reporting and virtualenv manipulation +- refactor reporting and virtualenv manipulation to be more accessible from 3rd party tools - support value substitution from other sections with the {[section]key} syntax @@ -527,8 +529,8 @@ 1.3 ----------------- -- fix: allow to specify wildcard filesystem paths when - specifying dependencies such that tox searches for +- fix: allow to specify wildcard filesystem paths when + specifying dependencies such that tox searches for the highest version - fix issue issue21: clear PIP_REQUIRES_VIRTUALENV which avoids 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 Mon Jun 20 10:12:59 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:12:59 -0000 Subject: [Pytest-commit] commit/tox: obestwalter: Merged in nyirogergo/tox (pull request #188) Message-ID: <20160620141259.5898.61329@celery-worker-101.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/468a859c9e76/ Changeset: 468a859c9e76 User: obestwalter Date: 2016-06-20 14:12:55+00:00 Summary: Merged in nyirogergo/tox (pull request #188) session.Reporter: delete _starttime at exit Affected #: 1 file diff -r 8ced7a0120e13d5137921de68c2a362a35bc8c6e -r 468a859c9e7614d18fab2976829eb58dbf905e37 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -262,6 +262,7 @@ # self.cumulated_time += duration self.verbosity2("%s finish: %s after %.2f seconds" % ( action.venvname, action.msg, duration), bold=True) + delattr(action, '_starttime') def startsummary(self): self.tw.sep("_", "summary") 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 Mon Jun 20 10:13:00 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:13:00 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620141300.11183.34820@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/e46db3903e47/ Changeset: e46db3903e47 User: nyirogergo Date: 2016-01-14 10:25:11+00:00 Summary: session.Reporter: delete _starttime at exit The __enter__ of with statement extend the action object with _starttime and assert if it had been already extended. Therefore the __exit__ should remove the extra attribute of the action. Affected #: 1 file diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r e46db3903e47038fed2658e50fa724fde4ec2805 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -252,6 +252,7 @@ # self.cumulated_time += duration self.verbosity2("%s finish: %s after %.2f seconds" % ( action.venvname, action.msg, duration), bold=True) + delattr(action, '_starttime') def startsummary(self): self.tw.sep("_", "summary") https://bitbucket.org/hpk42/tox/commits/468a859c9e76/ Changeset: 468a859c9e76 User: obestwalter Date: 2016-06-20 14:12:55+00:00 Summary: Merged in nyirogergo/tox (pull request #188) session.Reporter: delete _starttime at exit Affected #: 1 file diff -r 8ced7a0120e13d5137921de68c2a362a35bc8c6e -r 468a859c9e7614d18fab2976829eb58dbf905e37 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -262,6 +262,7 @@ # self.cumulated_time += duration self.verbosity2("%s finish: %s after %.2f seconds" % ( action.venvname, action.msg, duration), bold=True) + delattr(action, '_starttime') def startsummary(self): self.tw.sep("_", "summary") 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 Mon Jun 20 10:33:01 2016 From: issues-reply at bitbucket.org (Oliver Bestwalter) Date: Mon, 20 Jun 2016 14:33:01 -0000 Subject: [Pytest-commit] Issue #336: tox -e flakes fails (hpk42/tox) Message-ID: <20160620143301.26673.50518@celery-worker-102.ash1.bb-inf.net> New issue 336: tox -e flakes fails https://bitbucket.org/hpk42/tox/issues/336/tox-e-flakes-fails Oliver Bestwalter: Running `tox -e flakes` from current default tip is not passing. Responsible: obestwalter From commits-noreply at bitbucket.org Mon Jun 20 10:41:05 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:41:05 -0000 Subject: [Pytest-commit] commit/tox: hpk42: fix issue66 by introducing using default "python -m pip" Message-ID: <20160620144105.3930.40886@celery-worker-104.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/73d3b0cabef0/ Changeset: 73d3b0cabef0 User: hpk42 Date: 2016-06-20 14:40:36+00:00 Summary: fix issue66 by introducing using default "python -m pip" and introducing list_dependencies_command. (Ted, Holger) Affected #: 9 files diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,18 @@ +2.4.0 +----- + +- introduce per-venv list_dependencies_command which defaults + to "python -m pip freeze" to obtain the list of installed packages. + If you need to run python2.6 you need to configure it to + something like "pip freeze". Thanks Ted Shaw, Holger Krekel. + +- fix issue66, issue121: change install_command to use "python -m pip" + by default instead of "pip ..." directly which avoids long shebang + issues. If you need to run python2.6 you need to configure it to + something like "pip install {opts} {packages}". Thanks Ted Shaw, + Holger Krekel. + + 2.3.2 ----- diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -105,7 +105,20 @@ **default**:: - pip install {opts} {packages} + python -m pip install {opts} {packages} + + +.. confval:: list_dependencies_command + + .. versionadded:: 2.4 + + the ``list_dependencies_command`` setting is used for listing + the packages installed into the virtual environment. + + **default**:: + + python -m pip freeze + .. confval:: ignore_errors=True|False(default) diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 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.3.2', + version='2.4.0.dev1', license='http://opensource.org/licenses/MIT', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='holger krekel', diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -137,8 +137,8 @@ assert len(l) == 2 args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir - assert "pip" in str(args[0]) - assert args[1] == "install" + assert "pip" in str(args[2]) + assert args[3] == "install" # arg = "--download-cache=" + str(venv.envconfig.downloadcache) # assert arg in args[2:] args = [arg for arg in args if str(arg).endswith("dep1-1.1.zip")] @@ -167,8 +167,8 @@ assert len(l) == 2 args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir - assert "pip" in str(args[0]) - assert args[1] == "install" + assert "pip" in str(args) + assert args[3] == "install" assert "dep1" in args assert "dep2" in args deps = list(filter(None, [x[1] for x in venv._getliveconfig().deps])) @@ -365,7 +365,7 @@ venv._install(["hello"], action=action) assert len(l) == 1 args = l[0].args - assert 'pip' in str(args[0]) + assert "pip" in [str(x) for x in args] for x in args: assert "--download-cache" not in args, args @@ -597,7 +597,7 @@ venv.run_install_command(packages=["whatever"], action=action) l = mocksession._pcalls assert len(l) == 1 - assert 'pip' in l[0].args[0] + assert 'pip' in l[0].args[2] assert 'install' in l[0].args env = l[0].env assert env is not None diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox.ini --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,13 @@ [testenv:py26-bare] deps = commands = tox -h +install_command = pip install {opts} {packages} +list_dependencies_command = pip freeze + +[testenv:py26] +install_command = pip install {opts} {packages} +list_dependencies_command = pip freeze + [testenv:docs] basepython=python diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/__init__.py --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,5 +1,5 @@ # -__version__ = '2.3.2' +__version__ = '2.4.0.dev1' from .hookspecs import hookspec, hookimpl # noqa diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -195,6 +195,9 @@ return py.std.subprocess.Popen(argv, stdout=stdout, stderr=stderr, **kw) def run(self, *argv): + if argv[0] == "tox" and sys.version_info[:2] < (2,7): + pytest.skip("can not run tests involving calling tox on python2.6. " + "(and python2.6 is about to be deprecated anyway)") argv = [str(x) for x in argv] assert py.path.local.sysfind(str(argv[0])), argv[0] p1 = self.tmpdir.join("stdout") diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -181,7 +181,7 @@ class InstallcmdOption: name = "install_command" type = "argv" - default = "pip install {opts} {packages}" + default = "python -m pip install {opts} {packages}" help = "install command for dependencies and package under test." def postprocess(self, testenv_config, value): @@ -518,6 +518,13 @@ help="install package in develop/editable mode") parser.add_testenv_attribute_obj(InstallcmdOption()) + + parser.add_testenv_attribute( + name = "list_dependencies_command", + type = "argv", + default = "python -m pip freeze", + help = "list dependencies for a virtual environment") + parser.add_testenv_attribute_obj(DepOption()) parser.add_testenv_attribute( diff -r 468a859c9e7614d18fab2976829eb58dbf905e37 -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -537,8 +537,9 @@ # write out version dependency information action = self.newaction(venv, "envreport") with action: - pip = venv.getcommandpath("pip") - output = venv._pcall([str(pip), "freeze"], + python = venv.getcommandpath("python") + args = venv.envconfig.list_dependencies_command + output = venv._pcall(args, cwd=self.config.toxinidir, action=action) # the output contains a mime-header, skip it 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 Mon Jun 20 10:44:28 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:44:28 -0000 Subject: [Pytest-commit] commit/tox: 3 new changesets Message-ID: <20160620144428.14890.95977@celery-worker-104.ash1.bb-inf.net> 3 new commits in tox: https://bitbucket.org/hpk42/tox/commits/2ede3e168404/ Changeset: 2ede3e168404 Branch: fix-flakes User: pjdelport Date: 2016-01-04 13:58:50+00:00 Summary: Mark guarded "unicode" reference with noqa Affected #: 1 file diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r 2ede3e168404325cecdf28e1e20744adaebe38ba tox/_quickstart.py --- a/tox/_quickstart.py +++ b/tox/_quickstart.py @@ -119,7 +119,7 @@ x = term_input(prompt) if default and not x: x = default - if sys.version_info < (3, ) and not isinstance(x, unicode): + if sys.version_info < (3, ) and not isinstance(x, unicode): # noqa # for Python 2.x, try to get a Unicode string out of it if x.decode('ascii', 'replace').encode('ascii', 'replace') != x: if TERM_ENCODING: https://bitbucket.org/hpk42/tox/commits/89df2470da88/ Changeset: 89df2470da88 Branch: fix-flakes User: pjdelport Date: 2016-01-04 14:09:18+00:00 Summary: Remove separating spaces in "print (...)" (pep8 E211) Affected #: 5 files diff -r 2ede3e168404325cecdf28e1e20744adaebe38ba -r 89df2470da88c04a01ae49b0accdb70397ac2fb8 doc/_getdoctarget.py --- a/doc/_getdoctarget.py +++ b/doc/_getdoctarget.py @@ -13,4 +13,4 @@ return ".".join(get_version_string().split(".")[:2]) if __name__ == "__main__": - print (get_minor_version_string()) + print(get_minor_version_string()) diff -r 2ede3e168404325cecdf28e1e20744adaebe38ba -r 89df2470da88c04a01ae49b0accdb70397ac2fb8 tests/test_interpreters.py --- a/tests/test_interpreters.py +++ b/tests/test_interpreters.py @@ -41,7 +41,7 @@ if sys.platform == "win32": pydir = "python%s" % ver.replace(".", "") x = py.path.local("c:\%s" % pydir) - print (x) + print(x) if not x.check(): continue else: diff -r 2ede3e168404325cecdf28e1e20744adaebe38ba -r 89df2470da88c04a01ae49b0accdb70397ac2fb8 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -68,12 +68,12 @@ def generic_report(*args, **kwargs): self._calls.append((name,) + args) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return generic_report def action(self, venv, msg, *args): self._calls.append(("action", venv, msg)) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return Action(self.session, venv, msg, args) def getnext(self, cat): @@ -316,7 +316,7 @@ for p in base.visit(lambda x: x.check(file=1)): manifestlines.append("include %s" % p.relto(base)) create_files(base, {"MANIFEST.in": "\n".join(manifestlines)}) - print ("created project in %s" % (base,)) + print("created project in %s" % (base,)) base.chdir() return initproj diff -r 2ede3e168404325cecdf28e1e20744adaebe38ba -r 89df2470da88c04a01ae49b0accdb70397ac2fb8 tox/interpreters.py --- a/tox/interpreters.py +++ b/tox/interpreters.py @@ -43,10 +43,10 @@ try: res = exec_on_interpreter(info.executable, [inspect.getsource(sitepackagesdir), - "print (sitepackagesdir(%r))" % envdir]) + "print(sitepackagesdir(%r))" % envdir]) except ExecFailed: val = sys.exc_info()[1] - print ("execution failed: %s -- %s" % (val.out, val.err)) + print("execution failed: %s -- %s" % (val.out, val.err)) return "" else: return res["dir"] @@ -56,7 +56,7 @@ assert executable try: result = exec_on_interpreter(executable, - [inspect.getsource(pyinfo), "print (pyinfo())"]) + [inspect.getsource(pyinfo), "print(pyinfo())"]) except ExecFailed: val = sys.exc_info()[1] return NoInterpreterInfo(name, executable=val.executable, diff -r 2ede3e168404325cecdf28e1e20744adaebe38ba -r 89df2470da88c04a01ae49b0accdb70397ac2fb8 tox/result.py --- a/tox/result.py +++ b/tox/result.py @@ -47,9 +47,9 @@ pythonexecutable = py.path.local(pythonexecutable) out = pythonexecutable.sysexec("-c", "import sys; " - "print (sys.executable);" - "print (list(sys.version_info)); " - "print (sys.version)") + "print(sys.executable);" + "print(list(sys.version_info)); " + "print(sys.version)") lines = out.splitlines() executable = lines.pop(0) version_info = eval(lines.pop(0)) https://bitbucket.org/hpk42/tox/commits/365dc0ef97fd/ Changeset: 365dc0ef97fd User: obestwalter Date: 2016-06-20 14:44:22+00:00 Summary: Merged in pjdelport/tox/fix-flakes (pull request #187) Make "tox -e flakes" pass Affected #: 6 files diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 doc/_getdoctarget.py --- a/doc/_getdoctarget.py +++ b/doc/_getdoctarget.py @@ -13,4 +13,4 @@ return ".".join(get_version_string().split(".")[:2]) if __name__ == "__main__": - print (get_minor_version_string()) + print(get_minor_version_string()) diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tests/test_interpreters.py --- a/tests/test_interpreters.py +++ b/tests/test_interpreters.py @@ -41,7 +41,7 @@ if sys.platform == "win32": pydir = "python%s" % ver.replace(".", "") x = py.path.local("c:\%s" % pydir) - print (x) + print(x) if not x.check(): continue else: diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -68,12 +68,12 @@ def generic_report(*args, **kwargs): self._calls.append((name,) + args) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return generic_report def action(self, venv, msg, *args): self._calls.append(("action", venv, msg)) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return Action(self.session, venv, msg, args) def getnext(self, cat): @@ -319,7 +319,7 @@ for p in base.visit(lambda x: x.check(file=1)): manifestlines.append("include %s" % p.relto(base)) create_files(base, {"MANIFEST.in": "\n".join(manifestlines)}) - print ("created project in %s" % (base,)) + print("created project in %s" % (base,)) base.chdir() return initproj diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/_quickstart.py --- a/tox/_quickstart.py +++ b/tox/_quickstart.py @@ -119,7 +119,7 @@ x = term_input(prompt) if default and not x: x = default - if sys.version_info < (3, ) and not isinstance(x, unicode): + if sys.version_info < (3, ) and not isinstance(x, unicode): # noqa # for Python 2.x, try to get a Unicode string out of it if x.decode('ascii', 'replace').encode('ascii', 'replace') != x: if TERM_ENCODING: diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/interpreters.py --- a/tox/interpreters.py +++ b/tox/interpreters.py @@ -43,10 +43,10 @@ try: res = exec_on_interpreter(info.executable, [inspect.getsource(sitepackagesdir), - "print (sitepackagesdir(%r))" % envdir]) + "print(sitepackagesdir(%r))" % envdir]) except ExecFailed: val = sys.exc_info()[1] - print ("execution failed: %s -- %s" % (val.out, val.err)) + print("execution failed: %s -- %s" % (val.out, val.err)) return "" else: return res["dir"] @@ -56,7 +56,7 @@ assert executable try: result = exec_on_interpreter(executable, - [inspect.getsource(pyinfo), "print (pyinfo())"]) + [inspect.getsource(pyinfo), "print(pyinfo())"]) except ExecFailed: val = sys.exc_info()[1] return NoInterpreterInfo(name, executable=val.executable, diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/result.py --- a/tox/result.py +++ b/tox/result.py @@ -47,9 +47,9 @@ pythonexecutable = py.path.local(pythonexecutable) out = pythonexecutable.sysexec("-c", "import sys; " - "print (sys.executable);" - "print (list(sys.version_info)); " - "print (sys.version)") + "print(sys.executable);" + "print(list(sys.version_info)); " + "print(sys.version)") lines = out.splitlines() executable = lines.pop(0) version_info = eval(lines.pop(0)) 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 Mon Jun 20 10:44:24 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:44:24 -0000 Subject: [Pytest-commit] commit/tox: obestwalter: Merged in pjdelport/tox/fix-flakes (pull request #187) Message-ID: <20160620144424.9971.14383@celery-worker-101.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/365dc0ef97fd/ Changeset: 365dc0ef97fd User: obestwalter Date: 2016-06-20 14:44:22+00:00 Summary: Merged in pjdelport/tox/fix-flakes (pull request #187) Make "tox -e flakes" pass Affected #: 6 files diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 doc/_getdoctarget.py --- a/doc/_getdoctarget.py +++ b/doc/_getdoctarget.py @@ -13,4 +13,4 @@ return ".".join(get_version_string().split(".")[:2]) if __name__ == "__main__": - print (get_minor_version_string()) + print(get_minor_version_string()) diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tests/test_interpreters.py --- a/tests/test_interpreters.py +++ b/tests/test_interpreters.py @@ -41,7 +41,7 @@ if sys.platform == "win32": pydir = "python%s" % ver.replace(".", "") x = py.path.local("c:\%s" % pydir) - print (x) + print(x) if not x.check(): continue else: diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -68,12 +68,12 @@ def generic_report(*args, **kwargs): self._calls.append((name,) + args) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return generic_report def action(self, venv, msg, *args): self._calls.append(("action", venv, msg)) - print ("%s" % (self._calls[-1], )) + print("%s" % (self._calls[-1], )) return Action(self.session, venv, msg, args) def getnext(self, cat): @@ -319,7 +319,7 @@ for p in base.visit(lambda x: x.check(file=1)): manifestlines.append("include %s" % p.relto(base)) create_files(base, {"MANIFEST.in": "\n".join(manifestlines)}) - print ("created project in %s" % (base,)) + print("created project in %s" % (base,)) base.chdir() return initproj diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/_quickstart.py --- a/tox/_quickstart.py +++ b/tox/_quickstart.py @@ -119,7 +119,7 @@ x = term_input(prompt) if default and not x: x = default - if sys.version_info < (3, ) and not isinstance(x, unicode): + if sys.version_info < (3, ) and not isinstance(x, unicode): # noqa # for Python 2.x, try to get a Unicode string out of it if x.decode('ascii', 'replace').encode('ascii', 'replace') != x: if TERM_ENCODING: diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/interpreters.py --- a/tox/interpreters.py +++ b/tox/interpreters.py @@ -43,10 +43,10 @@ try: res = exec_on_interpreter(info.executable, [inspect.getsource(sitepackagesdir), - "print (sitepackagesdir(%r))" % envdir]) + "print(sitepackagesdir(%r))" % envdir]) except ExecFailed: val = sys.exc_info()[1] - print ("execution failed: %s -- %s" % (val.out, val.err)) + print("execution failed: %s -- %s" % (val.out, val.err)) return "" else: return res["dir"] @@ -56,7 +56,7 @@ assert executable try: result = exec_on_interpreter(executable, - [inspect.getsource(pyinfo), "print (pyinfo())"]) + [inspect.getsource(pyinfo), "print(pyinfo())"]) except ExecFailed: val = sys.exc_info()[1] return NoInterpreterInfo(name, executable=val.executable, diff -r 73d3b0cabef07d45135b61848f86c17ebe3b13f9 -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 tox/result.py --- a/tox/result.py +++ b/tox/result.py @@ -47,9 +47,9 @@ pythonexecutable = py.path.local(pythonexecutable) out = pythonexecutable.sysexec("-c", "import sys; " - "print (sys.executable);" - "print (list(sys.version_info)); " - "print (sys.version)") + "print(sys.executable);" + "print(list(sys.version_info)); " + "print(sys.version)") lines = out.splitlines() executable = lines.pop(0) version_info = eval(lines.pop(0)) 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 Mon Jun 20 10:45:14 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:45:14 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620144514.18297.40725@celery-worker-103.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/fdff7224c553/ Changeset: fdff7224c553 Branch: bittner/remove-invalid-return-value-in-toxcmdlin-1465935081972 User: bittner Date: 2016-06-14 20:11:23+00:00 Summary: Remove invalid return value in tox.cmdline() example Affected #: 1 file diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r fdff7224c55377485222377f3e870218d19fabfa doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -260,8 +260,7 @@ args = self.tox_args if args: args = shlex.split(self.tox_args) - errno = tox.cmdline(args=args) - sys.exit(errno) + tox.cmdline(args=args) setup( #..., https://bitbucket.org/hpk42/tox/commits/1503c3a65bc8/ Changeset: 1503c3a65bc8 User: hpk42 Date: 2016-06-20 14:45:10+00:00 Summary: Merged in bittner/tox/bittner/remove-invalid-return-value-in-toxcmdlin-1465935081972 (pull request #196) Remove invalid return value in tox.cmdline() example Affected #: 1 file diff -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 -r 1503c3a65bc8035d091155fcf410cf24d07dd677 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -260,8 +260,7 @@ args = self.tox_args if args: args = shlex.split(self.tox_args) - errno = tox.cmdline(args=args) - sys.exit(errno) + tox.cmdline(args=args) setup( #..., 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 Mon Jun 20 10:45:11 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 14:45:11 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in bittner/tox/bittner/remove-invalid-return-value-in-toxcmdlin-1465935081972 (pull request #196) Message-ID: <20160620144511.12105.17636@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/1503c3a65bc8/ Changeset: 1503c3a65bc8 User: hpk42 Date: 2016-06-20 14:45:10+00:00 Summary: Merged in bittner/tox/bittner/remove-invalid-return-value-in-toxcmdlin-1465935081972 (pull request #196) Remove invalid return value in tox.cmdline() example Affected #: 1 file diff -r 365dc0ef97fdf052ae258d73b0f0b4ac10c17ed5 -r 1503c3a65bc8035d091155fcf410cf24d07dd677 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -260,8 +260,7 @@ args = self.tox_args if args: args = shlex.split(self.tox_args) - errno = tox.cmdline(args=args) - sys.exit(errno) + tox.cmdline(args=args) setup( #..., 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 Mon Jun 20 11:09:12 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:09:12 -0000 Subject: [Pytest-commit] commit/tox: aostr123: Merged in wscheper/tox/config-in-setup-cfg (pull request #192) Message-ID: <20160620150912.18946.11076@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/9f48a8fc6246/ Changeset: 9f48a8fc6246 User: aostr123 Date: 2016-06-20 15:09:00+00:00 Summary: Merged in wscheper/tox/config-in-setup-cfg (pull request #192) Support configuration through setup.cfg Affected #: 2 files diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -646,6 +646,55 @@ py.test.raises(tox.exception.ConfigError, 'reader.getbool("key5")') +class TestIniParserPrefix: + def test_basic_section_access(self, tmpdir, newconfig): + config = newconfig(""" + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "value" + assert not reader.getstring("hello") + x = reader.getstring("hello", "world") + assert x == "world" + + def test_fallback_sections(self, tmpdir, newconfig): + config = newconfig(""" + [p:mydefault] + key2=value2 + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p", + fallbacksections=['p:mydefault']) + x = reader.getstring("key2") + assert x == "value2" + x = reader.getstring("key3") + assert not x + x = reader.getstring("key3", "world") + assert x == "world" + + def test_value_matches_prefixed_section_substituion(self): + assert is_section_substitution("{[p:setup]commands}") + + def test_value_doesn_match_prefixed_section_substitution(self): + assert is_section_substitution("{[p: ]commands}") is None + assert is_section_substitution("{[p:setup]}") is None + assert is_section_substitution("{[p:setup] commands}") is None + + def test_other_section_substitution(self, newconfig): + config = newconfig(""" + [p:section] + key = rue + [p:testenv] + key = t{[p:section]key} + """) + reader = SectionReader("testenv", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "true" + + class TestConfigTestEnv: def test_commentchars_issue33(self, tmpdir, newconfig): config = newconfig(""" diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -225,7 +225,10 @@ if inipath.check(): break else: - feedback("toxini file %r not found" % (basename), sysexit=True) + inipath = py.path.local().join('setup.cfg') + if not inipath.check(): + feedback("toxini file %r not found" % (basename), sysexit=True) + try: parseini(config, inipath) except tox.exception.InterpreterNotFound: @@ -652,12 +655,18 @@ self._cfg = py.iniconfig.IniConfig(config.toxinipath) config._cfg = self._cfg self.config = config + + if inipath.basename == 'setup.cfg': + prefix = 'tox' + else: + prefix = None ctxname = getcontextname() if ctxname == "jenkins": - reader = SectionReader("tox:jenkins", self._cfg, fallbacksections=['tox']) + reader = SectionReader("tox:jenkins", self._cfg, prefix=prefix, + fallbacksections=['tox']) distshare_default = "{toxworkdir}/distshare" elif not ctxname: - reader = SectionReader("tox", self._cfg) + reader = SectionReader("tox", self._cfg, prefix=prefix) distshare_default = "{homedir}/.tox/distshare" else: raise ValueError("invalid context") @@ -871,8 +880,12 @@ class SectionReader: - def __init__(self, section_name, cfgparser, fallbacksections=None, factors=()): - self.section_name = section_name + def __init__(self, section_name, cfgparser, fallbacksections=None, + factors=(), prefix=None): + if prefix is None: + self.section_name = section_name + else: + self.section_name = "%s:%s" % (prefix, section_name) self._cfg = cfgparser self.fallbacksections = fallbacksections or [] self.factors = factors 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 Mon Jun 20 11:09:13 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:09:13 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620150913.12596.63648@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/7d13d24f0d04/ Changeset: 7d13d24f0d04 Branch: config-in-setup-cfg User: Walter Scheper Date: 2016-03-11 02:43:49+00:00 Summary: Support configuration through setup.cfg When the usual search for a config file fails, try loading setup.cfg with a section prefix of tox. Modeled on coverage's use of setup.cfg as an alternative config file. Affected #: 2 files diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r 7d13d24f0d0463663c75a5b4ccac7c5a8eb37b6f tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -632,6 +632,55 @@ py.test.raises(tox.exception.ConfigError, 'reader.getbool("key5")') +class TestIniParserPrefix: + def test_basic_section_access(self, tmpdir, newconfig): + config = newconfig(""" + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "value" + assert not reader.getstring("hello") + x = reader.getstring("hello", "world") + assert x == "world" + + def test_fallback_sections(self, tmpdir, newconfig): + config = newconfig(""" + [p:mydefault] + key2=value2 + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p", + fallbacksections=['p:mydefault']) + x = reader.getstring("key2") + assert x == "value2" + x = reader.getstring("key3") + assert not x + x = reader.getstring("key3", "world") + assert x == "world" + + def test_value_matches_prefixed_section_substituion(self): + assert is_section_substitution("{[p:setup]commands}") + + def test_value_doesn_match_prefixed_section_substitution(self): + assert is_section_substitution("{[p: ]commands}") is None + assert is_section_substitution("{[p:setup]}") is None + assert is_section_substitution("{[p:setup] commands}") is None + + def test_other_section_substitution(self, newconfig): + config = newconfig(""" + [p:section] + key = rue + [p:testenv] + key = t{[p:section]key} + """) + reader = SectionReader("testenv", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "true" + + class TestConfigTestEnv: def test_commentchars_issue33(self, tmpdir, newconfig): config = newconfig(""" diff -r 4dbfb1f1eb86b35cbd2c83461e1e294651e89cf6 -r 7d13d24f0d0463663c75a5b4ccac7c5a8eb37b6f tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -224,7 +224,10 @@ if inipath.check(): break else: - feedback("toxini file %r not found" % (basename), sysexit=True) + inipath = py.path.local().join('setup.cfg') + if not inipath.check(): + feedback("toxini file %r not found" % (basename), sysexit=True) + try: parseini(config, inipath) except tox.exception.InterpreterNotFound: @@ -644,12 +647,18 @@ self._cfg = py.iniconfig.IniConfig(config.toxinipath) config._cfg = self._cfg self.config = config + + if inipath.basename == 'setup.cfg': + prefix = 'tox' + else: + prefix = None ctxname = getcontextname() if ctxname == "jenkins": - reader = SectionReader("tox:jenkins", self._cfg, fallbacksections=['tox']) + reader = SectionReader("tox:jenkins", self._cfg, prefix=prefix, + fallbacksections=['tox']) distshare_default = "{toxworkdir}/distshare" elif not ctxname: - reader = SectionReader("tox", self._cfg) + reader = SectionReader("tox", self._cfg, prefix=prefix) distshare_default = "{homedir}/.tox/distshare" else: raise ValueError("invalid context") @@ -853,8 +862,12 @@ class SectionReader: - def __init__(self, section_name, cfgparser, fallbacksections=None, factors=()): - self.section_name = section_name + def __init__(self, section_name, cfgparser, fallbacksections=None, + factors=(), prefix=None): + if prefix is None: + self.section_name = section_name + else: + self.section_name = "%s:%s" % (prefix, section_name) self._cfg = cfgparser self.fallbacksections = fallbacksections or [] self.factors = factors https://bitbucket.org/hpk42/tox/commits/9f48a8fc6246/ Changeset: 9f48a8fc6246 User: aostr123 Date: 2016-06-20 15:09:00+00:00 Summary: Merged in wscheper/tox/config-in-setup-cfg (pull request #192) Support configuration through setup.cfg Affected #: 2 files diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -646,6 +646,55 @@ py.test.raises(tox.exception.ConfigError, 'reader.getbool("key5")') +class TestIniParserPrefix: + def test_basic_section_access(self, tmpdir, newconfig): + config = newconfig(""" + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "value" + assert not reader.getstring("hello") + x = reader.getstring("hello", "world") + assert x == "world" + + def test_fallback_sections(self, tmpdir, newconfig): + config = newconfig(""" + [p:mydefault] + key2=value2 + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p", + fallbacksections=['p:mydefault']) + x = reader.getstring("key2") + assert x == "value2" + x = reader.getstring("key3") + assert not x + x = reader.getstring("key3", "world") + assert x == "world" + + def test_value_matches_prefixed_section_substituion(self): + assert is_section_substitution("{[p:setup]commands}") + + def test_value_doesn_match_prefixed_section_substitution(self): + assert is_section_substitution("{[p: ]commands}") is None + assert is_section_substitution("{[p:setup]}") is None + assert is_section_substitution("{[p:setup] commands}") is None + + def test_other_section_substitution(self, newconfig): + config = newconfig(""" + [p:section] + key = rue + [p:testenv] + key = t{[p:section]key} + """) + reader = SectionReader("testenv", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "true" + + class TestConfigTestEnv: def test_commentchars_issue33(self, tmpdir, newconfig): config = newconfig(""" diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -225,7 +225,10 @@ if inipath.check(): break else: - feedback("toxini file %r not found" % (basename), sysexit=True) + inipath = py.path.local().join('setup.cfg') + if not inipath.check(): + feedback("toxini file %r not found" % (basename), sysexit=True) + try: parseini(config, inipath) except tox.exception.InterpreterNotFound: @@ -652,12 +655,18 @@ self._cfg = py.iniconfig.IniConfig(config.toxinipath) config._cfg = self._cfg self.config = config + + if inipath.basename == 'setup.cfg': + prefix = 'tox' + else: + prefix = None ctxname = getcontextname() if ctxname == "jenkins": - reader = SectionReader("tox:jenkins", self._cfg, fallbacksections=['tox']) + reader = SectionReader("tox:jenkins", self._cfg, prefix=prefix, + fallbacksections=['tox']) distshare_default = "{toxworkdir}/distshare" elif not ctxname: - reader = SectionReader("tox", self._cfg) + reader = SectionReader("tox", self._cfg, prefix=prefix) distshare_default = "{homedir}/.tox/distshare" else: raise ValueError("invalid context") @@ -871,8 +880,12 @@ class SectionReader: - def __init__(self, section_name, cfgparser, fallbacksections=None, factors=()): - self.section_name = section_name + def __init__(self, section_name, cfgparser, fallbacksections=None, + factors=(), prefix=None): + if prefix is None: + self.section_name = section_name + else: + self.section_name = "%s:%s" % (prefix, section_name) self._cfg = cfgparser self.fallbacksections = fallbacksections or [] self.factors = factors 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 Mon Jun 20 11:19:16 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:19:16 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: make flakes pass Message-ID: <20160620151916.72864.58865@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/3cd1b63c0306/ Changeset: 3cd1b63c0306 Branch: issue336 User: Oliver Bestwalter Date: 2016-06-20 15:18:50+00:00 Summary: make flakes pass Affected #: 5 files diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 3cd1b63c0306d1f99248b1a2fb69f83f05857283 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1441,7 +1441,7 @@ minversion = 10.0 """ with py.test.raises(tox.exception.MinVersionError): - config = newconfig([], inisource) + newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 3cd1b63c0306d1f99248b1a2fb69f83f05857283 tox.ini --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = pytest-flakes>=0.2 pytest-pep8 -commands = +commands = py.test --flakes -m flakes tox tests py.test --pep8 -m pep8 tox tests @@ -60,3 +60,4 @@ # E731 - do not assign a lambda expression, use a def pep8ignore = *.py W503 E402 E731 +flakes-ignore = ImportStarUsage diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 3cd1b63c0306d1f99248b1a2fb69f83f05857283 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -195,7 +195,7 @@ return py.std.subprocess.Popen(argv, stdout=stdout, stderr=stderr, **kw) def run(self, *argv): - if argv[0] == "tox" and sys.version_info[:2] < (2,7): + if argv[0] == "tox" and sys.version_info[:2] < (2, 7): pytest.skip("can not run tests involving calling tox on python2.6. " "(and python2.6 is about to be deprecated anyway)") argv = [str(x) for x in argv] diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 3cd1b63c0306d1f99248b1a2fb69f83f05857283 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -520,10 +520,10 @@ parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute( - name = "list_dependencies_command", - type = "argv", - default = "python -m pip freeze", - help = "list dependencies for a virtual environment") + name="list_dependencies_command", + type="argv", + default="python -m pip freeze", + help="list dependencies for a virtual environment") parser.add_testenv_attribute_obj(DepOption()) diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 3cd1b63c0306d1f99248b1a2fb69f83f05857283 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -537,7 +537,6 @@ # write out version dependency information action = self.newaction(venv, "envreport") with action: - python = venv.getcommandpath("python") args = venv.envconfig.list_dependencies_command output = venv._pcall(args, cwd=self.config.toxinidir, 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 Mon Jun 20 11:27:47 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:27:47 -0000 Subject: [Pytest-commit] commit/tox: aostr123: Close branch issue336 Message-ID: <20160620152747.74172.83139@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/c11ab4d3bbe3/ Changeset: c11ab4d3bbe3 Branch: issue336 User: aostr123 Date: 2016-06-20 15:27:44+00:00 Summary: Close branch issue336 Affected #: 0 files 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 Mon Jun 20 11:27:53 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:27:53 -0000 Subject: [Pytest-commit] commit/tox: aostr123: Merged in issue336 (pull request #198) Message-ID: <20160620152753.32257.25592@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/17f5a90a5fd9/ Changeset: 17f5a90a5fd9 User: aostr123 Date: 2016-06-20 15:27:44+00:00 Summary: Merged in issue336 (pull request #198) #336 make flakes pass Affected #: 5 files diff -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 -r 17f5a90a5fd9c6f394e84228f3f97095c3eb2098 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1490,7 +1490,7 @@ minversion = 10.0 """ with py.test.raises(tox.exception.MinVersionError): - config = newconfig([], inisource) + newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 -r 17f5a90a5fd9c6f394e84228f3f97095c3eb2098 tox.ini --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = pytest-flakes>=0.2 pytest-pep8 -commands = +commands = py.test --flakes -m flakes tox tests py.test --pep8 -m pep8 tox tests @@ -60,3 +60,4 @@ # E731 - do not assign a lambda expression, use a def pep8ignore = *.py W503 E402 E731 +flakes-ignore = ImportStarUsage diff -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 -r 17f5a90a5fd9c6f394e84228f3f97095c3eb2098 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -195,7 +195,7 @@ return py.std.subprocess.Popen(argv, stdout=stdout, stderr=stderr, **kw) def run(self, *argv): - if argv[0] == "tox" and sys.version_info[:2] < (2,7): + if argv[0] == "tox" and sys.version_info[:2] < (2, 7): pytest.skip("can not run tests involving calling tox on python2.6. " "(and python2.6 is about to be deprecated anyway)") argv = [str(x) for x in argv] diff -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 -r 17f5a90a5fd9c6f394e84228f3f97095c3eb2098 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -523,10 +523,10 @@ parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute( - name = "list_dependencies_command", - type = "argv", - default = "python -m pip freeze", - help = "list dependencies for a virtual environment") + name="list_dependencies_command", + type="argv", + default="python -m pip freeze", + help="list dependencies for a virtual environment") parser.add_testenv_attribute_obj(DepOption()) diff -r 9f48a8fc624684ca6b5ea93ff36463850b3854b7 -r 17f5a90a5fd9c6f394e84228f3f97095c3eb2098 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -537,7 +537,6 @@ # write out version dependency information action = self.newaction(venv, "envreport") with action: - python = venv.getcommandpath("python") args = venv.envconfig.list_dependencies_command output = venv._pcall(args, cwd=self.config.toxinidir, 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 Mon Jun 20 11:41:04 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 15:41:04 -0000 Subject: [Pytest-commit] commit/tox: 4 new changesets Message-ID: <20160620154104.16447.20507@celery-worker-101.ash1.bb-inf.net> 4 new commits in tox: https://bitbucket.org/hpk42/tox/commits/a0ee20aeee1a/ Changeset: a0ee20aeee1a User: danring Date: 2015-12-17 20:44:22+00:00 Summary: Add --workdir to override the 'toxworkdir' config option Affected #: 1 file diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r a0ee20aeee1a0b458e1804290cdd6dbda2bf8313 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -366,6 +366,9 @@ help="override sitepackages setting to True in all envs") parser.add_argument("--skip-missing-interpreters", action="store_true", help="don't fail tests for missing interpreters") + parser.add_argument("--workdir", action="store", + dest="workdir", metavar="PATH", default=None, + help="tox working directory") parser.add_argument("args", nargs="*", help="additional arguments available to command positional substitution") @@ -664,7 +667,10 @@ reader.addsubstitutions(toxinidir=config.toxinidir, homedir=config.homedir) - config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") + if config.option.workdir is None: + config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") + else: + config.toxworkdir = config.toxinidir.join(config.option.workdir, abs=True) config.minversion = reader.getstring("minversion", None) if not config.option.skip_missing_interpreters: https://bitbucket.org/hpk42/tox/commits/fe3f43b80f63/ Changeset: fe3f43b80f63 User: danring Date: 2015-12-17 20:44:52+00:00 Summary: Add test for --workdir command line option Affected #: 1 file diff -r a0ee20aeee1a0b458e1804290cdd6dbda2bf8313 -r fe3f43b80f6309d739fd000c2320ca2f4a0b2f1b tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1837,6 +1837,23 @@ "*ERROR*tox.ini*not*found*", ]) + def test_override_workdir(self, tmpdir, cmd, initproj): + baddir = "badworkdir-123" + gooddir = "overridden-234" + initproj("overrideworkdir-0.5", filedefs={ + 'tox.ini': ''' + [tox] + toxworkdir=%s + ''' % baddir, + }) + result = cmd.run("tox", "--workdir", gooddir, "--showconfig") + assert not result.ret + stdout = result.stdout.str() + assert gooddir in stdout + assert baddir not in stdout + assert py.path.local(gooddir).check() + assert not py.path.local(baddir).check() + def test_showconfig_with_force_dep_version(self, cmd, initproj): initproj('force_dep_version', filedefs={ 'tox.ini': ''' https://bitbucket.org/hpk42/tox/commits/6fc76acddcf0/ Changeset: 6fc76acddcf0 User: hpk42 Date: 2016-06-20 15:38:24+00:00 Summary: add --workdir option to override where tox stores its ".tox" directory and all of the virtualenv environment. Thanks Danring. Affected #: 3 files diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ 2.4.0 ----- +- add --workdir option to override where tox stores its ".tox" directory + and all of the virtualenv environment. Thanks Danring. + - introduce per-venv list_dependencies_command which defaults to "python -m pip freeze" to obtain the list of installed packages. If you need to run python2.6 you need to configure it to diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1865,6 +1865,23 @@ "*ERROR*tox.ini*not*found*", ]) + def test_override_workdir(self, tmpdir, cmd, initproj): + baddir = "badworkdir-123" + gooddir = "overridden-234" + initproj("overrideworkdir-0.5", filedefs={ + 'tox.ini': ''' + [tox] + toxworkdir=%s + ''' % baddir, + }) + result = cmd.run("tox", "--workdir", gooddir, "--showconfig") + assert not result.ret + stdout = result.stdout.str() + assert gooddir in stdout + assert baddir not in stdout + assert py.path.local(gooddir).check() + assert not py.path.local(baddir).check() + def test_showconfig_with_force_dep_version(self, cmd, initproj): initproj('force_dep_version', filedefs={ 'tox.ini': ''' diff -r 1503c3a65bc8035d091155fcf410cf24d07dd677 -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -367,6 +367,9 @@ help="override sitepackages setting to True in all envs") parser.add_argument("--skip-missing-interpreters", action="store_true", help="don't fail tests for missing interpreters") + parser.add_argument("--workdir", action="store", + dest="workdir", metavar="PATH", default=None, + help="tox working directory") parser.add_argument("args", nargs="*", help="additional arguments available to command positional substitution") @@ -675,7 +678,6 @@ # As older versions of tox may have bugs or incompatabilities that # prevent parsing of tox.ini this must be the first thing checked. config.minversion = reader.getstring("minversion", None) - # Parse our compatability immediately if config.minversion: minversion = NormalizedVersion(self.config.minversion) toxversion = NormalizedVersion(tox.__version__) @@ -683,7 +685,10 @@ raise tox.exception.MinVersionError( "tox version is %s, required is at least %s" % ( toxversion, minversion)) - config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") + if config.option.workdir is None: + config.toxworkdir = reader.getpath("toxworkdir", "{toxinidir}/.tox") + else: + config.toxworkdir = config.toxinidir.join(config.option.workdir, abs=True) if not config.option.skip_missing_interpreters: config.option.skip_missing_interpreters = \ https://bitbucket.org/hpk42/tox/commits/bb377f12d053/ Changeset: bb377f12d053 User: hpk42 Date: 2016-06-20 15:40:38+00:00 Summary: merge Affected #: 5 files diff -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 -r bb377f12d053fb136deb0ba973f2444385acf233 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -646,6 +646,55 @@ py.test.raises(tox.exception.ConfigError, 'reader.getbool("key5")') +class TestIniParserPrefix: + def test_basic_section_access(self, tmpdir, newconfig): + config = newconfig(""" + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "value" + assert not reader.getstring("hello") + x = reader.getstring("hello", "world") + assert x == "world" + + def test_fallback_sections(self, tmpdir, newconfig): + config = newconfig(""" + [p:mydefault] + key2=value2 + [p:section] + key=value + """) + reader = SectionReader("section", config._cfg, prefix="p", + fallbacksections=['p:mydefault']) + x = reader.getstring("key2") + assert x == "value2" + x = reader.getstring("key3") + assert not x + x = reader.getstring("key3", "world") + assert x == "world" + + def test_value_matches_prefixed_section_substituion(self): + assert is_section_substitution("{[p:setup]commands}") + + def test_value_doesn_match_prefixed_section_substitution(self): + assert is_section_substitution("{[p: ]commands}") is None + assert is_section_substitution("{[p:setup]}") is None + assert is_section_substitution("{[p:setup] commands}") is None + + def test_other_section_substitution(self, newconfig): + config = newconfig(""" + [p:section] + key = rue + [p:testenv] + key = t{[p:section]key} + """) + reader = SectionReader("testenv", config._cfg, prefix="p") + x = reader.getstring("key") + assert x == "true" + + class TestConfigTestEnv: def test_commentchars_issue33(self, tmpdir, newconfig): config = newconfig(""" @@ -1441,7 +1490,7 @@ minversion = 10.0 """ with py.test.raises(tox.exception.MinVersionError): - config = newconfig([], inisource) + newconfig([], inisource) def test_skip_missing_interpreters_true(self, tmpdir, newconfig, monkeypatch): inisource = """ diff -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 -r bb377f12d053fb136deb0ba973f2444385acf233 tox.ini --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = pytest-flakes>=0.2 pytest-pep8 -commands = +commands = py.test --flakes -m flakes tox tests py.test --pep8 -m pep8 tox tests @@ -60,3 +60,4 @@ # E731 - do not assign a lambda expression, use a def pep8ignore = *.py W503 E402 E731 +flakes-ignore = ImportStarUsage diff -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 -r bb377f12d053fb136deb0ba973f2444385acf233 tox/_pytestplugin.py --- a/tox/_pytestplugin.py +++ b/tox/_pytestplugin.py @@ -195,7 +195,7 @@ return py.std.subprocess.Popen(argv, stdout=stdout, stderr=stderr, **kw) def run(self, *argv): - if argv[0] == "tox" and sys.version_info[:2] < (2,7): + if argv[0] == "tox" and sys.version_info[:2] < (2, 7): pytest.skip("can not run tests involving calling tox on python2.6. " "(and python2.6 is about to be deprecated anyway)") argv = [str(x) for x in argv] diff -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 -r bb377f12d053fb136deb0ba973f2444385acf233 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -225,7 +225,10 @@ if inipath.check(): break else: - feedback("toxini file %r not found" % (basename), sysexit=True) + inipath = py.path.local().join('setup.cfg') + if not inipath.check(): + feedback("toxini file %r not found" % (basename), sysexit=True) + try: parseini(config, inipath) except tox.exception.InterpreterNotFound: @@ -523,10 +526,10 @@ parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute( - name = "list_dependencies_command", - type = "argv", - default = "python -m pip freeze", - help = "list dependencies for a virtual environment") + name="list_dependencies_command", + type="argv", + default="python -m pip freeze", + help="list dependencies for a virtual environment") parser.add_testenv_attribute_obj(DepOption()) @@ -655,12 +658,18 @@ self._cfg = py.iniconfig.IniConfig(config.toxinipath) config._cfg = self._cfg self.config = config + + if inipath.basename == 'setup.cfg': + prefix = 'tox' + else: + prefix = None ctxname = getcontextname() if ctxname == "jenkins": - reader = SectionReader("tox:jenkins", self._cfg, fallbacksections=['tox']) + reader = SectionReader("tox:jenkins", self._cfg, prefix=prefix, + fallbacksections=['tox']) distshare_default = "{toxworkdir}/distshare" elif not ctxname: - reader = SectionReader("tox", self._cfg) + reader = SectionReader("tox", self._cfg, prefix=prefix) distshare_default = "{homedir}/.tox/distshare" else: raise ValueError("invalid context") @@ -876,8 +885,12 @@ class SectionReader: - def __init__(self, section_name, cfgparser, fallbacksections=None, factors=()): - self.section_name = section_name + def __init__(self, section_name, cfgparser, fallbacksections=None, + factors=(), prefix=None): + if prefix is None: + self.section_name = section_name + else: + self.section_name = "%s:%s" % (prefix, section_name) self._cfg = cfgparser self.fallbacksections = fallbacksections or [] self.factors = factors diff -r 6fc76acddcf099546473bfd61feb6d0bbbf2c0d7 -r bb377f12d053fb136deb0ba973f2444385acf233 tox/session.py --- a/tox/session.py +++ b/tox/session.py @@ -537,7 +537,6 @@ # write out version dependency information action = self.newaction(venv, "envreport") with action: - python = venv.getcommandpath("python") args = venv.envconfig.list_dependencies_command output = venv._pcall(args, cwd=self.config.toxinidir, 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 Mon Jun 20 12:01:10 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:01:10 -0000 Subject: [Pytest-commit] commit/tox: d6e: Merged in jtpereyda/tox/jtpereyda-cleanup (pull request #194) Message-ID: <20160620160110.23973.78307@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/bf8008c08c73/ Changeset: bf8008c08c73 User: d6e Date: 2016-06-20 16:01:01+00:00 Summary: Merged in jtpereyda/tox/jtpereyda-cleanup (pull request #194) Cleanup: VirtualEnv.getcommandpath Affected #: 1 file diff -r bb377f12d053fb136deb0ba973f2444385acf233 -r bf8008c08c7361c18730c458032e875d97a97e90 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -79,38 +79,53 @@ return "" % (self.path) def getcommandpath(self, name, venv=True, cwd=None): - """ return absolute path (str or localpath) for specified - command name. If it's a localpath we will rewrite it as - as a relative path. If venv is True we will check if the - command is coming from the venv or is whitelisted to come - from external. """ + """ Return absolute path (str or localpath) for specified command name. + - If it's a local path we will rewrite it as as a relative path. + - If venv is True we will check if the command is coming from the venv + or is whitelisted to come from external. + """ name = str(name) if os.path.isabs(name): return name if os.path.split(name)[0] == ".": - p = cwd.join(name) - if p.check(): - return str(p) - p = None + path = cwd.join(name) + if path.check(): + return str(path) + if venv: - p = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) - if p is not None: - return p - p = py.path.local.sysfind(name) - if p is None: + path = self._venv_lookup_and_check_external_whitelist(name) + else: + path = self._normal_lookup(name) + + if path is None: raise tox.exception.InvocationError( "could not find executable %r" % (name,)) - # p is not found in virtualenv script/bin dir - if venv: - if not self.is_allowed_external(p): - self.session.report.warning( + + return str(path) # will not be rewritten for reporting + + def _venv_lookup_and_check_external_whitelist(self, name): + path = self._venv_lookup(name) + if path is None: + path = self._normal_lookup(name) + if path is not None: + self._check_external_allowed_and_warn(path) + return path + + def _venv_lookup(self, name): + return py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + + def _normal_lookup(self, name): + return py.path.local.sysfind(name) + + def _check_external_allowed_and_warn(self, path): + if not self.is_allowed_external(path): + self.session.report.warning( "test command found but not installed in testenv\n" " cmd: %s\n" " env: %s\n" "Maybe you forgot to specify a dependency? " "See also the whitelist_externals envconfig setting." % ( - p, self.envconfig.envdir)) - return str(p) # will not be rewritten for reporting + path, self.envconfig.envdir)) def is_allowed_external(self, p): tryadd = [""] 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 Mon Jun 20 12:01:04 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:01:04 -0000 Subject: [Pytest-commit] commit/tox: 7 new changesets Message-ID: <20160620160104.6967.62222@celery-worker-101.ash1.bb-inf.net> 7 new commits in tox: https://bitbucket.org/hpk42/tox/commits/2be7146133cb/ Changeset: 2be7146133cb Branch: jtpereyda-cleanup User: jtpereyda Date: 2016-04-14 18:56:58+00:00 Summary: Created new branch jtpereyda-cleanup Affected #: 0 files https://bitbucket.org/hpk42/tox/commits/87e8123dfc61/ Changeset: 87e8123dfc61 Branch: jtpereyda-cleanup User: joshpere Date: 2016-04-14 18:59:37+00:00 Summary: Cleanup: Rename local variable for clarity Affected #: 1 file diff -r 2be7146133cbccdca10525aab31a32ee53575af9 -r 87e8123dfc61ccde46337ce664647b685c63d4a9 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -88,29 +88,29 @@ if os.path.isabs(name): return name if os.path.split(name)[0] == ".": - p = cwd.join(name) - if p.check(): - return str(p) - p = None + path = cwd.join(name) + if path.check(): + return str(path) + path = None if venv: - p = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) - if p is not None: - return p - p = py.path.local.sysfind(name) - if p is None: + path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + if path is not None: + return path + path = py.path.local.sysfind(name) + if path is None: raise tox.exception.InvocationError( "could not find executable %r" % (name,)) - # p is not found in virtualenv script/bin dir + # path is not found in virtualenv script/bin dir if venv: - if not self.is_allowed_external(p): + if not self.is_allowed_external(path): self.session.report.warning( "test command found but not installed in testenv\n" " cmd: %s\n" " env: %s\n" "Maybe you forgot to specify a dependency? " "See also the whitelist_externals envconfig setting." % ( - p, self.envconfig.envdir)) - return str(p) # will not be rewritten for reporting + path, self.envconfig.envdir)) + return str(path) # will not be rewritten for reporting def is_allowed_external(self, p): tryadd = [""] https://bitbucket.org/hpk42/tox/commits/afc1016bb733/ Changeset: afc1016bb733 Branch: jtpereyda-cleanup User: joshpere Date: 2016-04-14 19:04:20+00:00 Summary: Cleanup: Format comments for easier reading. Affected #: 1 file diff -r 87e8123dfc61ccde46337ce664647b685c63d4a9 -r afc1016bb733bdf69233a61315be3c36d3fe4977 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -79,11 +79,11 @@ return "" % (self.path) def getcommandpath(self, name, venv=True, cwd=None): - """ return absolute path (str or localpath) for specified - command name. If it's a localpath we will rewrite it as - as a relative path. If venv is True we will check if the - command is coming from the venv or is whitelisted to come - from external. """ + """ Return absolute path (str or localpath) for specified command name. + - If it's a local path we will rewrite it as as a relative path. + - If venv is True we will check if the command is coming from the venv + or is whitelisted to come from external. + """ name = str(name) if os.path.isabs(name): return name https://bitbucket.org/hpk42/tox/commits/e358f4e8323e/ Changeset: e358f4e8323e Branch: jtpereyda-cleanup User: joshpere Date: 2016-04-14 19:15:42+00:00 Summary: Cleanup: Extract function for readability. The _venv_lookup function is now self-descriptive and more self-contained. Affected #: 1 file diff -r afc1016bb733bdf69233a61315be3c36d3fe4977 -r e358f4e8323e5ac2bf4478feafbf721f32c094b3 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -91,17 +91,22 @@ path = cwd.join(name) if path.check(): return str(path) - path = None + if venv: - path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) - if path is not None: - return path - path = py.path.local.sysfind(name) + path = self._venv_lookup(name) + else: + path = py.path.local.sysfind(name) + if path is None: raise tox.exception.InvocationError( "could not find executable %r" % (name,)) - # path is not found in virtualenv script/bin dir - if venv: + + return str(path) # will not be rewritten for reporting + + def _venv_lookup(self, name): + path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + if path is None: + path = py.path.local.sysfind(name) if not self.is_allowed_external(path): self.session.report.warning( "test command found but not installed in testenv\n" @@ -110,7 +115,7 @@ "Maybe you forgot to specify a dependency? " "See also the whitelist_externals envconfig setting." % ( path, self.envconfig.envdir)) - return str(path) # will not be rewritten for reporting + return path def is_allowed_external(self, p): tryadd = [""] https://bitbucket.org/hpk42/tox/commits/bd4c60505f35/ Changeset: bd4c60505f35 Branch: jtpereyda-cleanup User: joshpere Date: 2016-04-14 19:18:29+00:00 Summary: Cleanup: Extract duplicate code Affected #: 1 file diff -r e358f4e8323e5ac2bf4478feafbf721f32c094b3 -r bd4c60505f355dc6093327ac009cefdbdf32dffc tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -95,7 +95,7 @@ if venv: path = self._venv_lookup(name) else: - path = py.path.local.sysfind(name) + path = self._normal_lookup(name) if path is None: raise tox.exception.InvocationError( @@ -106,7 +106,7 @@ def _venv_lookup(self, name): path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) if path is None: - path = py.path.local.sysfind(name) + path = self._normal_lookup(name) if not self.is_allowed_external(path): self.session.report.warning( "test command found but not installed in testenv\n" @@ -117,6 +117,9 @@ path, self.envconfig.envdir)) return path + def _normal_lookup(self, name): + return py.path.local.sysfind(name) + def is_allowed_external(self, p): tryadd = [""] if sys.platform == "win32": https://bitbucket.org/hpk42/tox/commits/612cfbdc4be1/ Changeset: 612cfbdc4be1 Branch: jtpereyda-cleanup User: joshpere Date: 2016-04-14 19:32:18+00:00 Summary: Cleanup: Renaming and method extraction. Affected #: 1 file diff -r bd4c60505f355dc6093327ac009cefdbdf32dffc -r 612cfbdc4be1f5bf43857659f656e49aecf484a3 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -93,7 +93,7 @@ return str(path) if venv: - path = self._venv_lookup(name) + path = self._venv_lookup_and_check_external_whitelist(name) else: path = self._normal_lookup(name) @@ -103,22 +103,29 @@ return str(path) # will not be rewritten for reporting - def _venv_lookup(self, name): - path = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + def _venv_lookup_and_check_external_whitelist(self, name): + path = self._venv_lookup(name) if path is None: path = self._normal_lookup(name) - if not self.is_allowed_external(path): - self.session.report.warning( + if path is not None: + self._check_external_allowed_and_warn(path) + return path + + def _venv_lookup(self, name): + return py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + + def _normal_lookup(self, name): + return py.path.local.sysfind(name) + + def _check_external_allowed_and_warn(self, path): + if not self.is_allowed_external(path): + self.session.report.warning( "test command found but not installed in testenv\n" " cmd: %s\n" " env: %s\n" "Maybe you forgot to specify a dependency? " "See also the whitelist_externals envconfig setting." % ( path, self.envconfig.envdir)) - return path - - def _normal_lookup(self, name): - return py.path.local.sysfind(name) def is_allowed_external(self, p): tryadd = [""] https://bitbucket.org/hpk42/tox/commits/bf8008c08c73/ Changeset: bf8008c08c73 User: d6e Date: 2016-06-20 16:01:01+00:00 Summary: Merged in jtpereyda/tox/jtpereyda-cleanup (pull request #194) Cleanup: VirtualEnv.getcommandpath Affected #: 1 file diff -r bb377f12d053fb136deb0ba973f2444385acf233 -r bf8008c08c7361c18730c458032e875d97a97e90 tox/venv.py --- a/tox/venv.py +++ b/tox/venv.py @@ -79,38 +79,53 @@ return "" % (self.path) def getcommandpath(self, name, venv=True, cwd=None): - """ return absolute path (str or localpath) for specified - command name. If it's a localpath we will rewrite it as - as a relative path. If venv is True we will check if the - command is coming from the venv or is whitelisted to come - from external. """ + """ Return absolute path (str or localpath) for specified command name. + - If it's a local path we will rewrite it as as a relative path. + - If venv is True we will check if the command is coming from the venv + or is whitelisted to come from external. + """ name = str(name) if os.path.isabs(name): return name if os.path.split(name)[0] == ".": - p = cwd.join(name) - if p.check(): - return str(p) - p = None + path = cwd.join(name) + if path.check(): + return str(path) + if venv: - p = py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) - if p is not None: - return p - p = py.path.local.sysfind(name) - if p is None: + path = self._venv_lookup_and_check_external_whitelist(name) + else: + path = self._normal_lookup(name) + + if path is None: raise tox.exception.InvocationError( "could not find executable %r" % (name,)) - # p is not found in virtualenv script/bin dir - if venv: - if not self.is_allowed_external(p): - self.session.report.warning( + + return str(path) # will not be rewritten for reporting + + def _venv_lookup_and_check_external_whitelist(self, name): + path = self._venv_lookup(name) + if path is None: + path = self._normal_lookup(name) + if path is not None: + self._check_external_allowed_and_warn(path) + return path + + def _venv_lookup(self, name): + return py.path.local.sysfind(name, paths=[self.envconfig.envbindir]) + + def _normal_lookup(self, name): + return py.path.local.sysfind(name) + + def _check_external_allowed_and_warn(self, path): + if not self.is_allowed_external(path): + self.session.report.warning( "test command found but not installed in testenv\n" " cmd: %s\n" " env: %s\n" "Maybe you forgot to specify a dependency? " "See also the whitelist_externals envconfig setting." % ( - p, self.envconfig.envdir)) - return str(p) # will not be rewritten for reporting + path, self.envconfig.envdir)) def is_allowed_external(self, p): tryadd = [""] 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 Mon Jun 20 12:17:42 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:17:42 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in jayvdb/tox (pull request #186) Message-ID: <20160620161742.10694.51672@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/73a25603c38b/ Changeset: 73a25603c38b User: hpk42 Date: 2016-06-20 16:17:41+00:00 Summary: Merged in jayvdb/tox (pull request #186) Add test for double substitution using {{ }} Affected #: 1 file diff -r bf8008c08c7361c18730c458032e875d97a97e90 -r 73a25603c38b7c171e956457dca52a41b44c3e3e tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1083,6 +1083,20 @@ argv = conf.commands assert argv[0] == ["echo"] + def test_substitution_double(self, newconfig): + inisource = """ + [params] + foo = bah + foo2 = [params]foo + + [testenv:py27] + commands = + echo {{[params]foo2}} + """ + conf = newconfig([], inisource).envconfigs['py27'] + argv = conf.commands + assert argv[0] == ['echo', 'bah'] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): inisource = """ [testenv:py27] 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 Mon Jun 20 12:17:46 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:17:46 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620161746.5721.98603@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/73e3927b5098/ Changeset: 73e3927b5098 User: jayvdb Date: 2015-12-26 05:22:49+00:00 Summary: Add test for double substitution using {{ }} {{foo}} uses the result of {foo} as the name for substitution. Affected #: 1 file diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r 73e3927b50983f57d6ec29c52daaa5ef2ce296b4 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1006,6 +1006,20 @@ argv = conf.commands assert argv[0] == ["echo"] + def test_substitution_double(self, newconfig): + inisource = """ + [params] + foo = bah + foo2 = [params]foo + + [testenv:py27] + commands = + echo {{[params]foo2}} + """ + conf = newconfig([], inisource).envconfigs['py27'] + argv = conf.commands + assert argv[0] == ['echo', 'bah'] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): inisource = """ [testenv:py27] https://bitbucket.org/hpk42/tox/commits/73a25603c38b/ Changeset: 73a25603c38b User: hpk42 Date: 2016-06-20 16:17:41+00:00 Summary: Merged in jayvdb/tox (pull request #186) Add test for double substitution using {{ }} Affected #: 1 file diff -r bf8008c08c7361c18730c458032e875d97a97e90 -r 73a25603c38b7c171e956457dca52a41b44c3e3e tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1083,6 +1083,20 @@ argv = conf.commands assert argv[0] == ["echo"] + def test_substitution_double(self, newconfig): + inisource = """ + [params] + foo = bah + foo2 = [params]foo + + [testenv:py27] + commands = + echo {{[params]foo2}} + """ + conf = newconfig([], inisource).envconfigs['py27'] + argv = conf.commands + assert argv[0] == ['echo', 'bah'] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): inisource = """ [testenv:py27] 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 Mon Jun 20 12:19:03 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:19:03 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in jayvdb/tox (pull request #185) Message-ID: <20160620161903.27795.7586@celery-worker-103.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/57d04ea3a5ad/ Changeset: 57d04ea3a5ad User: hpk42 Date: 2016-06-20 16:19:01+00:00 Summary: Merged in jayvdb/tox (pull request #185) Unescape \{..\} according to docs. Affected #: 2 files diff -r 73a25603c38b7c171e956457dca52a41b44c3e3e -r 57d04ea3a5ad1a02093822e32f4b1afb734299bd tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1106,12 +1106,12 @@ """ conf = newconfig([], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '='] + assert argv[0] == ['echo', '{posargs}', '='] assert argv[1] == ['echo', 'posargs = ', ""] conf = newconfig(['dog', 'cat'], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat'] + assert argv[0] == ['echo', '{posargs}', '=', 'dog', 'cat'] assert argv[1] == ['echo', 'posargs = ', 'dog cat'] def test_rewrite_posargs(self, tmpdir, newconfig): diff -r 73a25603c38b7c171e956457dca52a41b44c3e3e -r 57d04ea3a5ad1a02093822e32f4b1afb734299bd tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -1165,6 +1165,7 @@ new_arg = "" new_word = reader._replace(word) new_word = reader._replace(new_word) + new_word = new_word.replace('\\{', '{').replace('\\}', '}') new_arg += new_word newcommand += new_arg 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 Mon Jun 20 12:19:10 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:19:10 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160620161910.25213.72735@celery-worker-104.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/882d74573ce7/ Changeset: 882d74573ce7 User: jayvdb Date: 2015-12-25 22:16:05+00:00 Summary: Unescape \{..\} Affected #: 2 files diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r 882d74573ce74dceb5d0314e00d4c4a253f218a9 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1015,12 +1015,12 @@ """ conf = newconfig([], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '='] + assert argv[0] == ['echo', '{posargs}', '='] assert argv[1] == ['echo', 'posargs = ', ""] conf = newconfig(['dog', 'cat'], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat'] + assert argv[0] == ['echo', '{posargs}', '=', 'dog', 'cat'] assert argv[1] == ['echo', 'posargs = ', 'dog cat'] def test_rewrite_posargs(self, tmpdir, newconfig): diff -r 2d5d0e7584cc4cc35cc7e0519ce9610dd52b7a62 -r 882d74573ce74dceb5d0314e00d4c4a253f218a9 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -1129,6 +1129,7 @@ new_arg = "" new_word = reader._replace(word) new_word = reader._replace(new_word) + new_word = new_word.replace('\\{', '{').replace('\\}', '}') new_arg += new_word newcommand += new_arg https://bitbucket.org/hpk42/tox/commits/57d04ea3a5ad/ Changeset: 57d04ea3a5ad User: hpk42 Date: 2016-06-20 16:19:01+00:00 Summary: Merged in jayvdb/tox (pull request #185) Unescape \{..\} according to docs. Affected #: 2 files diff -r 73a25603c38b7c171e956457dca52a41b44c3e3e -r 57d04ea3a5ad1a02093822e32f4b1afb734299bd tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1106,12 +1106,12 @@ """ conf = newconfig([], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '='] + assert argv[0] == ['echo', '{posargs}', '='] assert argv[1] == ['echo', 'posargs = ', ""] conf = newconfig(['dog', 'cat'], inisource).envconfigs['py27'] argv = conf.commands - assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat'] + assert argv[0] == ['echo', '{posargs}', '=', 'dog', 'cat'] assert argv[1] == ['echo', 'posargs = ', 'dog cat'] def test_rewrite_posargs(self, tmpdir, newconfig): diff -r 73a25603c38b7c171e956457dca52a41b44c3e3e -r 57d04ea3a5ad1a02093822e32f4b1afb734299bd tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -1165,6 +1165,7 @@ new_arg = "" new_word = reader._replace(word) new_word = reader._replace(new_word) + new_word = new_word.replace('\\{', '{').replace('\\}', '}') new_arg += new_word newcommand += new_arg 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 Mon Jun 20 12:22:07 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:22:07 -0000 Subject: [Pytest-commit] commit/tox: hpk42: add changelog entry for latest PR merge: Message-ID: <20160620162207.30438.44937@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/b609deef30f3/ Changeset: b609deef30f3 User: hpk42 Date: 2016-06-20 16:21:40+00:00 Summary: add changelog entry for latest PR merge: fix issue212: allow escaping curly brace chars "\{" and "\}" if you need the chars "{" and "}" to appear in your commands or other ini values. Thanks John Vandenberg. Affected #: 1 file diff -r 57d04ea3a5ad1a02093822e32f4b1afb734299bd -r b609deef30f33591f413e1fcae7f00a7a08d86f7 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,10 @@ 2.4.0 ----- +- fix issue212: allow escaping curly brace chars "\{" and "\}" if you need the + chars "{" and "}" to appear in your commands or other ini values. + Thanks John Vandenberg. + - add --workdir option to override where tox stores its ".tox" directory and all of the virtualenv environment. Thanks Danring. 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 Mon Jun 20 12:42:37 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 20 Jun 2016 16:42:37 -0000 Subject: [Pytest-commit] commit/tox: d6e: Add changelog message for config file prefixes. Message-ID: <20160620164237.30438.90678@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/64dc87d82355/ Changeset: 64dc87d82355 User: d6e Date: 2016-06-20 16:42:16+00:00 Summary: Add changelog message for config file prefixes. Affected #: 1 file diff -r b609deef30f33591f413e1fcae7f00a7a08d86f7 -r 64dc87d82355562ffbdc2f389cadbd3ca573d2a9 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,8 @@ something like "pip install {opts} {packages}". Thanks Ted Shaw, Holger Krekel. +- New feature: When a search for a config file fails, tox tries loading + setup.cfg with a section prefix of "tox". 2.3.2 ----- 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 Tue Jun 21 04:09:13 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 21 Jun 2016 08:09:13 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: change was in the wrong version Message-ID: <20160621080913.2019.62423@celery-worker-102.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/503a42ddacd3/ Changeset: 503a42ddacd3 User: Oliver Bestwalter Date: 2016-06-21 08:09:05+00:00 Summary: change was in the wrong version Affected #: 1 file diff -r f02761e88cc4abcc518266b66f231de769c00f4f -r 503a42ddacd3ed71e3accfb23a93296ae1068db6 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -26,6 +26,9 @@ ``tox_runtest_post`` which run before and after the tests of a venv, respectively. Thanks to Matthew Schinckel and itxaka serrano. +- fix issue317: evaluate minversion before tox config is parsed completely. + Thanks Sachi King for the PR. + 2.3.2 ----- @@ -34,9 +37,6 @@ - fix issue279: allow cross-section substitution when the value contains posargs. Thanks Sachi King for the PR. -- fix issue317: evaluate minversion before tox config is parsed completely. - Thanks Sachi King for the PR. - 2.3.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 Tue Jun 21 10:58:58 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 21 Jun 2016 14:58:58 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160621145858.3480.9771@celery-worker-102.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/0ffb9f6ad0e3/ Changeset: 0ffb9f6ad0e3 Branch: The-Compiler/fix-typo-1466505573719 User: The-Compiler Date: 2016-06-21 10:39:36+00:00 Summary: Fix typo Affected #: 1 file diff -r 503a42ddacd3ed71e3accfb23a93296ae1068db6 -r 0ffb9f6ad0e3c23fb1561586483063be96bb99e2 tox/hookspecs.py --- a/tox/hookspecs.py +++ b/tox/hookspecs.py @@ -47,7 +47,7 @@ def tox_runtest_pre(venv): """ [experimental] perform arbitrary action before running tests for this venv. - This could be used to indicate that tests for a given venv have started, for intstance. + This could be used to indicate that tests for a given venv have started, for instance. """ https://bitbucket.org/hpk42/tox/commits/970d10c85c13/ Changeset: 970d10c85c13 User: obestwalter Date: 2016-06-21 14:58:54+00:00 Summary: Merged in The-Compiler/tox/The-Compiler/fix-typo-1466505573719 (pull request #199) Fix typo Affected #: 1 file diff -r 503a42ddacd3ed71e3accfb23a93296ae1068db6 -r 970d10c85c13bf7faf1a7a04aa72287c294a41cb tox/hookspecs.py --- a/tox/hookspecs.py +++ b/tox/hookspecs.py @@ -47,7 +47,7 @@ def tox_runtest_pre(venv): """ [experimental] perform arbitrary action before running tests for this venv. - This could be used to indicate that tests for a given venv have started, for intstance. + This could be used to indicate that tests for a given venv have started, for instance. """ 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 Tue Jun 21 10:58:56 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 21 Jun 2016 14:58:56 -0000 Subject: [Pytest-commit] commit/tox: obestwalter: Merged in The-Compiler/tox/The-Compiler/fix-typo-1466505573719 (pull request #199) Message-ID: <20160621145856.39533.59504@celery-worker-101.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/970d10c85c13/ Changeset: 970d10c85c13 User: obestwalter Date: 2016-06-21 14:58:54+00:00 Summary: Merged in The-Compiler/tox/The-Compiler/fix-typo-1466505573719 (pull request #199) Fix typo Affected #: 1 file diff -r 503a42ddacd3ed71e3accfb23a93296ae1068db6 -r 970d10c85c13bf7faf1a7a04aa72287c294a41cb tox/hookspecs.py --- a/tox/hookspecs.py +++ b/tox/hookspecs.py @@ -47,7 +47,7 @@ def tox_runtest_pre(venv): """ [experimental] perform arbitrary action before running tests for this venv. - This could be used to indicate that tests for a given venv have started, for intstance. + This could be used to indicate that tests for a given venv have started, for instance. """ 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 Fri Jun 24 07:50:46 2016 From: issues-reply at bitbucket.org (Oliver Bestwalter) Date: Fri, 24 Jun 2016 11:50:46 -0000 Subject: [Pytest-commit] Issue #337: Move to gihub (hpk42/tox) Message-ID: <20160624115046.6597.54656@celery-worker-104.ash1.bb-inf.net> New issue 337: Move to gihub https://bitbucket.org/hpk42/tox/issues/337/move-to-gihub Oliver Bestwalter: Code and issue handling should be moved to github. The outstanding PRs would have to be reopened against github then, so the authors need to be informed and some kind of discussion summary/dump needs to be imported there. From issues-reply at bitbucket.org Fri Jun 24 09:13:14 2016 From: issues-reply at bitbucket.org (Oliver Bestwalter) Date: Fri, 24 Jun 2016 13:13:14 -0000 Subject: [Pytest-commit] Issue #338: Generalize package builds and virtualenv creation (hpk42/tox) Message-ID: <20160624131314.13913.61896@celery-worker-102.ash1.bb-inf.net> New issue 338: Generalize package builds and virtualenv creation https://bitbucket.org/hpk42/tox/issues/338/generalize-package-builds-and-virtualenv Oliver Bestwalter: This can serve as a meta issue collecting some outstanding issues that would be fixed by this. The approach is to write documentation with examples for this and having a discussion around this in this issue. Responsible: obestwalter From commits-noreply at bitbucket.org Fri Jun 24 09:14:28 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 24 Jun 2016 13:14:28 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: first chaotic draft for issue #338 Message-ID: <20160624131428.27988.17988@celery-worker-101.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/f1d3efa85f12/ Changeset: f1d3efa85f12 User: Oliver Bestwalter Date: 2016-06-24 13:14:01+00:00 Summary: first chaotic draft for issue #338 Affected #: 1 file diff -r 970d10c85c13bf7faf1a7a04aa72287c294a41cb -r f1d3efa85f12ae0c460eb68b26eceaac2e13b294 doc/drafts/extend-envs-and-packagebuilds.md --- /dev/null +++ b/doc/drafts/extend-envs-and-packagebuilds.md @@ -0,0 +1,95 @@ +# Extension of environment handling and building packages + +Goal drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs + +Necessary to implement: + +* sdist refactoring (con concept for multiple package creations (e.g. wheels, conda, ...)) +* environment system extension + +## Use case: conda + +* general package def (how to build the package) +* general environment def (how to build an environment) +* matching environments to package definition (at package definition level) (e.g {py27,py34}-{venv,conda,pyenv}-[...]) + +## Problems + +* package definition that might match on everything might be a problem for which environments test? Not clear? +* sdist would need a "sdist" factor to only be matched against virtualenvs + +## section examples + +envlist={py,27,py34}-{win32, linux}-{conda,virtualenv} + +[packagedef:sdist] +# how to build (e.g. {py27,py34}-{sdist}) +# how to match (e.g. {py27,py34}-{sdist}) + +[packagedef:conda] +# how to build (e.g. {py27,py34}-{conda}) +# how to match (e.g. {py27,py34}-{conda}) + +[packagedef:wheel] +# how to build +# how to match + +## Next release (3.0) + +* ship what we have +* Plan for next major release + +## sdist refatoring + +* Needs concept of mapping environments to specific packages (versioned packages) +* no control over when it happens for specific environment +* no control over how it happens (e.g. which python interpreter is used to create the package) +* trigger it only if an environment actually needs it + +### Ideas + +* Simplify for the common case: most packages are universal, so it should be simple +one to one relationship from environment to directory +* Floris: metadata driven. Package has metadata to the env with what env it is compatible +* Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) +* Ronny: "package definitions" (this pacakge, this setup command) + matching definitions (matching packages (with wldcards) for environemnts) + +## integrate detox + +* reporting in detox is minimal (would need to improve) +* restricting processes would be necessary depending on power of the machine + (creating 16 processe on a dual core machine might be overkill) +* port it from eventlets to threads? + +## Extend environment integrations + +Different kinds and combinations of environments + +* Virtualenv, conda, nixos, docker, pyenv, rpm, deb, npm ... +* Code needs to change a lot +* need to be documunted properly + +### conda integration + +* Asynchronicity / detox not taken into account yet +* Conda activation might do anything (change filesys, start DBs) +* Can I activate environments in parallel +* Packages would need to be created (from conda.yml) +* Activation is a problem + +### pyenv integration + +* ? + +# Questions + +* list all environments from command line (not just the ones from envlist) + +# Ideas + +* sync command line options and actual documentation +* General way of running tests in an already existing environment + +# Problems + +* Per python version wheels are not taken into account yet 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 Jun 24 12:11:15 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Fri, 24 Jun 2016 16:11:15 -0000 Subject: [Pytest-commit] commit/tox: Oliver Bestwalter: organize the notes a bit Message-ID: <20160624161115.11634.16464@celery-worker-101.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/cb509b4c25c3/ Changeset: cb509b4c25c3 User: Oliver Bestwalter Date: 2016-06-24 16:11:02+00:00 Summary: organize the notes a bit Affected #: 1 file diff -r f1d3efa85f12ae0c460eb68b26eceaac2e13b294 -r cb509b4c25c3dee2be78c39591f65de25e1058be doc/drafts/extend-envs-and-packagebuilds.md --- a/doc/drafts/extend-envs-and-packagebuilds.md +++ b/doc/drafts/extend-envs-and-packagebuilds.md @@ -1,75 +1,54 @@ # Extension of environment handling and building packages -Goal drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs +*Notes from a discussion at the pytest sprint 2016* -Necessary to implement: +Goal: drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs -* sdist refactoring (con concept for multiple package creations (e.g. wheels, conda, ...)) -* environment system extension +### Problems -## Use case: conda - -* general package def (how to build the package) -* general environment def (how to build an environment) -* matching environments to package definition (at package definition level) (e.g {py27,py34}-{venv,conda,pyenv}-[...]) - -## Problems - -* package definition that might match on everything might be a problem for which environments test? Not clear? -* sdist would need a "sdist" factor to only be matched against virtualenvs - -## section examples - -envlist={py,27,py34}-{win32, linux}-{conda,virtualenv} - -[packagedef:sdist] -# how to build (e.g. {py27,py34}-{sdist}) -# how to match (e.g. {py27,py34}-{sdist}) - -[packagedef:conda] -# how to build (e.g. {py27,py34}-{conda}) -# how to match (e.g. {py27,py34}-{conda}) - -[packagedef:wheel] -# how to build -# how to match - -## Next release (3.0) - -* ship what we have -* Plan for next major release - -## sdist refatoring - -* Needs concept of mapping environments to specific packages (versioned packages) +* No concept of mapping environments to specific packages (versioned packages) * no control over when it happens for specific environment * no control over how it happens (e.g. which python interpreter is used to create the package) -* trigger it only if an environment actually needs it +* No way of triggering build only if there is an environment that needs a specific build trigger it only if an environment actually needs it +* package definition that might match on everything might be a problem for which environments test? Not clear? -### Ideas +### Solution -* Simplify for the common case: most packages are universal, so it should be simple -one to one relationship from environment to directory -* Floris: metadata driven. Package has metadata to the env with what env it is compatible -* Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) -* Ronny: "package definitions" (this pacakge, this setup command) + matching definitions (matching packages (with wldcards) for environemnts) +It should be possible to build other kinds of packages than just the standard sdist and it should also be possible to create different kinds of builds that can be used from different environments. To make this possible there has to be some concept of factorized package definitions and a way to match these factorized builds to environments with a similar way of matching like what is in place already to generate environments. sdist would for example would match to a "sdist" factor to only be matched against virtualenvs as the default. -## integrate detox +This could then be used to hae virtualenv, conda, nixos, docker, pyenv, rpm, deb, etc. builds and tie them to concrete test environments. + +To summarize - we would need a: + + * packagedef (how to build a package) + * envdef (how to build an environment) + * way of matching envs to concrete packages (at package definition level) (e.g `{py27,py34}-{win32,linux}-{venv,conda,pyenv}-[...]`) + +## Beginnings of configuration examples (not thought out yet) + + [tox] + envlist={py,27,py34}-{win32, linux}-{conda,virtualenv} + + [packagedef:sdist] + # how to build (e.g. {py27,py34}-{sdist}) + # how to match (e.g. {py27,py34}-{sdist}) + + [packagedef:conda] + # how to build (e.g. {py27,py34}-{conda}) + # how to match (e.g. {py27,py34}-{conda}) + + [packagedef:wheel] + # how to build + # how to match + +#### integrate detox * reporting in detox is minimal (would need to improve) * restricting processes would be necessary depending on power of the machine (creating 16 processe on a dual core machine might be overkill) * port it from eventlets to threads? -## Extend environment integrations - -Different kinds and combinations of environments - -* Virtualenv, conda, nixos, docker, pyenv, rpm, deb, npm ... -* Code needs to change a lot -* need to be documunted properly - -### conda integration +### Concrete use case conda integration (started by Bruno) * Asynchronicity / detox not taken into account yet * Conda activation might do anything (change filesys, start DBs) @@ -77,19 +56,11 @@ * Packages would need to be created (from conda.yml) * Activation is a problem -### pyenv integration -* ? +### Unsorted discussion notes -# Questions - -* list all environments from command line (not just the ones from envlist) - -# Ideas - -* sync command line options and actual documentation -* General way of running tests in an already existing environment - -# Problems - -* Per python version wheels are not taken into account yet +* Simplify for the common case: most packages are universal, so it should be simple +one to one relationship from environment to directory +* Floris: metadata driven. Package has metadata to the env with what env it is compatible +* Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) +* Ronny: "package definitions" (this package, this setup command) + matching definitions (matching packages (with wildcards) for environments) 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 Sat Jun 25 06:20:15 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 25 Jun 2016 10:20:15 -0000 Subject: [Pytest-commit] commit/tox: so...@nur-sober-mc-01.local: added niccodemus' notes and started to specify the builddef feature Message-ID: <20160625102015.20452.51890@celery-worker-104.ash1.bb-inf.net> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/489bcd21e06c/ Changeset: 489bcd21e06c User: so... at nur-sober-mc-01.local Date: 2016-06-25 10:12:15+00:00 Summary: added niccodemus' notes and started to specify the builddef feature Affected #: 2 files diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 489bcd21e06ccc30f1fc85187852815540093c5d doc/drafts/extend-envs-and-packagebuilds.md --- a/doc/drafts/extend-envs-and-packagebuilds.md +++ b/doc/drafts/extend-envs-and-packagebuilds.md @@ -1,5 +1,7 @@ # Extension of environment handling and building packages +Issue reference: #338 + *Notes from a discussion at the pytest sprint 2016* Goal: drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs @@ -64,3 +66,19 @@ * Floris: metadata driven. Package has metadata to the env with what env it is compatible * Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) * Ronny: "package definitions" (this package, this setup command) + matching definitions (matching packages (with wildcards) for environments) + +### Feature - builddef + +This feature shall allow to specify how to build an artifact in a specific build definition (builddef). + +Currently tox uses the current python interpreter to build the artifact (python package) and thus +does not allow to freely choose the interpreter to build with. +This means that as of now build environment and test environment are different by design. + +Support for different build definitions is implemented by individual tox plugins. +This would result in a collection of plugins supporting different build definitions (e.g. conda, pyenv, docker, rpm) + +Default behavior: + +To keep backwards-compatibility, a python package is built with the python interpreter tox is executed with, +using sdist. This does not require any builddef specification in tox.ini. diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 489bcd21e06ccc30f1fc85187852815540093c5d doc/drafts/tox_conda_notes_niccodemus.md --- /dev/null +++ b/doc/drafts/tox_conda_notes_niccodemus.md @@ -0,0 +1,84 @@ +[tox] +envlist=py27,py35 + +[testenv] +commands= py.test --timeout=180 {posargs:tests} +deps=pytest>=2.3.5 + pytest-timeout + +# USE CASE 1: plain conda, with deps on tox.ini +create_env_command = conda create --prefix {envdir} python={python_version} +install_command = conda install --prefix {envdir} {opts} {packages} +list_dependencies_command = conda list --prefix {envdir} + +# deprecated: see tox_create_popen hook +linux:env_activate_command=source activate {envdir} +win:env_activate_command=activate.bat {envdir} + +# USE CASE 2: plain conda, using requirements.txt +install_command = conda install --prefix {envdir} {opts} --file requirements.txt + +# USE CASE 3: conda env +create_env_command = conda env create --prefix {envdir} python={python_version} --file environment.yml +install_command = + +[testenv] +type=virtualenv +type=venv +type=conda +type=conda-reqs +type=conda-env + +1. Create a new ``create_env_command`` option. +;2. Create a new ``env_activate_command`` option (also consider how to make that platform dependent). +2. New substitution variable: {python_version} ('3.4', '2.7', etc') +3. env type concept: different types change the default options. + +1. tox_addoption can now add new "testenv" sections to tox.ini: + +[virtualenv] +[conda] +[venv] + +2. extend hooks: + + * tox_addoption + * tox_configure + for each requested env in config: + tox_testenv_up_to_date(envmeta) + tox_testenv_create(envmeta) + tox_testenv_install_deps(envmeta, env) + tox_runtest_pre(envmeta, env) + tox_runtest(envmeta, env, popen) + tox_runtest_post(envmeta, env) + +3. separate virtualenv details from "VirtualEnv" class into a plugin. + +[tox] +envlist={py27,py35}-{sdist,wheel,conda} + +[package-sdist] +command = python setup.py sdist + +[package-wheel] +command = python setup.py bdist_wheel + +[package-conda] +command = conda build ./conda-recipe + +[testenv:{sdist,wheel}] +commands = py.test + +[testenv:conda] +packages = sdist,wheel +commands = py.test --conda-only + +* tox_addoption +* tox_get_python_executable +* tox_configure +for each requested env in config: + tox_testenv_create(envmeta) + tox_testenv_install_deps(envmeta, env) + tox_runtest_pre(envmeta, env) + tox_runtest(envmeta, env, popen) + tox_runtest_post(envmeta, env) 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 Sat Jun 25 07:15:10 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 25 Jun 2016 11:15:10 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160625111510.38079.13541@celery-worker-101.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/11c13b4313a4/ Changeset: 11c13b4313a4 User: hpk42 Date: 2016-06-25 11:06:55+00:00 Summary: addresses issue66: add --workdir option to override where tox stores its ".tox" directory to "pip freeze" to obtain the list of installed packages. Thanks Ted Shaw, Holger Krekel. close issue66: add documentation to jenkins page on how to avoid "too long shebang" lines when calling pip from tox. Note that we can not use "python -m pip install X" by default because the latter adds the CWD and pip will think X is installed if it is there. "pip install X" does not do that. (experimental) New feature: When a search for a config file fails, tox tries loading Affected #: 7 files diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -5,21 +5,23 @@ chars "{" and "}" to appear in your commands or other ini values. Thanks John Vandenberg. -- add --workdir option to override where tox stores its ".tox" directory +- addresses issue66: add --workdir option to override where tox stores its ".tox" directory and all of the virtualenv environment. Thanks Danring. - introduce per-venv list_dependencies_command which defaults - to "python -m pip freeze" to obtain the list of installed packages. - If you need to run python2.6 you need to configure it to - something like "pip freeze". Thanks Ted Shaw, Holger Krekel. + to "pip freeze" to obtain the list of installed packages. + Thanks Ted Shaw, Holger Krekel. -- fix issue66, issue121: change install_command to use "python -m pip" - by default instead of "pip ..." directly which avoids long shebang - issues. If you need to run python2.6 you need to configure it to - something like "pip install {opts} {packages}". Thanks Ted Shaw, - Holger Krekel. +- close issue66: add documentation to jenkins page on how to avoid + "too long shebang" lines when calling pip from tox. Note that we + can not use "python -m pip install X" by default because the latter + adds the CWD and pip will think X is installed if it is there. + "pip install X" does not do that. -- New feature: When a search for a config file fails, tox tries loading +- new list_dependencies_command to influence how tox determines + which dependencies are installed in a testenv. + +- (experimental) New feature: When a search for a config file fails, tox tries loading setup.cfg with a section prefix of "tox". - fix issue275: Introduce hooks ``tox_runtest_pre``` and diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -105,7 +105,7 @@ **default**:: - python -m pip install {opts} {packages} + pip install {opts} {packages} .. confval:: list_dependencies_command @@ -117,7 +117,7 @@ **default**:: - python -m pip freeze + pip freeze .. confval:: ignore_errors=True|False(default) diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c doc/example/jenkins.txt --- a/doc/example/jenkins.txt +++ b/doc/example/jenkins.txt @@ -44,7 +44,7 @@ .. note:: This feature is broken currently because "toxbootstrap.py" - has been removed. Please file an issue if you'd like to + has been removed. Please file an issue if you'd like to see it back. If you manage many Jenkins slaves and want to use the latest officially @@ -151,6 +151,24 @@ same ``tox.ini`` file and make use of automatic sharing of your artifacts between runs or Jenkins jobs. + +Avoiding the "path too long" error with long shebang lines +--------------------------------------------------------------- + +If you are using Jenkins builds you might run into the issue +that tox can not call ``pip`` because the so called "shebang" +line is too long. There is a limit of 127 chars on some systems. +Probably the best way to fix the problem is to use the +new ``--workdir`` option which tells tox to use a specific +directory for its virtualenvironments. Set it to some unique +enough short path. If somebody is interested to do a PR +you could add a new option to tox which uses a random +directory for storing its workdir results and removes +it after the tox run finishes. This could be used +from CI environments where you probably anyway want +to recreate everything on new runs. + + .. include:: ../links.txt diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c doc/install.txt --- a/doc/install.txt +++ b/doc/install.txt @@ -4,7 +4,7 @@ Install info in a nutshell ---------------------------------- -**Pythons**: CPython 2.6-3.3, Jython-2.5.1, pypy-1.9ff +**Pythons**: CPython 2.6-3.5, Jython-2.5.1, pypy-1.9ff **Operating systems**: Linux, Windows, OSX, Unix diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c setup.py --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def main(): version = sys.version_info[:2] - install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.4.0'] + install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.5.0'] extras_require = {} if has_environment_marker_support(): extras_require[':python_version=="2.6"'] = ['argparse'] diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -138,8 +138,8 @@ assert len(l) == 2 args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir - assert "pip" in str(args[2]) - assert args[3] == "install" + assert "pip" in str(args[0]) + assert args[1] == "install" # arg = "--download-cache=" + str(venv.envconfig.downloadcache) # assert arg in args[2:] args = [arg for arg in args if str(arg).endswith("dep1-1.1.zip")] @@ -169,7 +169,7 @@ args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir assert "pip" in str(args) - assert args[3] == "install" + assert args[1] == "install" assert "dep1" in args assert "dep2" in args deps = list(filter(None, [x[1] for x in venv._getliveconfig().deps])) @@ -366,7 +366,7 @@ venv._install(["hello"], action=action) assert len(l) == 1 args = l[0].args - assert "pip" in [str(x) for x in args] + assert "pip" in args[0] for x in args: assert "--download-cache" not in args, args @@ -598,7 +598,7 @@ venv.run_install_command(packages=["whatever"], action=action) l = mocksession._pcalls assert len(l) == 1 - assert 'pip' in l[0].args[2] + assert 'pip' in l[0].args[0] assert 'install' in l[0].args env = l[0].env assert env is not None diff -r cb509b4c25c3dee2be78c39591f65de25e1058be -r 11c13b4313a44a7872761bd02b031b6a1728369c tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -182,7 +182,7 @@ class InstallcmdOption: name = "install_command" type = "argv" - default = "python -m pip install {opts} {packages}" + default = "pip install {opts} {packages}" help = "install command for dependencies and package under test." def postprocess(self, testenv_config, value): @@ -529,7 +529,7 @@ parser.add_testenv_attribute( name="list_dependencies_command", type="argv", - default="python -m pip freeze", + default="pip freeze", help="list dependencies for a virtual environment") parser.add_testenv_attribute_obj(DepOption()) https://bitbucket.org/hpk42/tox/commits/1f8ef875278c/ Changeset: 1f8ef875278c User: hpk42 Date: 2016-06-25 11:08:56+00:00 Summary: Merged hpk42/tox into default Affected #: 2 files diff -r 11c13b4313a44a7872761bd02b031b6a1728369c -r 1f8ef875278c3a773812f3ebc3dba8ba0dc6b1e2 doc/drafts/extend-envs-and-packagebuilds.md --- a/doc/drafts/extend-envs-and-packagebuilds.md +++ b/doc/drafts/extend-envs-and-packagebuilds.md @@ -1,5 +1,7 @@ # Extension of environment handling and building packages +Issue reference: #338 + *Notes from a discussion at the pytest sprint 2016* Goal: drive building of packages and the environments needed to test them, exercising the tests and report the results for more than just virtualenvs and python virtualenvs @@ -64,3 +66,19 @@ * Floris: metadata driven. Package has metadata to the env with what env it is compatible * Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) * Ronny: "package definitions" (this package, this setup command) + matching definitions (matching packages (with wildcards) for environments) + +### Feature - builddef + +This feature shall allow to specify how to build an artifact in a specific build definition (builddef). + +Currently tox uses the current python interpreter to build the artifact (python package) and thus +does not allow to freely choose the interpreter to build with. +This means that as of now build environment and test environment are different by design. + +Support for different build definitions is implemented by individual tox plugins. +This would result in a collection of plugins supporting different build definitions (e.g. conda, pyenv, docker, rpm) + +Default behavior: + +To keep backwards-compatibility, a python package is built with the python interpreter tox is executed with, +using sdist. This does not require any builddef specification in tox.ini. diff -r 11c13b4313a44a7872761bd02b031b6a1728369c -r 1f8ef875278c3a773812f3ebc3dba8ba0dc6b1e2 doc/drafts/tox_conda_notes_niccodemus.md --- /dev/null +++ b/doc/drafts/tox_conda_notes_niccodemus.md @@ -0,0 +1,84 @@ +[tox] +envlist=py27,py35 + +[testenv] +commands= py.test --timeout=180 {posargs:tests} +deps=pytest>=2.3.5 + pytest-timeout + +# USE CASE 1: plain conda, with deps on tox.ini +create_env_command = conda create --prefix {envdir} python={python_version} +install_command = conda install --prefix {envdir} {opts} {packages} +list_dependencies_command = conda list --prefix {envdir} + +# deprecated: see tox_create_popen hook +linux:env_activate_command=source activate {envdir} +win:env_activate_command=activate.bat {envdir} + +# USE CASE 2: plain conda, using requirements.txt +install_command = conda install --prefix {envdir} {opts} --file requirements.txt + +# USE CASE 3: conda env +create_env_command = conda env create --prefix {envdir} python={python_version} --file environment.yml +install_command = + +[testenv] +type=virtualenv +type=venv +type=conda +type=conda-reqs +type=conda-env + +1. Create a new ``create_env_command`` option. +;2. Create a new ``env_activate_command`` option (also consider how to make that platform dependent). +2. New substitution variable: {python_version} ('3.4', '2.7', etc') +3. env type concept: different types change the default options. + +1. tox_addoption can now add new "testenv" sections to tox.ini: + +[virtualenv] +[conda] +[venv] + +2. extend hooks: + + * tox_addoption + * tox_configure + for each requested env in config: + tox_testenv_up_to_date(envmeta) + tox_testenv_create(envmeta) + tox_testenv_install_deps(envmeta, env) + tox_runtest_pre(envmeta, env) + tox_runtest(envmeta, env, popen) + tox_runtest_post(envmeta, env) + +3. separate virtualenv details from "VirtualEnv" class into a plugin. + +[tox] +envlist={py27,py35}-{sdist,wheel,conda} + +[package-sdist] +command = python setup.py sdist + +[package-wheel] +command = python setup.py bdist_wheel + +[package-conda] +command = conda build ./conda-recipe + +[testenv:{sdist,wheel}] +commands = py.test + +[testenv:conda] +packages = sdist,wheel +commands = py.test --conda-only + +* tox_addoption +* tox_get_python_executable +* tox_configure +for each requested env in config: + tox_testenv_create(envmeta) + tox_testenv_install_deps(envmeta, env) + tox_runtest_pre(envmeta, env) + tox_runtest(envmeta, env, popen) + tox_runtest_post(envmeta, env) 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 Sat Jun 25 12:52:09 2016 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Sat, 25 Jun 2016 16:52:09 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20160625165209.24166.52266@celery-worker-103.ash1.bb-inf.net> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/eb69ae15b946/ Changeset: eb69ae15b946 User: so... at nur-sober-mc-01.local Date: 2016-06-25 16:47:06+00:00 Summary: refactored proposal Affected #: 1 file diff -r 489bcd21e06ccc30f1fc85187852815540093c5d -r eb69ae15b94632fc2c206adf01e097ccbefe537a doc/drafts/extend-envs-and-packagebuilds.md --- a/doc/drafts/extend-envs-and-packagebuilds.md +++ b/doc/drafts/extend-envs-and-packagebuilds.md @@ -67,18 +67,89 @@ * Holger: configuration driven. explicitly configuring which packages should be used (default sdist to be used, overridable by concrete env) * Ronny: "package definitions" (this package, this setup command) + matching definitions (matching packages (with wildcards) for environments) -### Feature - builddef -This feature shall allow to specify how to build an artifact in a specific build definition (builddef). +## Proposal -Currently tox uses the current python interpreter to build the artifact (python package) and thus -does not allow to freely choose the interpreter to build with. -This means that as of now build environment and test environment are different by design. +This feature shall allow to specify how plugins can specify new types of package formats and environments to run test +commands in. -Support for different build definitions is implemented by individual tox plugins. -This would result in a collection of plugins supporting different build definitions (e.g. conda, pyenv, docker, rpm) +Such plugins would take care of setting up the environment, create packages and run test commands using hooks provided +by tox. The actual knowledge how to create a certain package format is implement in the plugin. -Default behavior: +Plugin decides which is the required python interpreter to use in order to create the relevant package format. -To keep backwards-compatibility, a python package is built with the python interpreter tox is executed with, -using sdist. This does not require any builddef specification in tox.ini. + +```ini +[tox] +plugins=conda # virtualenv plugin is builtin; intention here is to bail out early in case the specified plugins + # are not installed +envlist=py27,py35 + +[testenv] +package_formats= # new option to specify wanted package formats for test environment using tox factors feature + # defaults to "sdist" if not set + py35: sdist wheel conda # names here are provided by plugins (reserved keywords) + py27: sdist conda +commands = py.test +``` + +Lising tox environments (`tox --list`) would display the following output: + +``` +(sdist) py27 +(conda) py27 +(sdist) py35 +(wheel) py35 +(conda) py35 +``` + +To remain backward-compatible, the package format will not be displayed if only a single package format is specified. + + + +How to skip building a package for a specific factor? + +Illustrate how to exclude a certain package format for a factor: + +```ini +[tox] +plugins=conda +envlist={py27,py35}, py27-xdist + +[testenv] +package_formats=sdist wheel conda +commands = py.test +exclude_package_formats= # new option which filters out packages + py27-xdist: wheel +``` + +Output of `tox --list`: + +``` +(sdist) py27 +(conda) py27 +(sdist) py35 +(wheel) py35 +(conda) py35 +(sdist) py27-xdist +(conda) py27-xdist +``` + + +### Implemenation Details + +``` +tox_package_formats() -> ['conda'] # ['sdist', 'wheel'] +tox_testenv_create(env_meta, package_type) -> # creates an environment for given package, using + # information from env_meta (like .envdir) + # returns: an "env" object which is forwaded to the next hooks +tox_testenv_install(env_meta, package_type, env) -> # installs deps and package into environment +tox_testenv_runtest(env_meta, package_type, env) -> # activates enviroment and runs test commands + +tox_testenv_updated(env_meta, package_type) -> # returns True if hte environment is already up to date + # otherwise, tox will remove the environment completely and + # create a new one +``` + + + https://bitbucket.org/hpk42/tox/commits/19a03d4e500b/ Changeset: 19a03d4e500b User: sober7 Date: 2016-06-25 16:47:48+00:00 Summary: Merged hpk42/tox into default Affected #: 7 files diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -5,21 +5,23 @@ chars "{" and "}" to appear in your commands or other ini values. Thanks John Vandenberg. -- add --workdir option to override where tox stores its ".tox" directory +- addresses issue66: add --workdir option to override where tox stores its ".tox" directory and all of the virtualenv environment. Thanks Danring. - introduce per-venv list_dependencies_command which defaults - to "python -m pip freeze" to obtain the list of installed packages. - If you need to run python2.6 you need to configure it to - something like "pip freeze". Thanks Ted Shaw, Holger Krekel. + to "pip freeze" to obtain the list of installed packages. + Thanks Ted Shaw, Holger Krekel. -- fix issue66, issue121: change install_command to use "python -m pip" - by default instead of "pip ..." directly which avoids long shebang - issues. If you need to run python2.6 you need to configure it to - something like "pip install {opts} {packages}". Thanks Ted Shaw, - Holger Krekel. +- close issue66: add documentation to jenkins page on how to avoid + "too long shebang" lines when calling pip from tox. Note that we + can not use "python -m pip install X" by default because the latter + adds the CWD and pip will think X is installed if it is there. + "pip install X" does not do that. -- New feature: When a search for a config file fails, tox tries loading +- new list_dependencies_command to influence how tox determines + which dependencies are installed in a testenv. + +- (experimental) New feature: When a search for a config file fails, tox tries loading setup.cfg with a section prefix of "tox". - fix issue275: Introduce hooks ``tox_runtest_pre``` and diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde doc/config.txt --- a/doc/config.txt +++ b/doc/config.txt @@ -105,7 +105,7 @@ **default**:: - python -m pip install {opts} {packages} + pip install {opts} {packages} .. confval:: list_dependencies_command @@ -117,7 +117,7 @@ **default**:: - python -m pip freeze + pip freeze .. confval:: ignore_errors=True|False(default) diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde doc/example/jenkins.txt --- a/doc/example/jenkins.txt +++ b/doc/example/jenkins.txt @@ -44,7 +44,7 @@ .. note:: This feature is broken currently because "toxbootstrap.py" - has been removed. Please file an issue if you'd like to + has been removed. Please file an issue if you'd like to see it back. If you manage many Jenkins slaves and want to use the latest officially @@ -151,6 +151,24 @@ same ``tox.ini`` file and make use of automatic sharing of your artifacts between runs or Jenkins jobs. + +Avoiding the "path too long" error with long shebang lines +--------------------------------------------------------------- + +If you are using Jenkins builds you might run into the issue +that tox can not call ``pip`` because the so called "shebang" +line is too long. There is a limit of 127 chars on some systems. +Probably the best way to fix the problem is to use the +new ``--workdir`` option which tells tox to use a specific +directory for its virtualenvironments. Set it to some unique +enough short path. If somebody is interested to do a PR +you could add a new option to tox which uses a random +directory for storing its workdir results and removes +it after the tox run finishes. This could be used +from CI environments where you probably anyway want +to recreate everything on new runs. + + .. include:: ../links.txt diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde doc/install.txt --- a/doc/install.txt +++ b/doc/install.txt @@ -4,7 +4,7 @@ Install info in a nutshell ---------------------------------- -**Pythons**: CPython 2.6-3.3, Jython-2.5.1, pypy-1.9ff +**Pythons**: CPython 2.6-3.5, Jython-2.5.1, pypy-1.9ff **Operating systems**: Linux, Windows, OSX, Unix diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde setup.py --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def main(): version = sys.version_info[:2] - install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.4.0'] + install_requires = ['virtualenv>=1.11.2', 'py>=1.4.17', 'pluggy>=0.3.0,<0.5.0'] extras_require = {} if has_environment_marker_support(): extras_require[':python_version=="2.6"'] = ['argparse'] diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde tests/test_venv.py --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -138,8 +138,8 @@ assert len(l) == 2 args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir - assert "pip" in str(args[2]) - assert args[3] == "install" + assert "pip" in str(args[0]) + assert args[1] == "install" # arg = "--download-cache=" + str(venv.envconfig.downloadcache) # assert arg in args[2:] args = [arg for arg in args if str(arg).endswith("dep1-1.1.zip")] @@ -169,7 +169,7 @@ args = l[-1].args assert l[-1].cwd == venv.envconfig.config.toxinidir assert "pip" in str(args) - assert args[3] == "install" + assert args[1] == "install" assert "dep1" in args assert "dep2" in args deps = list(filter(None, [x[1] for x in venv._getliveconfig().deps])) @@ -366,7 +366,7 @@ venv._install(["hello"], action=action) assert len(l) == 1 args = l[0].args - assert "pip" in [str(x) for x in args] + assert "pip" in args[0] for x in args: assert "--download-cache" not in args, args @@ -598,7 +598,7 @@ venv.run_install_command(packages=["whatever"], action=action) l = mocksession._pcalls assert len(l) == 1 - assert 'pip' in l[0].args[2] + assert 'pip' in l[0].args[0] assert 'install' in l[0].args env = l[0].env assert env is not None diff -r eb69ae15b94632fc2c206adf01e097ccbefe537a -r 19a03d4e500ba859631bce6f6999de09b1a48cde tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -182,7 +182,7 @@ class InstallcmdOption: name = "install_command" type = "argv" - default = "python -m pip install {opts} {packages}" + default = "pip install {opts} {packages}" help = "install command for dependencies and package under test." def postprocess(self, testenv_config, value): @@ -529,7 +529,7 @@ parser.add_testenv_attribute( name="list_dependencies_command", type="argv", - default="python -m pip freeze", + default="pip freeze", help="list dependencies for a virtual environment") parser.add_testenv_attribute_obj(DepOption()) 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 Tue Jun 28 14:06:02 2016 From: issues-reply at bitbucket.org (Glen Nelson) Date: Tue, 28 Jun 2016 18:06:02 -0000 Subject: [Pytest-commit] Issue #339: Need a way to install a requirement before other requirements (hpk42/tox) Message-ID: <20160628180602.47760.22244@celery-worker-102.ash1.bb-inf.net> New issue 339: Need a way to install a requirement before other requirements https://bitbucket.org/hpk42/tox/issues/339/need-a-way-to-install-a-requirement-before Glen Nelson: I have mock 1.3.0 as a requirement for my project. Also, due to various reasons (corporate) I cannot upgrade to a version of virtualenv with setuptools 17.1, which mock requires. as such, I want to install setuptools 17.1 before everything else. There does not seem to be a way to do this. From issues-reply at bitbucket.org Tue Jun 28 21:21:50 2016 From: issues-reply at bitbucket.org (Jack Nicholson) Date: Wed, 29 Jun 2016 01:21:50 -0000 Subject: [Pytest-commit] Issue #340: Pytest: cannot use markers with tox.ini's posargs (hpk42/tox) Message-ID: <20160629012150.26685.27071@celery-worker-104.ash1.bb-inf.net> New issue 340: Pytest: cannot use markers with tox.ini's posargs https://bitbucket.org/hpk42/tox/issues/340/pytest-cannot-use-markers-with-toxinis Jack Nicholson: I have a custom marker in pytest registered as dev in my tox.ini tox.ini excerpt: ``` [testenv] commands = find . -name '*.pyc' -delete py.test -v -rsx --color=yes {posargs:tests/} rm -rf *.egg-info [pytest] markers = dev: tests for just the development environment ``` You can see pytest can see the marker ``` $ py.test --markers @pytest.mark.dev: tests for just the development environment ``` I can use my marker using `py.test -m dev tests/` but I cannot use the marker with `tox -- -m dev tests/` ``` pytest==2.9.0 tox==2.3.1 ``` on Windows 8.1 with Python 2.7.11 From issues-reply at bitbucket.org Thu Jun 30 15:58:24 2016 From: issues-reply at bitbucket.org (Aleks Bunin) Date: Thu, 30 Jun 2016 19:58:24 -0000 Subject: [Pytest-commit] Issue #341: Set environment variables based on ones in original environment (hpk42/tox) Message-ID: <20160630195824.68180.18139@celery-worker-102.ash1.bb-inf.net> New issue 341: Set environment variables based on ones in original environment https://bitbucket.org/hpk42/tox/issues/341/set-environment-variables-based-on-ones-in Aleks Bunin: Up until 2.0 and full isolation, I had access to all variables I desired. Later -- I need to pass variables to the tox environment. I need to have ability to either rename variable when it passed to the test environment. For example, in my tests, I need to know where to get external executable, which is different in every virtualenv from which I will run tox. For example: Let's say I'm in virtualenv and have executable `$VIRTUAL_ENV/v`. I have `VPATH` variable which points me to it. In tox virtualenvs I'll need to setup new `VPATH` which will point `{envdir}/v`. Currently I have to set VPATH_OUTSIDE prior to starting tox and use `pass=VPATH_OUTSIDE` in the `[testenv]`. How do I pass original VPATH? I'd want something like this: ``` [testenv] setenv= VPATH_OUTSIDE={passenv:VPATH} ``` I've looked through the doc and didn't find usable solution.