Skip to content

Commit 69ad22c

Browse files
committed
Refactor the CI script a bit to make adding black check easier
1 parent beb596c commit 69ad22c

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ install:
1212
# mypy can't be installed on pypy
1313
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install mypy ; fi
1414
script:
15-
- make test_coverage
16-
- flake8 --version
17-
- make flake8
18-
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then make mypy ; fi
15+
- make ci
1916
after_success:
2017
- coveralls

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
.PHONY: all virtualenv
22
MAX_LINE_LENGTH=110
3+
PYTHON_IMPLEMENTATION:=$(shell python -c "import sys;import platform;sys.stdout.write(platform.python_implementation())")
4+
5+
LINT_TARGETS:=flake8
6+
ifneq ($(findstring PyPy,$(PYTHON_IMPLEMENTATION)),PyPy)
7+
LINT_TARGETS:=$(LINT_TARGETS) mypy
8+
endif
9+
310

411
virtualenv: ./env/requirements.built
512

@@ -10,6 +17,12 @@ env:
1017
./env/bin/pip install -r requirements-dev.txt
1118
cp requirements-dev.txt ./env/requirements.built
1219

20+
.PHONY: ci
21+
ci: test_coverage lint
22+
23+
.PHONY: lint
24+
lint: $(LINT_TARGETS)
25+
1326
flake8:
1427
flake8 --max-line-length=$(MAX_LINE_LENGTH) examples *.py
1528

0 commit comments

Comments
 (0)