Skip to content

Commit 2288f9a

Browse files
authored
Merge pull request #80 from ayan-b/sep-lint
Do not install from requirements if in lint stage
2 parents 9d989c9 + b8b61f8 commit 2288f9a

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

.travis.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,37 @@ install:
1010
stages:
1111
- test
1212
- moban
13+
- lint
14+
15+
.disable_global: &disable_global
16+
before_install: false
17+
install: true
18+
before_script: false
19+
after_success: false
20+
after_failure: false
21+
22+
.lint: &lint
23+
<<: *disable_global
24+
python: 3.6
25+
stage: lint
26+
install: pip install flake8
27+
script: flake8
28+
29+
.moban: &moban
30+
<<: *disable_global
31+
python: 2.7
32+
stage: moban
33+
install: pip install moban>=0.0.4
34+
script: make
1335

1436
jobs:
1537
include:
16-
- stage: moban
17-
script:
18-
- make
19-
- git diff --exit-code
38+
- *moban
39+
- *lint
2040

2141
stage: test
2242

2343
script:
2444
- find templates/ -type f -name '*.jj2' -exec echo '{}' \;|sed -e "s/templates\//{%include \"/" -e "s/$/\" %}/" > test.file
2545
- moban -c config/data.yml -t test.file -td templates .
2646
- pytest
27-
- flake8

templates/travis.yml.jj2

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,24 @@ python:
2323
stages:
2424
- test
2525
- lint
26+
27+
.disable_global: &disable_global
28+
before_install: false
29+
install: true
30+
before_script: false
31+
after_success: false
32+
after_failure: false
33+
34+
.lint: &lint
35+
<<: *disable_global
36+
python: 3.6
37+
stage: lint
38+
install: pip install flake8
39+
script: flake8
40+
2641
jobs:
2742
include:
28-
- stage: lint
29-
python: 3.6
30-
script: make lint
43+
- *lint
3144

3245
stage: test
3346

@@ -36,7 +49,6 @@ script: make test
3649
before_install:
3750
{% block custom_install %}
3851
{% endblock%}
39-
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
4052
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
4153
mv min_requirements.txt requirements.txt ;
4254
fi

0 commit comments

Comments
 (0)