Skip to content

Simplify Travis-CI configuration #3220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 12 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,24 @@ dist: bionic
language: python
python: 3.7

matrix:
jobs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any significance or are they the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand it, they are different indeed: In a matrix build, every possible combination of configurations is run, jobs are more straight-forward. Since in our case each jobs is quite different from the others, a matrix build does not make much sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, jobs does sound more appropriate.

include:
- name: "pytype"
python: 3.6
env:
- TEST_CMD="./tests/pytype_test.py"
- INSTALL="test"
install: pip install -r requirements-tests-py3.txt
script: ./tests/pytype_test.py
- name: "mypy (typed-ast)"
env:
- TEST_CMD="./tests/mypy_test.py"
- INSTALL="mypy"
python: 3.7
install: pip install -U git+git://github.com/python/mypy git+git://github.com/python/typed_ast
script: ./tests/mypy_test.py
- name: "mypy (ast)"
python: 3.8-dev
env:
- TEST_CMD="./tests/mypy_test.py"
- INSTALL="mypy"
install: pip install -U git+git://github.com/python/mypy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure typed_ast should be removed here? As I understand it, mypy still depends on it even on 3.8.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem to be the case, since the build succeeds. At least at runtime it should not need it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't check but it probably installs typed_ast from PyPI because it is a dependency of mypy. But the intention was to check with the git typed_ast.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked at the travis log. It is indeed installing typed-ast from pypi, but I assume that it will not get used by mypy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked about it here -- according to the replies, it it still needed in Python 3.8 to parse Python 2 code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. But this shouldn't be a problem for us, since we are only parsing stubs and are not running mypy in Python 2 mode. I think using typed-ast from pypi is fine, but in the end it doesn't matter much, especially considering that typed-ast will probably not be developed any further.

I actually think it might be beneficial to use typed-ast from pypi in the < 3.8 test, but that's a discussion for another PR.

script: ./tests/mypy_test.py
- name: "mypy self test"
env: TEST_CMD="./tests/mypy_selftest.py"
script: ./tests/mypy_selftest.py
- name: "check file consistency"
env: TEST_CMD="./tests/check_consistent.py"
script: ./tests/check_consistent.py
- name: "flake8"
env:
- TEST_CMD="flake8"
- INSTALL="test"

install:
- if [[ $INSTALL == 'test' ]]; then pip install -r requirements-tests-py3.txt; fi
- if [[ $INSTALL == 'mypy' ]]; then pip install -U git+git://github.com/python/mypy git+git://github.com/python/typed_ast; fi

script:
- $TEST_CMD
install: pip install -r requirements-tests-py3.txt
script: flake8