From 4e4a2f6f37c5ea6523ce1ce029705f2409c36b85 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 13:40:07 +0200 Subject: [PATCH 01/11] Improve documentation, add pytest-cov --- .github/workflows/tests.yml | 20 ++++++++++++++++++++ docs/contribute.md | 2 +- docs/installation.md | 2 +- mkdocs.yml | 1 + pyproject.toml | 2 +- src/pte_xdf/__init__.py | 2 +- tox.ini | 4 ++-- 7 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9c3de0..dc72649 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,3 +51,23 @@ jobs: restore-keys: pip|${{ runner.os }}|${{ matrix.python }} - run: pip install tox - run: tox -e ${{ matrix.tox }} + codecov: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + env: + OS: ${{ matrix.os }} + PYTHON: '3.10' + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: true + files: ./coverage1.xml,./coverage2.xml + flags: unittests + name: codecov-umbrella + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file diff --git a/docs/contribute.md b/docs/contribute.md index 487c44b..f0c33f8 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -10,7 +10,7 @@ For any minor additions or bugfixes, you may simply create a **pull request**. When you then create a pull request, be sure to **link the pull request** to the open issue in order to close the issue automatically after merging. ## I want to contribute myself - how do I get started? -To contribute yourselves, create a fork of this repository and run `git clone https://github_link_to_fork` as described [above](#dev). +To contribute yourselves, create a fork of this repository and run `git clone https://github_link_to_fork` as described [here][development-version]. Then create a development branch from your fork. diff --git a/docs/installation.md b/docs/installation.md index 9da8c2a..83736e9 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -7,7 +7,7 @@ $ pip install pte-xdf ``` -## Development version +## Development version To install the latest development version, first clone this repository: diff --git a/mkdocs.yml b/mkdocs.yml index 734b3cc..0e150ad 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,6 +13,7 @@ markdown_extensions: check_paths: true plugins: + - autorefs - mkdocstrings: handlers: python: diff --git a/pyproject.toml b/pyproject.toml index 4e64fc2..61f9e87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = ["mne", "numpy", "pyxdf"] [project.optional-dependencies] dev = ["black", "isort", "mypy", "pylint", "pytest", "pytest-cov", "tox"] -doc = ["mkdocs", "mkdocs-material", "mkdocstrings[python]"] +doc = ["mkdocs", "mkdocs-autorefs", "mkdocs-material", "mkdocstrings[python]"] full = ["pte-xdf[dev,doc,release]"] release = ["pip-tools"] diff --git a/src/pte_xdf/__init__.py b/src/pte_xdf/__init__.py index a45a4fb..3d5d019 100644 --- a/src/pte_xdf/__init__.py +++ b/src/pte_xdf/__init__.py @@ -11,6 +11,6 @@ """ -__version__ = "0.1.0.dev1" +__version__ = "0.1.0.rc1" from .xdf import read_raw_xdf diff --git a/tox.ini b/tox.ini index d7e2368..ccdc2e0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py3{11,10} + py3{10, 11} style lint typing @@ -9,7 +9,7 @@ isolated_build = true [testenv] deps = -r requirements/dev-requirements.txt -commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests} +commands = pytest --cov-report xml --cov=./ -v --tb=short --basetemp={envtmpdir} {posargs:tests} [testenv:{lint,style,typing}] commands = From 0e4f292c1d52fa2718210c6b6af21c73c7a1b415 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 13:41:37 +0200 Subject: [PATCH 02/11] Fix --- .github/workflows/tests.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc72649..619d838 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,15 +59,16 @@ jobs: env: OS: ${{ matrix.os }} PYTHON: '3.10' - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: true - files: ./coverage1.xml,./coverage2.xml - flags: unittests - name: codecov-umbrella - path_to_write_report: ./coverage/codecov_report.txt - verbose: true \ No newline at end of file + steps: + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: true + files: ./coverage1.xml,./coverage2.xml + flags: unittests + name: codecov-umbrella + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file From 88004d89f8c3c58db7072f4db89944762faf19ad Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 13:48:14 +0200 Subject: [PATCH 03/11] Codecov action --- .github/workflows/codecov.yml | 34 ++++++++++++++++++++++++++++ .github/workflows/tests.yml | 42 +++++++++++++++++------------------ 2 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..9a9cab1 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,34 @@ +name: Example workflow for Codecov +on: [push] +jobs: + codecov: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + env: + OS: ${{ matrix.os }} + PYTHON: '3.10' + steps: + - uses: actions/checkout@master + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.10 + - name: Generate coverage report + run: | + pip install pytest + pip install pytest-cov + pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/reports/ + env_vars: OS,PYTHON + fail_ci_if_error: true + files: ./coverage1.xml,./coverage2.xml + flags: unittests + name: codecov-umbrella + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 619d838..1009591 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,24 +51,24 @@ jobs: restore-keys: pip|${{ runner.os }}|${{ matrix.python }} - run: pip install tox - run: tox -e ${{ matrix.tox }} - codecov: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - env: - OS: ${{ matrix.os }} - PYTHON: '3.10' - steps: - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ - env_vars: OS,PYTHON - fail_ci_if_error: true - files: ./coverage1.xml,./coverage2.xml - flags: unittests - name: codecov-umbrella - path_to_write_report: ./coverage/codecov_report.txt - verbose: true \ No newline at end of file + # runs: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [ubuntu-latest, macos-latest, windows-latest] + # env: + # OS: ${{ matrix.os }} + # PYTHON: '3.10' + # steps: + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v3 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # directory: ./coverage/reports/ + # env_vars: OS,PYTHON + # fail_ci_if_error: true + # files: ./coverage1.xml,./coverage2.xml + # flags: unittests + # name: codecov-umbrella + # path_to_write_report: ./coverage/codecov_report.txt + # verbose: true \ No newline at end of file From 71bd058a6b30308568a25930a8d8aea67dce388b Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 13:53:34 +0200 Subject: [PATCH 04/11] Codecov fix --- .github/workflows/codecov.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 9a9cab1..ada0ca4 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,17 +2,22 @@ name: Example workflow for Codecov on: [push] jobs: codecov: + name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + include: + - {name: 3.10 Windows, python: '3.10', os: windows-latest} + - {name: 3.10 Mac, python: '3.10', os: macos-latest} + - {name: 3.10 Linux, python: '3.10', os: ubuntu-latest} env: OS: ${{ matrix.os }} PYTHON: '3.10' steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@master + uses: actions/setup-python@v4 with: python-version: 3.10 - name: Generate coverage report From 493f5ee8bc92afead1b44198bd9f6a0dd1cdf357 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:08:17 +0200 Subject: [PATCH 05/11] Fix codecov --- .github/workflows/codecov.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ada0ca4..dc85301 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -8,31 +8,26 @@ jobs: fail-fast: false matrix: include: - - {name: 3.10 Windows, python: '3.10', os: windows-latest} - - {name: 3.10 Mac, python: '3.10', os: macos-latest} - {name: 3.10 Linux, python: '3.10', os: ubuntu-latest} - env: - OS: ${{ matrix.os }} - PYTHON: '3.10' steps: - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: ${{ matrix.python }} - name: Generate coverage report run: | pip install pytest pip install pytest-cov - pytest --cov=./ --cov-report=xml + pytest --cov=./ --cov-report=xml:./coverage/reports - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} directory: ./coverage/reports/ - env_vars: OS,PYTHON + # env_vars: OS,PYTHON fail_ci_if_error: true - files: ./coverage1.xml,./coverage2.xml + files: coverage.xml flags: unittests name: codecov-umbrella path_to_write_report: ./coverage/codecov_report.txt From aa9ec07cdeeb52cfd8cd873d45d3f7e28435325f Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:12:46 +0200 Subject: [PATCH 06/11] Fix codecov --- .github/workflows/codecov.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index dc85301..15e8998 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -10,15 +10,14 @@ jobs: include: - {name: 3.10 Linux, python: '3.10', os: ubuntu-latest} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@master - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@master with: python-version: ${{ matrix.python }} - name: Generate coverage report run: | - pip install pytest - pip install pytest-cov + pip install -e .[dev] pytest --cov=./ --cov-report=xml:./coverage/reports - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 12a9bae9187dc8f9ee0dadf82aae93ecd1cc2a09 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:16:46 +0200 Subject: [PATCH 07/11] Fix codecov --- .github/workflows/codecov.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 15e8998..a0e19fe 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -22,11 +22,9 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ./coverage/reports/ # env_vars: OS,PYTHON fail_ci_if_error: true - files: coverage.xml + files: ./coverage/reports/coverage.xml flags: unittests name: codecov-umbrella path_to_write_report: ./coverage/codecov_report.txt From e8a9d37d602b374057915774adef63af2e5969ea Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:28:26 +0200 Subject: [PATCH 08/11] Fix codecov --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index a0e19fe..0f974cb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: - name: Generate coverage report run: | pip install -e .[dev] - pytest --cov=./ --cov-report=xml:./coverage/reports + pytest --cov=./ --cov-report=xml:./coverage/reports/coverage.xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: From 6f3902a15b88c673fc426534e5d46ac14827a7f5 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:30:15 +0200 Subject: [PATCH 09/11] Fix codecov --- .github/workflows/codecov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0f974cb..2011b25 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -27,5 +27,5 @@ jobs: files: ./coverage/reports/coverage.xml flags: unittests name: codecov-umbrella - path_to_write_report: ./coverage/codecov_report.txt - verbose: true \ No newline at end of file + # path_to_write_report: ./coverage/codecov_report.txt + # verbose: true \ No newline at end of file From c05938a2b00fc567e2a1e90dd8b8f3ede5834df2 Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 14:41:14 +0200 Subject: [PATCH 10/11] Fix codecov --- .github/workflows/codecov.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2011b25..9d23a36 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -24,8 +24,7 @@ jobs: with: # env_vars: OS,PYTHON fail_ci_if_error: true - files: ./coverage/reports/coverage.xml - flags: unittests + # files: ./coverage/reports/coverage.xml name: codecov-umbrella # path_to_write_report: ./coverage/codecov_report.txt # verbose: true \ No newline at end of file From a1bd7cd79b3477f9637f09ab477cb6303aba18cf Mon Sep 17 00:00:00 2001 From: Richard Koehler Date: Mon, 19 Sep 2022 15:14:59 +0200 Subject: [PATCH 11/11] Clean up codecov, update README --- .github/workflows/codecov.yml | 30 ++++++++++++++++++++++-------- README.md | 5 ++++- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 9d23a36..98b14d1 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,7 +1,25 @@ -name: Example workflow for Codecov -on: [push] +name: Codecov +on: + push: + branches: + - main + - '*.x' + paths-ignore: + - 'docs/**' + - '*.md' + - '*.rst' + - '*.txt' + pull_request: + branches: + - main + - '*.x' + paths-ignore: + - 'docs/**' + - '*.md' + - '*.rst' + - '*.txt' jobs: - codecov: + run: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: @@ -22,9 +40,5 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - # env_vars: OS,PYTHON fail_ci_if_error: true - # files: ./coverage/reports/coverage.xml - name: codecov-umbrella - # path_to_write_report: ./coverage/codecov_report.txt - # verbose: true \ No newline at end of file + name: codecov-umbrella \ No newline at end of file diff --git a/README.md b/README.md index 2a091cd..8b16e3e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Python Versions][python-shield]][python-url] - +[![PyPi][pypi-shield]][pypi-url] [![Tests][tests-shield]][tests-url] +[![Codecov][codecov-shield]][codecov-url] [![License][license-shield]][license-url] [![Contributors][contributors-shield]][contributors-url] [![Code Style][codestyle-shield]][codestyle-url] @@ -104,6 +105,8 @@ PTE Stats is licensed under the [MIT license](license-url). [pypi-url]: https://pypi.org/project/pte-xdf/ [tests-shield]: https://github.com/richardkoehler/pte-xdf/actions/workflows/tests.yml/badge.svg [tests-url]: https://github.com/richardkoehler/pte-xdf/actions/workflows/tests.yml +[codecov-shield]: https://codecov.io/github/richardkoehler/pte-xdf/branch/main/graph/badge.svg?token=PZU4QNK7FR +[codecov-url]: https://codecov.io/github/richardkoehler/pte-xdf [homepage-shield]: https://img.shields.io/static/v1?label=Homepage&message=ICN&logoColor=black&labelColor=grey&color=9cf [homepage-url]: https://www.icneuromodulation.org/ [contributors-shield]: https://img.shields.io/github/contributors/richardkoehler/pte-xdf.svg