Skip to content

Commit f18eb94

Browse files
committed
Enable Travis-CI
- use /usr/bin/env instead of hard-coded /usr/bin/python3 - move mypy checks into the `check` target - disable pylint import checks for setup.py because of pylint-dev/pylint#73 (comment)
1 parent f3802bc commit f18eb94

File tree

9 files changed

+37
-16
lines changed

9 files changed

+37
-16
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: python
2+
python:
3+
- "3.5"
4+
5+
install:
6+
- pip install --upgrade pip setuptools
7+
- pip install coverage mypy-lang nose ordered-set polib pylint requests six
8+
- pip install https://github.com/rhinstaller/pocketlint/zipball/master
9+
10+
script:
11+
- make ci
12+
13+
notifications:
14+
email:
15+
on_success: change
16+
on_failure: change

Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ PYTHON?=python3
1919

2020
ifeq ($(PYTHON),python3)
2121
COVERAGE=coverage3
22-
# Coverage + multiprocessing does not work under python2. Oh well, just don't use multiprocessing there.
23-
# We default to python3 now so everyone else can just deal with the slowness.
24-
NOSEARGS+=--processes=-1 $(tests)
22+
ifneq ($(TRAVIS),true)
23+
# Coverage + multiprocessing does not work under python2. Oh well, just don't use multiprocessing there.
24+
# We default to python3 now so everyone else can just deal with the slowness.
25+
NOSEARGS+=--processes=-1
26+
endif
27+
NOSEARGS+=$(tests)
2528
else
2629
COVERAGE?=coverage
2730
NOSEARGS+=$(filter-out tests/attrs.py,$(tests))
@@ -46,9 +49,12 @@ docs:
4649
check:
4750
@echo "*** Running pylint to verify source ***"
4851
PYTHONPATH=. tests/pylint/runpylint.py
52+
@which mypy || (echo "*** Please install mypy (python3-mypy) ***"; exit 2)
53+
@echo "*** Running type checks ***"
54+
PYTHONPATH=. mypy pykickstart
4955
@echo "*** Running tests on translatable strings ***"
5056
$(MAKE) -C po $(PKGNAME).pot
51-
PYTHONPATH=translation-canary python3 -m translation_canary.translatable po/$(PKGNAME).pot
57+
PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translatable po/$(PKGNAME).pot
5258
git checkout -- po/$(PKGNAME).pot || true
5359

5460
# Left here for backwards compability - in case anyone was running the test target. Now you always get coverage.
@@ -59,10 +65,7 @@ coverage:
5965
@echo "*** Running unittests with coverage ***"
6066
PYTHONPATH=. $(PYTHON) -m nose --with-coverage --cover-erase --cover-branches --cover-package=pykickstart --cover-package=tools $(NOSEARGS)
6167
$(COVERAGE) combine
62-
$(COVERAGE) report -m | tee coverage-report.log
63-
@which mypy || (echo "*** Please install mypy (python3-mypy) ***"; exit 2)
64-
@echo "*** Running type checks ***"
65-
PYTHONPATH=. mypy pykickstart
68+
$(COVERAGE) report -m --include="pykickstart/*,tools/*" | tee coverage-report.log
6669

6770
clean:
6871
-rm *.tar.gz pykickstart/*.pyc pykickstart/*/*.pyc tests/*.pyc tests/*/*.pyc docs/programmers-guide *log .coverage
@@ -87,7 +90,7 @@ archive: check test tag docs
8790
cp -r po/*.po $(PKGNAME)-$(VERSION)/po/
8891
$(MAKE) -C $(PKGNAME)-$(VERSION)/po
8992
cp docs/programmers-guide $(PKGNAME)-$(VERSION)/docs/
90-
PYTHONPATH=translation-canary python3 -m translation_canary.translated --release $(PKGNAME)-$(VERSION)
93+
PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translated --release $(PKGNAME)-$(VERSION)
9194
( cd $(PKGNAME)-$(VERSION) && $(PYTHON) setup.py -q sdist --dist-dir .. )
9295
rm -rf $(PKGNAME)-$(VERSION)
9396
git checkout -- po/$(PKGNAME).pot
@@ -141,6 +144,6 @@ rc-release: scratch-bumpver scratch
141144
mock -r $(MOCKCHROOT) --rebuild *src.rpm --resultdir $(shell pwd) || exit 1
142145

143146
ci:
144-
$(MAKE) PYTHON=python3 check coverage
147+
$(MAKE) PYTHON=$(PYTHON) check coverage
145148

146149
.PHONY: check clean install tag archive local docs release

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# pylint: disable=import-error,no-name-in-module
2+
# See https://github.com/PyCQA/pylint/issues/73#issuecomment-163171888
13
from distutils.core import setup
24
from distutils.command.install_scripts import install_scripts as _install_scripts
35
from distutils.file_util import move_file

tests/pylint/runpylint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22

33
import sys
44

tools/ksflatten.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22
#
33
# Simple script to take a kickstart config, read it in, parse any %includes,
44
# etc to write out a flattened config that is stand-alone

tools/ksshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22
#
33
# Chris Lumens <[email protected]>
44
#

tools/ksvalidator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22
#
33
# Chris Lumens <[email protected]>
44
#

tools/ksverdiff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22
#
33
# Chris Lumens <[email protected]>
44
#

translation-canary/tests/pylint/runpylint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22

33
import sys
44
from pocketlint import PocketLintConfig, PocketLinter

0 commit comments

Comments
 (0)