Skip to content

Commit e3ed15d

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 e3ed15d

File tree

9 files changed

+26
-13
lines changed

9 files changed

+26
-13
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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/atodorov/pocketlint/zipball/fallback_to_pypi_pylint
9+
10+
script:
11+
- make ci

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ docs:
4646
check:
4747
@echo "*** Running pylint to verify source ***"
4848
PYTHONPATH=. tests/pylint/runpylint.py
49+
@which mypy || (echo "*** Please install mypy (python3-mypy) ***"; exit 2)
50+
@echo "*** Running type checks ***"
51+
PYTHONPATH=. mypy pykickstart
4952
@echo "*** Running tests on translatable strings ***"
5053
$(MAKE) -C po $(PKGNAME).pot
51-
PYTHONPATH=translation-canary python3 -m translation_canary.translatable po/$(PKGNAME).pot
54+
PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translatable po/$(PKGNAME).pot
5255
git checkout -- po/$(PKGNAME).pot || true
5356

5457
# Left here for backwards compability - in case anyone was running the test target. Now you always get coverage.
@@ -59,10 +62,7 @@ coverage:
5962
@echo "*** Running unittests with coverage ***"
6063
PYTHONPATH=. $(PYTHON) -m nose --with-coverage --cover-erase --cover-branches --cover-package=pykickstart --cover-package=tools $(NOSEARGS)
6164
$(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
65+
$(COVERAGE) report -m --include="pykickstart/*,tools/*" | tee coverage-report.log
6666

6767
clean:
6868
-rm *.tar.gz pykickstart/*.pyc pykickstart/*/*.pyc tests/*.pyc tests/*/*.pyc docs/programmers-guide *log .coverage
@@ -87,7 +87,7 @@ archive: check test tag docs
8787
cp -r po/*.po $(PKGNAME)-$(VERSION)/po/
8888
$(MAKE) -C $(PKGNAME)-$(VERSION)/po
8989
cp docs/programmers-guide $(PKGNAME)-$(VERSION)/docs/
90-
PYTHONPATH=translation-canary python3 -m translation_canary.translated --release $(PKGNAME)-$(VERSION)
90+
PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translated --release $(PKGNAME)-$(VERSION)
9191
( cd $(PKGNAME)-$(VERSION) && $(PYTHON) setup.py -q sdist --dist-dir .. )
9292
rm -rf $(PKGNAME)-$(VERSION)
9393
git checkout -- po/$(PKGNAME).pot
@@ -141,6 +141,6 @@ rc-release: scratch-bumpver scratch
141141
mock -r $(MOCKCHROOT) --rebuild *src.rpm --resultdir $(shell pwd) || exit 1
142142

143143
ci:
144-
$(MAKE) PYTHON=python3 check coverage
144+
$(MAKE) PYTHON=$(PYTHON) check coverage
145145

146146
.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)