Skip to content

Commit ae7395f

Browse files
authored
Merge pull request #737 from dan98765/pre_commit_runs_as_part_of_continuous_integration
Update .travis.yml file to use tox as script for running tests
2 parents 2e41db8 + 400a98d commit ae7395f

File tree

3 files changed

+32
-60
lines changed

3 files changed

+32
-60
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ repos:
1313
- id: end-of-file-fixer
1414
exclude: ^docs/.*$
1515
- id: trailing-whitespace
16+
exclude: README.md
1617
- id: pretty-format-json
1718
args:
1819
- --autofix
@@ -22,7 +23,7 @@ repos:
2223
hooks:
2324
- id: pyupgrade
2425
- repo: https://github.com/asottile/seed-isort-config
25-
rev: v1.0.0
26+
rev: v1.0.1
2627
hooks:
2728
- id: seed-isort-config
2829
- repo: https://github.com/pre-commit/mirrors-isort

.travis.yml

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,28 @@
11
language: python
2-
sudo: false
3-
python:
4-
- 2.7
5-
- 3.5
6-
- 3.6
7-
# - "pypy-5.3.1"
8-
before_install:
9-
- |
10-
if [ "$TRAVIS_PYTHON_VERSION" = "pypy" ]; then
11-
export PYENV_ROOT="$HOME/.pyenv"
12-
if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
13-
cd "$PYENV_ROOT" && git pull
14-
else
15-
rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
16-
fi
17-
export PYPY_VERSION="4.0.1"
18-
"$PYENV_ROOT/bin/pyenv" install "pypy-$PYPY_VERSION"
19-
virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" "$HOME/virtualenvs/pypy-$PYPY_VERSION"
20-
source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate"
21-
fi
22-
install:
23-
- |
24-
if [ "$TEST_TYPE" = build ]; then
25-
pip install -e .[test]
26-
python setup.py develop
27-
elif [ "$TEST_TYPE" = lint ]; then
28-
pip install flake8
29-
elif [ "$TEST_TYPE" = mypy ]; then
30-
pip install mypy
31-
fi
32-
script:
33-
- |
34-
if [ "$TEST_TYPE" = lint ]; then
35-
echo "Checking Python code lint."
36-
flake8 graphene
37-
exit
38-
elif [ "$TEST_TYPE" = mypy ]; then
39-
echo "Checking Python types."
40-
mypy graphene
41-
exit
42-
elif [ "$TEST_TYPE" = build ]; then
43-
py.test --cov=graphene graphene examples
44-
fi
45-
after_success:
46-
- |
47-
if [ "$TEST_TYPE" = build ]; then
48-
coveralls
49-
fi
50-
env:
51-
matrix:
52-
- TEST_TYPE=build
53-
global:
54-
secure: SQC0eCWCWw8bZxbLE8vQn+UjJOp3Z1m779s9SMK3lCLwJxro/VCLBZ7hj4xsrq1MtcFO2U2Kqf068symw4Hr/0amYI3HFTCFiwXAC3PAKXeURca03eNO2heku+FtnQcOjBanExTsIBQRLDXMOaUkf3MIztpLJ4LHqMfUupKmw9YSB0v40jDbSN8khBnndFykmOnVVHznFp8USoN5F0CiPpnfEvHnJkaX76lNf7Kc9XNShBTTtJsnsHMhuYQeInt0vg9HSjoIYC38Tv2hmMj1myNdzyrHF+LgRjI6ceGi50ApAnGepXC/DNRhXROfECKez+LON/ZSqBGdJhUILqC8A4WmWmIjNcwitVFp3JGBqO7LULS0BI96EtSLe8rD1rkkdTbjivajkbykM1Q0Tnmg1adzGwLxRUbTq9tJQlTTkHBCuXIkpKb1mAtb/TY7A6BqfnPi2xTc/++qEawUG7ePhscdTj0IBrUfZsUNUYZqD8E8XbSWKIuS3SHE+cZ+s/kdAsm4q+FFAlpZKOYGxIkwvgyfu4/Plfol4b7X6iAP9J3r1Kv0DgBVFst5CXEwzZs19/g0CgokQbCXf1N+xeNnUELl6/fImaR3RKP22EaABoil4z8vzl4EqxqVoH1nfhE+WlpryXsuSaF/1R+WklR7aQ1FwoCk8V8HxM2zrj4tI8k=
552
matrix:
56-
fast_finish: true
573
include:
58-
- python: '2.7'
59-
env: TEST_TYPE=lint
60-
- python: '3.6'
61-
env: TEST_TYPE=mypy
4+
- env: TOXENV=py27
5+
python: 2.7
6+
- env: TOXENV=py34
7+
python: 3.4
8+
- env: TOXENV=py35
9+
python: 3.5
10+
- env: TOXENV=py36
11+
python: 3.6
12+
- env: TOXENV=pypy
13+
python: pypy-5.7.1
14+
- env: TOXENV=pre-commit
15+
python: 3.6
16+
- env: TOXENV=mypy
17+
python: 3.6
18+
install:
19+
- pip install coveralls tox
20+
script: tox
21+
after_success: coveralls
22+
cache:
23+
directories:
24+
- $HOME/.cache/pip
25+
- $HOME/.cache/pre-commit
6226
deploy:
6327
provider: pypi
6428
user: syrusakbary

tox.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,py27,py33,py34,py35,py36,pre-commit,pypy
2+
envlist = flake8,py27,py33,py34,py35,py36,pre-commit,pypy,mypy
33
skipsdist = true
44

55
[testenv]
@@ -18,6 +18,13 @@ setenv =
1818
commands =
1919
pre-commit {posargs:run --all-files}
2020

21+
[testenv:mypy]
22+
basepython=python3.6
23+
deps =
24+
mypy
25+
commands =
26+
mypy graphene
27+
2128
[testenv:flake8]
2229
deps = flake8
2330
commands =

0 commit comments

Comments
 (0)