From fc7668914bc2614c3418b008a855883eb7547287 Mon Sep 17 00:00:00 2001 From: Christopher Koerber Date: Mon, 8 Nov 2021 10:34:49 +0100 Subject: [PATCH 1/4] Added coverage action to repo --- .github/workflows/pytest.yml | 14 +++++++++++++- requirements-dev.txt | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 957e37c..c80eda5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,14 +18,26 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: python-version: 3.9 + - name: Install package run: | pip install .[test] + - name: Test with pytest run: | cd tests - pytest --headless . + pytest --headless --cov=lsqfitgui --cov-report=xml + + - name: Upload tests to Codecov + uses: codecov/codecov-action@v2 + with: + file: ./tests/coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: true diff --git a/requirements-dev.txt b/requirements-dev.txt index 87dedf0..49fface 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,3 +6,4 @@ black sphinx pydata-sphinx-theme myst-parser +pytest-cov From aeeda920ec3a7f1eb535f689c2bfeca1162ecafa Mon Sep 17 00:00:00 2001 From: Christopher Koerber Date: Mon, 8 Nov 2021 10:44:08 +0100 Subject: [PATCH 2/4] Added pytest-cov and dev dependencies to cfg file --- requirements-dev.txt | 10 +--------- setup.cfg | 11 +++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 49fface..e7ab444 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1 @@ -numpy -scipy -dash[testing] -pytest -black -sphinx -pydata-sphinx-theme -myst-parser -pytest-cov +.[dev] diff --git a/setup.cfg b/setup.cfg index 72be519..e180b42 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,17 @@ exclude = test = dash[testing] pytest + pytest-cov +dev = + numpy + scipy + dash[testing] + pytest + black + sphinx + pydata-sphinx-theme + myst-parser + pytest-cov [options.package_data] From d457ba2f6bc39d66a77e0bef7ee9f5e5aa3f4aa0 Mon Sep 17 00:00:00 2001 From: Christopher Koerber Date: Mon, 8 Nov 2021 11:04:10 +0100 Subject: [PATCH 3/4] Re-added req devs as needed for readthedocs --- requirements-dev.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e7ab444..49fface 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1 +1,9 @@ -.[dev] +numpy +scipy +dash[testing] +pytest +black +sphinx +pydata-sphinx-theme +myst-parser +pytest-cov From b525f8ccace2356bd073f1e9df13d1a07b4c33b1 Mon Sep 17 00:00:00 2001 From: Christopher Koerber Date: Mon, 8 Nov 2021 11:26:05 +0100 Subject: [PATCH 4/4] Added badge for coverage --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cd1ef85..842d245 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ [![Documentation Status](https://readthedocs.org/projects/lsqfitgui/badge/?version=latest)](https://lsqfitgui.readthedocs.io/en/latest/?badge=latest) +[![Code Coverage](https://codecov.io/gh/ckoerber/lsqfit-gui/branch/master/graph/badge.svg)](https://codecov.io/gh/ckoerber/lsqfit-gui) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) + # Lsqfit GUI Graphical user interface for `lsqfit` using `dash`.