From fbbb13759fbb42e5d4c3030ee40c0dd2b51d6416 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 20:37:36 +0300 Subject: [PATCH 1/6] Coverage alpha, no icons #23 --- .github/workflows/checks.yml | 12 +++++++++++- .pre-commit-config.yaml | 4 ++-- noxfile.py | 5 +---- requirements.txt | 3 +++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1187f05..ae80fa8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -25,5 +25,15 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install nox - - name: Run nox + - name: Run pytest tests with nox run: nox -s tests-${{ matrix.python }} + - name: Send coverage report to codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + - name: Send coverage report to codeclimate + uses: paambaati/codeclimate-action@v2.6.0 + with: + coverageLocations: ${{github.workspace}}/.coverage + env: + CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad92db5..a69a769 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v3.1.0 hooks: - id: check-added-large-files - id: check-byte-order-marker @@ -23,7 +23,7 @@ repos: args: - --markdown-linebreak-ext=md - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + rev: 3.8.1 hooks: - id: flake8 additional_dependencies: diff --git a/noxfile.py b/noxfile.py index 93285dc..e6fd858 100644 --- a/noxfile.py +++ b/noxfile.py @@ -13,10 +13,7 @@ def tests(session): """Run test suite with pytest.""" session.install("-r", "requirements.txt") session.install("-e", ".") - if session.python == "3.8": - session.run("pytest", "--cov-report=html") - else: - session.run("pytest") + session.run("pytest", "--cov-report=html", "--cov-report=xml") @nox.session(python="3.8") diff --git a/requirements.txt b/requirements.txt index 6e0c3d2..21c0cb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,6 @@ flake8-docstrings>=1.5.0 # Testing pytest>=5.4.0 pytest-cov>=2.8.0 + +# Development +nox>=2019.11.9 From e8a10382812417bb04604fbcf7a75e4409d8c4e0 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 21:02:38 +0300 Subject: [PATCH 2/6] Remove code duplication in nox setup, add exclude rules for flake8 #23 --- noxfile.py | 13 +++++++++---- setup.cfg | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/noxfile.py b/noxfile.py index e6fd858..67cb2c4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -8,19 +8,24 @@ nox.options.keywords = "not docs" +def base_install(session): + """Creates basic environment setup for tests and linting.""" + session.install("-r", "requirements.txt") + session.install("-e", ".") + return session + + @nox.session(python=["3.7", "3.8"]) def tests(session): """Run test suite with pytest.""" - session.install("-r", "requirements.txt") - session.install("-e", ".") + session = base_install(session) session.run("pytest", "--cov-report=html", "--cov-report=xml") @nox.session(python="3.8") def linting(session): """Launch linting locally.""" - session.install("-r", "requirements.txt") - session.install("-e", ".") + session = base_install(session) session.run("pre-commit", "run", "-a") diff --git a/setup.cfg b/setup.cfg index 013f9d0..2195198 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,10 @@ [flake8] -ignore = E231, W503 +ignore = E231, W503, D401 # Excludes due to known issues or incompatibilities with black: # W503: https://github.com/psf/black/search?q=W503&unscoped_q=W503 # E231: https://github.com/psf/black/issues/1202 +# D401: First line should be in imperative mood; try rephrasing statistics = 1 # black official is 88 From c4121669f071010fb74f462161e17b125cd207c9 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 21:42:19 +0300 Subject: [PATCH 3/6] Try to ignore coveraga run #23 --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ae80fa8..898c029 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -34,6 +34,7 @@ jobs: - name: Send coverage report to codeclimate uses: paambaati/codeclimate-action@v2.6.0 with: + coverageCommand: echo "Ignore rerun" coverageLocations: ${{github.workspace}}/.coverage env: CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} From a4d469e0d37118ca59c3f44bae0c82df4af272c6 Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 21:47:21 +0300 Subject: [PATCH 4/6] Add coverage format #23 --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 898c029..0cddd6b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,6 +35,6 @@ jobs: uses: paambaati/codeclimate-action@v2.6.0 with: coverageCommand: echo "Ignore rerun" - coverageLocations: ${{github.workspace}}/.coverage + coverageLocations: ${{github.workspace}}/.coverage:coverage.py env: CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} From 13c1f7b5ef33d5a981c86bb056fea7c7088734de Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 21:53:17 +0300 Subject: [PATCH 5/6] Change coverage format #23 --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0cddd6b..1847899 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,6 +35,6 @@ jobs: uses: paambaati/codeclimate-action@v2.6.0 with: coverageCommand: echo "Ignore rerun" - coverageLocations: ${{github.workspace}}/.coverage:coverage.py + coverageLocations: ${{github.workspace}}/coverage.xml:coverage.py env: CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} From 4ebab1522a0be16f001f417d52c6ad7daae9fb2f Mon Sep 17 00:00:00 2001 From: Andrey Shpak Date: Fri, 22 May 2020 22:15:59 +0300 Subject: [PATCH 6/6] Icons, more icons! #23 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8f3baa7..a9165ca 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ [![python](https://img.shields.io/pypi/pyversions/ikt.svg)](https://pypi.python.org/pypi/ikt) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/insspb/ikt/Run%20checks/master)](https://github.com/insspb/ikt) [![docs](https://readthedocs.org/projects/ikt/badge/?version=latest)](https://ikt.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/insspb/ikt/branch/master/graph/badge.svg)](https://codecov.io/gh/insspb/ikt) +[![Test Coverage](https://api.codeclimate.com/v1/badges/792c94611eaba16a8dc5/test_coverage)](https://codeclimate.com/github/insspb/ikt/test_coverage) +[![Maintainability](https://api.codeclimate.com/v1/badges/792c94611eaba16a8dc5/maintainability)](https://codeclimate.com/github/insspb/ikt/maintainability) [![Code Qaulity](https://img.shields.io/scrutinizer/g/insspb/ikt.svg)](https://scrutinizer-ci.com/g/insspb/ikt/?branch=master) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)