From 8a2e92c3435207d6d1586fe31b23a793d6ad0af0 Mon Sep 17 00:00:00 2001 From: myslak71 Date: Sun, 4 Aug 2019 10:54:02 +0200 Subject: [PATCH] Add multiple python versions to CI --- .travis.yml | 26 +++++++++++++++++++------- Makefile | 2 +- README.md | 4 +++- requirements-dev.txt | 4 ++-- setup.py | 7 ++++++- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5bf3f3..eb925b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,25 @@ language: python sudo: required dist: xenial -python: "3.7" +python: + - "3.6" + - "3.7" cache: pip install: - - pip install -r requirements-dev.txt -script: - - make safety - - make lint - - pip install . - - make unittests + - pip install .[dev] +env: + global: + - MAKEFLAGS="-j 2" + +jobs: + include: + - stage: test + name: "Linters" + script: make lint + - name: "Safety" + script: make safety + - name: "Unit tests" + script: make unittests + +script: nosettests after_success: coveralls diff --git a/Makefile b/Makefile index 59be00d..55268ee 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ coverage_html: ## create html coverage report and open it in the default browse xdg-open htmlcov/index.html flake8: ## run flake8 - flake8 flake8_koles/ + flake8 flake8_koles/ --ignore=KOL001,KOL002 lint: mypy flake8 yamllint # run all linters diff --git a/README.md b/README.md index b461bba..cd5a6f9 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ [![Build Status](https://travis-ci.org/myslak71/flake8-koles.svg?branch=master)](https://travis-ci.org/myslak71/flake8-koles) [![Coverage Status](https://coveralls.io/repos/github/myslak71/flake8-koles/badge.svg?branch=master)](https://coveralls.io/github/myslak71/flake8-koles?branch=master) -![image](https://img.shields.io/badge/python-3.7-blue.svg) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flake8-koles) ![image](https://img.shields.io/badge/version-0.1.2-yellow) +![Requires.io](https://img.shields.io/requires/github/myslak71/flake8-koles) +![GitHub](https://img.shields.io/github/license/myslak71/flake8-koles) Watch your language young pal! diff --git a/requirements-dev.txt b/requirements-dev.txt index 0c81e6b..4be75ce 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,14 +4,14 @@ flake8==3.7.8 flake8-docstrings==1.3.1 flake8-print==3.1.0 flake8-isort==2.7.0 -mypy==0.711 +mypy==0.720 yamllint==1.16.0 # Testing purposes ######################## pytest==5.0.1 pytest-cov==2.7.1 -coveralls==1.8.1 +coveralls==1.8.2 # Debugging ######################## diff --git a/setup.py b/setup.py index 0d71694..ec65ca8 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,9 @@ 'r', encoding='utf-8') as file: exec(file.read(), about) +with open(os.path.join(DIR_PATH, 'requirements-dev.txt'), encoding='utf-8') as file: + requirements_dev = [str(req) for req in parse_requirements(file.read())] + setup( name=about['__title__'], description=about['__description__'], @@ -31,8 +34,9 @@ packages=['flake8_koles'], package_data={'flake8_koles': ['data/swear_list/*.dat']}, py_modules=['flake8_koles'], - python_requires=">=3.7", + python_requires=">=3.6", install_requires=install_requires, + extras_require={'dev': requirements_dev}, entry_points={ 'flake8.extension': [ 'KOL = flake8_koles.checker:KolesChecker', @@ -45,6 +49,7 @@ 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], )