forked from mwouts/jupytext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
62 lines (61 loc) · 2.53 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
language: python
python:
- "3.6"
- "pypy"
- "2.7"
- "3.4"
- "3.5"
matrix:
include:
- python: 3.7
dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069)
sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069)
- python: 3.8
dist: xenial
sudo: required
install:
# Python 2.7 and 3.4 are mapped to miniconda2 and miniconda3, respectively. This way we can test jupytext with pandoc
# Script adapted from https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]] || [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then
sudo apt-get update;
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda config --append channels conda-forge;
conda info -a;
conda create -q -n jupytext-env --file requirements-dev.txt --file requirements.txt;
source activate jupytext-env;
conda install pandoc codecov -c conda-forge;
pandoc -v;
else
pip install -r requirements-dev.txt;
pip install -r requirements.txt;
fi
# install is required for testing the pre-commit mode
- pip install . || true
# install black if available (Python 3.6 and above), and autopep8 for testing the pipe mode
- pip install black || true
- pip install autopep8 || true
# install sphinx_gallery and matplotlib if available (may not work on pypy)
- pip install sphinx_gallery || true
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# all Python files should follow PEP8 (except some notebooks, see setup.cfg)
- flake8 jupytext tests
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --statistics
script:
- coverage run --source=. -m py.test
# Test HTML display of Utf-8 chars with pipes
- echo "from IPython.core.display import HTML; HTML(u'\xd7')" | jupytext --from py --to ipynb --set-kernel - --execute > out.ipynb
after_success:
- coverage report -m
- codecov