diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..ad535cd8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: python +python: + - "3.5" + +install: + - pip install --upgrade pip setuptools + - pip install coverage nose ordered-set six mypy-lang requests pylint + - pip install https://github.com/atodorov/pocketlint/zipball/fallback_to_pypi_pylint + - pip freeze --all + +script: + - make ci diff --git a/Makefile b/Makefile index 75a7c986..0914579d 100644 --- a/Makefile +++ b/Makefile @@ -46,9 +46,12 @@ docs: check: @echo "*** Running pylint to verify source ***" PYTHONPATH=. tests/pylint/runpylint.py + @which mypy || (echo "*** Please install mypy (python3-mypy) ***"; exit 2) + @echo "*** Running type checks ***" + PYTHONPATH=. mypy pykickstart @echo "*** Running tests on translatable strings ***" $(MAKE) -C po $(PKGNAME).pot - PYTHONPATH=translation-canary python3 -m translation_canary.translatable po/$(PKGNAME).pot + PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translatable po/$(PKGNAME).pot git checkout -- po/$(PKGNAME).pot || true # Left here for backwards compability - in case anyone was running the test target. Now you always get coverage. @@ -60,9 +63,6 @@ coverage: PYTHONPATH=. $(PYTHON) -m nose --with-coverage --cover-erase --cover-branches --cover-package=pykickstart --cover-package=tools $(NOSEARGS) $(COVERAGE) combine $(COVERAGE) report -m | tee coverage-report.log - @which mypy || (echo "*** Please install mypy (python3-mypy) ***"; exit 2) - @echo "*** Running type checks ***" - PYTHONPATH=. mypy pykickstart clean: -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 cp -r po/*.po $(PKGNAME)-$(VERSION)/po/ $(MAKE) -C $(PKGNAME)-$(VERSION)/po cp docs/programmers-guide $(PKGNAME)-$(VERSION)/docs/ - PYTHONPATH=translation-canary python3 -m translation_canary.translated --release $(PKGNAME)-$(VERSION) + PYTHONPATH=translation-canary $(PYTHON) -m translation_canary.translated --release $(PKGNAME)-$(VERSION) ( cd $(PKGNAME)-$(VERSION) && $(PYTHON) setup.py -q sdist --dist-dir .. ) rm -rf $(PKGNAME)-$(VERSION) git checkout -- po/$(PKGNAME).pot @@ -141,6 +141,6 @@ rc-release: scratch-bumpver scratch mock -r $(MOCKCHROOT) --rebuild *src.rpm --resultdir $(shell pwd) || exit 1 ci: - $(MAKE) PYTHON=python3 check coverage + $(MAKE) PYTHON=$(PYTHON) check coverage .PHONY: check clean install tag archive local docs release diff --git a/setup.py b/setup.py index 97756aaf..ad41b020 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +# pylint: disable=import-error,no-name-in-module +# See https://github.com/PyCQA/pylint/issues/73#issuecomment-163171888 from distutils.core import setup from distutils.command.install_scripts import install_scripts as _install_scripts from distutils.file_util import move_file diff --git a/tests/pylint/runpylint.py b/tests/pylint/runpylint.py index 1e732664..0d711a00 100755 --- a/tests/pylint/runpylint.py +++ b/tests/pylint/runpylint.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python import sys diff --git a/tools/ksflatten.py b/tools/ksflatten.py index 8152a615..60f2a672 100755 --- a/tools/ksflatten.py +++ b/tools/ksflatten.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python # # Simple script to take a kickstart config, read it in, parse any %includes, # etc to write out a flattened config that is stand-alone diff --git a/tools/ksshell.py b/tools/ksshell.py index b489b48d..939cbcd6 100755 --- a/tools/ksshell.py +++ b/tools/ksshell.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python # # Chris Lumens # diff --git a/tools/ksvalidator.py b/tools/ksvalidator.py index cdf63c89..1ed04c25 100755 --- a/tools/ksvalidator.py +++ b/tools/ksvalidator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # Chris Lumens # diff --git a/tools/ksverdiff.py b/tools/ksverdiff.py index cdbaada9..1c1a5df3 100755 --- a/tools/ksverdiff.py +++ b/tools/ksverdiff.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python # # Chris Lumens # diff --git a/translation-canary/tests/pylint/runpylint.py b/translation-canary/tests/pylint/runpylint.py index 76eac359..3d72381a 100755 --- a/translation-canary/tests/pylint/runpylint.py +++ b/translation-canary/tests/pylint/runpylint.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python import sys from pocketlint import PocketLintConfig, PocketLinter