Tox 4.x: specify multiline lists in variables? (or expand them without the newline characters)

Hi,

First of all, thanks a lot for writing, maintaining, and developing all the tools in the Python ecosystem! Apologies if this is not the place for such a question or if it has been discussed before.

In short, I have the following setup in lots of my Tox 3.x tox.ini files:

[defs]
pyfiles =
  src/confget
  src/some_other_tool_or_module
  unit_tests

...
[testenv:pylint]
...
commands =
  pylint -- {[defs]pyfiles}

So this works with Tox 3.x: it expands the variable, apparently replaces the newline characters with spaces or something like that, and then runs the command on all the files. The same tox.ini syntax with Tox 4.x leads to Tox passing pylint -- src/confget<newline> src/...</newline> unit_tests to the shell, and so the shell treats those as three separate commands, which is not exactly the intent here :slight_smile:

I mean, I understand why Tox 4.x would do that: after all, I did include some newline characters in the variable’s value, so it wants to reflect that in the command. Still, is there a way to achieve what I want in Tox 4.x syntax? I know I can specify all the files on a single line, but I kind of like the readability of the one-per-line format…

Thanks again, and keep up the great work!

G’luck,
Peter

(so yeah, part of the point that I did not mention explicitly is that this list of files is used in the “commands” section of several Tox test environments that invoke various static checkers and such)

You should ask this on a tox-specific forum, since this isn’t a Python issue. Maybe Issues · tox-dev/tox · GitHub.

1 Like

Right… the truth is, I got this discuss location from the “New issue” link there, but okay, yes, I may have misunderstood the intent a bit (I thought that since I have a question, and not a bug report or feature request, the question should be asked here). Apologies for the noise, and thanks!

1 Like

GitHub has its own Q&A-StackOverflow-like type of thing now. @ppentchev I guess this is where you could ask: Discussions · tox-dev/tox · GitHub and I wonder why they did not redirect you there instead of here.

But it looks like a bug (regression?) to me, so I guess if I were you I would report it there: Issues · tox-dev/tox · GitHub

Good luck :slight_smile: