[TIP] Fwd: finalizing tox's new parametrized configuration (RFC)
Alexander Schepanovski
suor.web at gmail.com
Fri Aug 8 07:55:45 PDT 2014
> Using the new syntax your tox.ini should collapse like this::
>
> [tox]
> envlist = {py26,py27,py32,py33}-{1.4,1.5,1.6},
> {py27,py32,py33}-trunk,
> py27-1.5-nosouth
>
> [testenv]
> deps =
> coverage == 3.6
> 1.4: Django == 1.4.10
> 1.5: Django == 1.5.5
> 1.6: https://github.com/django/django/tarball/stable/1.6.x
> trunk: https://github.com/django/django/tarball/master
> 1.4: South == 0.7.6
> 1.5,1.6: South == 0.8.1
>
> commands = coverage run -a setup.py test
There is one nuance here not covered: South==0.8.1 will be installed for
py27-1.5-nosouth. To handle that one could change last deps line to:
1.5-!nosouth,1.6: South == 0.8.1
(Neither AND with -, nor negation inside an expression are implemented yet)
However, negation could lead to confusion I told about earlier, so we (me
and Holger) are agreed to exclude it for now. Without using negation this
could be written as:
[tox]
envlist = {py26,py27,py32,py33}-{1.4,1.5,1.6}-south,
{py27,py32,py33}-trunk-south,
py27-1.5-nosouth
[testenv]
deps =
...
{1.5,1.6}-south: South == 0.8.1
Also note that {,,} is expansion not OR, so you could equally write
"py{26,27,33,34}" or "{py26,py27,py33,py34}" both in envlist and in factor
expression.
2014-08-08 20:46 GMT+08:00 holger krekel <holger at merlinux.eu>:
> Hi Alex, (including your considerations to the list again),
>
> On Fri, Aug 08, 2014 at 19:09 +0800, Alexander Schepanovski wrote:
>
> > ---------- Forwarded message ----------
> > From: Alexander Schepanovski <suor.web at gmail.com>
> > Date: 2014-08-08 14:01 GMT+08:00
> > Subject: Re: [TIP] finalizing tox's new parametrized configuration (RFC)
> > To: "Masiar, Peter (PMASIAR)" <PMASIAR at arinc.com>
> >
> >
> > Thinking about it a bit more, I came to a thought that me can solve
> > problems with negation and its precedence by limiting its use. There are
> 2
> > plausible approaches I see:
> >
> > 1. Do not allow negation at all. Will arguably make things more explicit
> > and only a bit longer: "!py26" -> "py27,py33,py34", "py26-!django13" ->
> > "py26-django{14,15,16}". This way factor lists will look exactly like
> > envlist, which is a good thing, I think. I know negation is already
> > supported, but it's not released so removing it will be backward
> compatible
> > change.
>
> I agree. Allowing the "generative" envlist syntax in the conditional
> expression would help to live without negation.
>
> > 2. Only allow negation outside "hyphenated words", negating the whole
> > thing. This will make exceptions easier. As an added bonus we can use
> > negations in envlist, meaning exceptions:
> > py{26,27,33,34}-django{13,14,15,16,17},
> > !py26-django17, # dropped
> python
> > 2.6 support in django 1.7
> > !py{33,34}-django{13,14} # python 3
> supported
> > since django 1.5
> > Helps with non rectangular matrices.
> >
> > Both approaches forbid some very confusing constructs like "!py26-!py27".
> > "py26-py27" is also confusing, but it makes no sense since factors from
> > same set are mutually exclusive, while their negations are not.
> >
> > Also, second approach is a backward compatible extension of the first
> one,
> > so we could start with a first and look if anyone will really need
> negation
> > at all.
>
> I agree. Let's remove negation and go for variant 1. for releasing
> tox-1.8.
> When negation is really needed (haven't seen a real-life example yet) we
> can
> think about the rules -- we could e.g. then require !(.*), i.e.
> parentheses after "!" to make it clear and not require knowing about
> precendence rules when reading a tox.ini.
>
> best,
> holger
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140808/c7074a34/attachment-0001.html>
More information about the testing-in-python
mailing list