# Config with a python build and a matrix only runs the matrix

**URL:** <https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309>\
**Category:** Python\
**Created:** [October 4, 2019, 9:17pm UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309 "2019-10-04T21:17:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![albireox](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/albireox/32/2830_2.png) [@albireox](https://travis-ci.community/u/albireox)\
**Post date:** [October 4, 2019, 9:17pm UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/1 "2019-10-04T21:17:58Z")

</div>

If I try to build using this config file only the 3.8-dev job runs although I’d expect 3.7 to be build as well.

```auto
cache:
  pip: true
  timeout: 1000

language: python

python: 
  - 3.7

matrix:
  fast_finish: true
  include:
    - python: 3.8-dev
      dist: xenial
      sudo: true
      before_install:
        - pip install git+https://github.com/astropy/astropy@master
  allow_failures:
    - python: 3.8-dev

notifications:
  email: false

# repo branches to test
branches:
  - master

install:
  - pip install -U pip wheel --quiet
  - pip install --upgrade setuptools --quiet
  - pip install pytest
  - pip install pytest-coverage
  - pip install coveralls
  - pip install .[dev]

script:
  - pytest --cov basecam --cov-report html

after_success:
  - coveralls

```

However, if I change the `python` key to

```auto
python:
  - 3.6
  - 3.7

```

Then all 3.6, 3.7, and 3.8-dev run.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 4, 2019, 10:16pm UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/2 "2019-10-04T22:16:48Z")

</div>

> [@Overriding default job from os matrix](https://travis-ci.community/t/overriding-default-job-from-os-matrix/2328/2):
>
> When there is only one job at the top level of the configuration (without any matrix expansion), matrix.include (and its alias jobs.include) completely defines the jobs defined in the build (so the top level job is not included in the build).

---

<div class="post-metadata">

**Author:** ![albireox](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/albireox/32/2830_2.png) [@albireox](https://travis-ci.community/u/albireox)\
**Post date:** [October 5, 2019, 2:21am UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/3 "2019-10-05T02:21:57Z")

</div>

That’s not very intuitive IMHO but at least it should be documented somewhere. If it is I was not able to find it.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 5, 2019, 3:37am UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/4 "2019-10-05T03:37:04Z")

</div>

> <https://github.com/travis-ci/docs-travis-ci-com/pull/2544>

---

<div class="post-metadata">

**Author:** ![albireox](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/albireox/32/2830_2.png) [@albireox](https://travis-ci.community/u/albireox)\
**Post date:** [October 5, 2019, 4:29am UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/5 "2019-10-05T04:29:00Z")

</div>

Awesome! Thanks.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [January 28, 2020, 12:27pm UTC](https://travis-ci.community/t/config-with-a-python-build-and-a-matrix-only-runs-the-matrix/5309/6 "2020-01-28T12:27:12Z")

</div>

A post was split to a new topic: [Matrix expansion with explicit jobs is not done unless I define an empty stage](https://travis-ci.community/t/matrix-expansion-with-explicit-jobs-is-not-done-unless-i-define-an-empty-stage/7028)
