How can I optimize my CIV Travis matrix for both Django and Python versions?

I have a .travis.yml file that looks like this:

https://gist.github.com/dyve/d79e5cd4f81bb2675181

(original: https://github.com/dyve/django-bootstrap3/blob/develop/.travis.yml )

I need to type multiple versions of Python and Django multiple times. I would like to:

  • Automatically select the latest Django 1.4, 1.5, 1.6 and 1.7
  • Exclude Python> 2 && Django <1.6
  • Exclude Python <2.7 && Django> 1.6

Is there a harsher way to do this in the Travis CI file?

+3


source to share


1 answer


You can customize the matrix in your .travis.yml file with both Python and Django versions. Here is an example .travis.yml I'm using.

You can also tell Travis CI to install the latest Django prior to a specific release using something similar to the following. Please note that this will Django<1.11

install the latest version 1.10.x.

matrix: - DJANGO="Django<1.8" - DJANGO="Django<1.9" - DJANGO="Django<1.10" - DJANGO="Django<1.11" - DJANGO="Django<1.12"



Also note that not all combinations have to pass, and not all combinations are officially supported. A list of Python / Django combinations to cover can be found in the Django docs .

Exceptions can be run using the following:

matrix: exclude: - python: "3.5" env: DJANGO="Django<1.8"

0


source







All Articles