tox-dev / tox-travis

Seamless integration of tox into Travis CI
https://tox-travis.readthedocs.io
MIT License
202 stars 34 forks source link

travis:env values not split #130

Closed jayvdb closed 1 year ago

jayvdb commented 5 years ago

Rather foolish now I think about it, I was expecting the following to

[travis:env]
TRAVIS_LANGUAGE =
  swift,objectivec,objective_c,objective-c: py36-swift-noskip

to be expanded to

[travis:env]
TRAVIS_LANGUAGE =
   swift: py36-swift-noskip
   objectivec: py36-swift-noskip
   ...

Instead, under the covers is

'swift,objectivec,objective_c,objective-c': 'py36-swift-noskip'

The reason for my confusion is simple: that is how argvlists in tox work -- they have factors at the beginning before the :, and factor names cant include commas. In this case, it is envvar values before the : , and they can include commas.

Should we use the same parser? IMO, yes. It is easy to remember that these values are envvars rather than factors. It is harder to remember that they do not follow the same semantics.

The fact that envvars can (and often do) have commas is a bit troublesome, but at least TRAVIS_LANGUAGE doesnt contain commas, and probably TRAVIS_* too. But if the envvar value in Travis does contain commas, the comparison should be literal (not splitting on ,).

ryanhiebert commented 5 years ago

That sounds reasonable to me.

jayvdb commented 5 years ago

Another reason I've run into is TRAVIS_JDK_VERSION , which is the only 'java version' and is shared with scala, swift, kotlin, etc . It is populated with values:

Ideally I want to split them into three

TRAVIS_JDK_VERSION =
  oraclejdk11,oraclejdk9,openjdk11,openjdk10,openjdk9: py36-javanew-allowskip
  openjdk8: py36-java8-noskip
  openjdk7: py36-java7-noskip

Even better would be to allow {x,y} alternation syntax from envnames so it becomes:

TRAVIS_JDK_VERSION =
  {open,oracle}jdk{9,10,11}: py36-javanew-allowskip
  openjdk8: py36-java8-noskip
  openjdk7: py36-java7-noskip

And with the ! syntax:

TRAVIS_JDK_VERSION =
  !openjdk{7,8}: py36-javanew-allowskip
  openjdk8: py36-java8-noskip
  openjdk7: py36-java7-noskip

! at the beginning of an envvar value sounds unlikely, and also undesirable/spank-me-im-stupid.

I am less confident about { and } in envvars.