Trouble with Python build matrix being respected by jobs

bug
#1

This is my build:
https://travis-ci.org/SaltieRL/DistributedReplays/builds/533611955

I have setup jobs but they are not being able to run the build matrix
Instead it is adding 2 random python ones and then running all the stages on who knows what python version

sudo: required
dist: xenial
language: python
python:
  - '3.6'
  - '3.7'

services:
- postgresql
- redis-server

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test


install:
- pip install -r requirements.txt
- pip install -r requirements-test.txt
- ls
- cd webapp
- npm install
- cd $TRAVIS_BUILD_DIR

script: echo 'nothing'

stages:
  - lint
  - test
  - deploy


jobs:
  include:
    - stage: lint
      name: "style checks"
      python: "3.7"
      script:
        - chmod 777 .travis/tslint.sh && .travis/tslint.sh
    - stage: test
      name: "server unit tests"
      script:
        - pytest --cov=./
        - bash <(curl -s https://codecov.io/bash) -c -F server
    - stage: test
      name: "integration tests"
      script:
        - cd $TRAVIS_BUILD_DIR
        - cd webapp
        - npm install
        - npm start &
        - cd $TRAVIS_BUILD_DIR
        - celery -A backend.tasks.celery_tasks.celery worker --pool=solo -l info &
        - python3 RLBotServer.py &
    - stage: test
      name: "react unit tests"
      # we only need to run npm tests for one python version
      python: "3.6"
      script:
        - cd webapp
        - npm test
    - stage: deploy
      name: "Deploy"
      python: "3.7"
      after_success:
      - codecov
      - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
      - chmod +x .travis/send.sh
      - ./.travis/send.sh success $WEBHOOK_URL

      after_failure:
        - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
        - chmod +x .travis/send.sh
        - ./.travis/send.sh failure $WEBHOOK_URL

Is there something I am doing wrong?
I am following the docs and in them the matrix is followed

#2

include: jobs exist independently from the build matrix and are added on top of it.

So you get two jobs from the python: axis in the default test stage, accompanied with all the jobs you specified in include:, without a python: setting.

AFAICS from https://docs.travis-ci.com/user/build-stages/#how-to-define-build-stages , stages are not considered an axis so you cannot add jobs to more than one stage using the matrix.

As such, the way to go seems to be to either

  • specify all the jobs manually, using YAML aliases to reduce duplication, or
  • only manually duplicate jobs as above in stages with fewer jobs and specify python: for them manually.
Using build matrix for custom stage
#3

Is there a way to specify jobs without the include?

And why do all stages specify specific versions of the matrix when they want to run solo in the docs?