|
1 |
| -sudo: false |
2 | 1 | notifications:
|
3 | 2 | email: false
|
4 | 3 | dist: xenial
|
5 | 4 | language: python
|
6 |
| -python: |
7 |
| - - "2.7" |
8 |
| - - "3.6" |
9 |
| -env: |
10 |
| - - JAX_ENABLE_X64=0 JAX_NUM_GENERATED_CASES=25 |
11 |
| - - JAX_ENABLE_X64=1 JAX_NUM_GENERATED_CASES=25 |
| 5 | +os: linux |
| 6 | +jobs: |
| 7 | + include: |
| 8 | + - python: "3.6" |
| 9 | + env: JAX_ONLY_CHECK_TYPES=true |
| 10 | + - python: "3.6" |
| 11 | + env: JAX_ENABLE_X64=0 JAX_NUM_GENERATED_CASES=25 |
| 12 | + - python: "3.6" |
| 13 | + env: JAX_ENABLE_X64=1 JAX_NUM_GENERATED_CASES=25 |
| 14 | + - python: "3.7" |
| 15 | + env: JAX_ENABLE_X64=1 JAX_ONLY_DOCUMENTATION=true |
| 16 | + |
12 | 17 | before_install:
|
13 |
| - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then |
14 |
| - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; |
15 |
| - else |
16 |
| - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; |
17 |
| - fi |
| 18 | + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; |
18 | 19 | - bash miniconda.sh -b -p $HOME/miniconda
|
19 | 20 | - export PATH="$HOME/miniconda/bin:$PATH"
|
20 |
| - - conda update --yes conda |
| 21 | + - conda config --set always_yes yes --set changeps1 no --set show_channel_urls yes |
| 22 | + - conda config --set channel_priority strict |
| 23 | + - conda config --set add_pip_as_python_dependency yes |
| 24 | + - conda config --remove channels defaults |
21 | 25 | - conda config --add channels conda-forge
|
| 26 | + - conda update -q conda |
22 | 27 | install:
|
23 |
| - - conda install --yes python=$TRAVIS_PYTHON_VERSION pip six protobuf>=3.6.0 absl-py opt_einsum numpy scipy pytest-xdist fastcache |
24 |
| - - pip install jaxlib |
| 28 | + - conda install --yes python=$TRAVIS_PYTHON_VERSION pip absl-py opt_einsum numpy scipy pytest-xdist pytest-benchmark mypy |
| 29 | + - if [ "$JAX_ONLY_CHECK_TYPES" = true ]; then |
| 30 | + pip install pytype ; |
| 31 | + fi |
| 32 | + # The jaxlib version should match the minimum jaxlib version in |
| 33 | + # jax/lib/__init__.py. This tests JAX PRs against the oldest permitted |
| 34 | + # jaxlib. |
| 35 | + - pip install jaxlib==0.1.43 |
25 | 36 | - pip install -v .
|
| 37 | + # The following are needed to test the Colab notebooks and the documentation building |
| 38 | + - if [ "$JAX_ONLY_DOCUMENTATION" = true ]; then |
| 39 | + conda install --yes -c conda-forge pandoc ipykernel; |
| 40 | + conda install --yes sphinx sphinx_rtd_theme nbsphinx sphinx-autodoc-typehints jupyter_client matplotlib; |
| 41 | + pip install sklearn; |
| 42 | + fi |
26 | 43 | script:
|
27 |
| - - pytest -n 1 tests examples -W ignore |
| 44 | + - if [ "$JAX_ONLY_DOCUMENTATION" = true ]; then |
| 45 | + sphinx-build -b html -D nbsphinx_execute=always docs docs/build/html ; |
| 46 | + elif [ "$JAX_ONLY_CHECK_TYPES" = true ]; then |
| 47 | + echo "===== Checking with mypy ====" && |
| 48 | + time mypy --config-file=mypy.ini jax ; |
| 49 | + else |
| 50 | + pytest tests examples -W ignore ; |
| 51 | + fi |
0 commit comments