From 6248cf6322d694581be4a5ce5139ff52eff70f1e Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 13:56:14 +0000 Subject: [PATCH 01/23] test --- .github/workflows/update_readme.yaml | 42 ++++++++++++++++++++++++++++ README.md | 4 +++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/update_readme.yaml diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml new file mode 100644 index 00000000..4a28b0b4 --- /dev/null +++ b/.github/workflows/update_readme.yaml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + +jobs: + # Set the job key. The key is displayed as the job name + # when a job name is not provided + run-tests: + runs-on: ubuntu-latest + name: Tests + # Name the Job + steps: + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install basic dependencies + run: | + pip install --upgrade pip==21.3.0 + pip install pytest-cov + pip install -r requirements.txt + - name: Test with pytest + run: | + python -m pytest --cache-clear --cov=pyrelational tests > pytest-coverage.txt + - name: Print error + if: failure() + run: | + cat pytest-coverage.txt + - run: sed -i '//,//d' README.md + - run: echo '' >> README.md + - run: cat pytest-coverage.txt >> README.md + - run: echo '' >> README.md + - name: push + - uses: actions-x/commit@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + with: + name: GitHub Actions Autocommitter + files: ./README.md + message: '[GITOPS] updated README with latest changes' diff --git a/README.md b/README.md index 8472c493..ae5aa62c 100644 --- a/README.md +++ b/README.md @@ -178,3 +178,7 @@ Make sure you have `sphinx` and `sphinx-rtd-theme` packages installed (`pip inst To generate the docs, `cd` into the `docs/` directory and run `make html`. This will generate the docs at `docs/_build/html/index.html`. + +### Code testing coverage + + From cd72292754735ac6d4bb317936c70cb94a30b98e Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:00:25 +0000 Subject: [PATCH 02/23] test --- .github/workflows/update_readme.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 4a28b0b4..0be0970f 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -1,7 +1,6 @@ name: CI -on: - push: +on: [push, pull_request] jobs: # Set the job key. The key is displayed as the job name @@ -28,12 +27,20 @@ jobs: if: failure() run: | cat pytest-coverage.txt + + + build: + name: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v2 - run: sed -i '//,//d' README.md - run: echo '' >> README.md - run: cat pytest-coverage.txt >> README.md - run: echo '' >> README.md - name: push - - uses: actions-x/commit@v2 + uses: actions-x/commit@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any with: From bda40ff454d680accf8194c9f389485013b6cb30 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:02:19 +0000 Subject: [PATCH 03/23] test --- .github/workflows/update_readme.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 0be0970f..071ee354 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -28,11 +28,6 @@ jobs: run: | cat pytest-coverage.txt - - build: - name: - runs-on: ubuntu-latest - steps: - name: Checkout source code uses: actions/checkout@v2 - run: sed -i '//,//d' README.md From 57a7969a5d37057db4536f061c9ade817df39958 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:07:44 +0000 Subject: [PATCH 04/23] test --- .github/workflows/update_readme.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 071ee354..9db15f97 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -22,17 +22,16 @@ jobs: pip install -r requirements.txt - name: Test with pytest run: | - python -m pytest --cache-clear --cov=pyrelational tests > pytest-coverage.txt + python -m pytest --cache-clear --cov-report html:cov_html --cov=pyrelational tests - name: Print error if: failure() run: | - cat pytest-coverage.txt - - - name: Checkout source code + cat cov_html + - name: add coverage report to README.md uses: actions/checkout@v2 - run: sed -i '//,//d' README.md - run: echo '' >> README.md - - run: cat pytest-coverage.txt >> README.md + - run: cat cov_html >> README.md - run: echo '' >> README.md - name: push uses: actions-x/commit@v2 From e63271d1382fbca80eaa27f2c0f3470eae7bcfaa Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:13:50 +0000 Subject: [PATCH 05/23] test --- .github/workflows/update_readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 9db15f97..fbffaca3 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -22,7 +22,7 @@ jobs: pip install -r requirements.txt - name: Test with pytest run: | - python -m pytest --cache-clear --cov-report html:cov_html --cov=pyrelational tests + python -m pytest --cov-report html:cov_html --cov=pyrelational tests - name: Print error if: failure() run: | From 5a0196c31b76bc0838ee7bb82acc7e65e7eb0c5d Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:22:15 +0000 Subject: [PATCH 06/23] test --- .github/workflows/update_readme.yaml | 61 ++++++++++++---------------- README.md | 2 +- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index fbffaca3..87808611 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -1,43 +1,32 @@ -name: CI - -on: [push, pull_request] +name: Update Coverage on Readme +on: + push: jobs: - # Set the job key. The key is displayed as the job name - # when a job name is not provided - run-tests: + update-coverage-on-readme: runs-on: ubuntu-latest - name: Tests - # Name the Job steps: - - name: Checkout code - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 with: - python-version: 3.8 - - name: Install basic dependencies - run: | - pip install --upgrade pip==21.3.0 - pip install pytest-cov - pip install -r requirements.txt - - name: Test with pytest - run: | - python -m pytest --cov-report html:cov_html --cov=pyrelational tests - - name: Print error - if: failure() + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + + - name: Pytest coverage comment + if: ${{ github.ref == 'refs/heads/main' }} + id: coverageComment + uses: MishaKav/pytest-coverage-comment@main + with: + hide-comment: true + pytest-coverage-path: ./data/pytest-coverage_4.txt + + - name: Update Readme with Coverage Html + if: ${{ github.ref == 'refs/heads/main' }} run: | - cat cov_html - - name: add coverage report to README.md - uses: actions/checkout@v2 - - run: sed -i '//,//d' README.md - - run: echo '' >> README.md - - run: cat cov_html >> README.md - - run: echo '' >> README.md - - name: push - uses: actions-x/commit@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + sed -i '//,//c\\n\${{ steps.coverageComment.outputs.coverageHtml }}\n' ./README.md + + - name: Commit & Push changes to Readme + if: ${{ github.ref == 'refs/heads/main' }} + uses: actions-js/push@master with: - name: GitHub Actions Autocommitter - files: ./README.md - message: '[GITOPS] updated README with latest changes' + message: Update coverage on Readme + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index ae5aa62c..37545e2c 100644 --- a/README.md +++ b/README.md @@ -181,4 +181,4 @@ at `docs/_build/html/index.html`. ### Code testing coverage - + From 4952c2d17f474adf16ce414f8c448e4979a0e5c8 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:38:38 +0000 Subject: [PATCH 07/23] test --- .github/workflows/update_readme.yaml | 43 ++++++++++++++++------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 87808611..9e6c4ce8 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -1,32 +1,39 @@ - -name: Update Coverage on Readme +name: My Pytest Coverage Comment on: push: jobs: - update-coverage-on-readme: + live-test: + name: Live Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token - fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + - uses: actions/checkout@v2 - name: Pytest coverage comment - if: ${{ github.ref == 'refs/heads/main' }} id: coverageComment uses: MishaKav/pytest-coverage-comment@main with: - hide-comment: true pytest-coverage-path: ./data/pytest-coverage_4.txt + junitxml-path: ./data/pytest_1.xml - - name: Update Readme with Coverage Html - if: ${{ github.ref == 'refs/heads/main' }} + - name: Check the output coverage run: | - sed -i '//,//c\\n\${{ steps.coverageComment.outputs.coverageHtml }}\n' ./README.md - - - name: Commit & Push changes to Readme - if: ${{ github.ref == 'refs/heads/main' }} - uses: actions-js/push@master + echo "Coverage Percantage - ${{ steps.coverageComment.outputs.coverage }}" + echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}" + echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}" + echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}" + echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}" + echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}" + echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}" + echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}" + echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}" + echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}" + - name: Create the Badge + uses: schneegans/dynamic-badges-action@v1.0.0 with: - message: Update coverage on Readme - github_token: ${{ secrets.GITHUB_TOKEN }} + auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} + gistID: 5e90d640f8c212ab7bbac38f72323f80 + filename: pytest-coverage-comment__main.json + label: Coverage Report + message: ${{ steps.coverageComment.outputs.coverage }} + color: ${{ steps.coverageComment.outputs.color }} + namedLogo: python From 727da0090814bd0b9970b48e5370f4c4169ec2e5 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:42:40 +0000 Subject: [PATCH 08/23] test --- .github/workflows/update_readme.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 9e6c4ce8..d4ae937d 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -6,14 +6,26 @@ jobs: name: Live Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install basic dependencies + run: | + pip install --upgrade pip==21.3.0 + pip install pytest-cov + pip install -r requirements.txt + - name: Build coverage file + run: | + pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=app tests/ | tee pytest-coverage.txt - name: Pytest coverage comment id: coverageComment uses: MishaKav/pytest-coverage-comment@main with: - pytest-coverage-path: ./data/pytest-coverage_4.txt - junitxml-path: ./data/pytest_1.xml + pytest-coverage-path: ./data/pytest-coverage.txt + junitxml-path: ./data/pytest.xml - name: Check the output coverage run: | @@ -30,7 +42,7 @@ jobs: - name: Create the Badge uses: schneegans/dynamic-badges-action@v1.0.0 with: - auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} + auth: ${{ secrets.GITHUB }} gistID: 5e90d640f8c212ab7bbac38f72323f80 filename: pytest-coverage-comment__main.json label: Coverage Report From f25d7d934777934d9796772613804dc2eb3b0224 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 14:53:15 +0000 Subject: [PATCH 09/23] test --- .github/workflows/update_readme.yaml | 2 +- requirements.txt | 38 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index d4ae937d..37c6f8e4 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -18,7 +18,7 @@ jobs: pip install -r requirements.txt - name: Build coverage file run: | - pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=app tests/ | tee pytest-coverage.txt + pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt - name: Pytest coverage comment id: coverageComment diff --git a/requirements.txt b/requirements.txt index 0d3bfc74..63d3d07c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,20 @@ -numpy==1.21.0 -pandas==1.3.5 -pytorch-lightning==1.5.9 -torch==1.9.0 -torchvision==0.10.0 -gpytorch==1.4.0 -scikit-learn==1.0.2 -tabulate==0.8.9 -pre-commit==2.17.0 -black==22.3.0 -pytest==6.2.5 -setuptools==59.5.0 -flake8==4.0.1 -flake8-bugbear==22.1.11 -gpytorch==1.4.0 -pyreadr==0.4.4 -xlrd==2.0.1 -openpyxl==3.0.9 +numpy>=1.22 +pandas +pytorch-lightning>=1.6 +torch +torchvision +gpytorch +scikit-learn +tabulate +pre-commit +black +pytest +setuptools +flake8 +flake8-bugbear +gpytorch +pyreadr +xlrd +openpyxl pytest-cov -protobuf~=3.19.0 +protobuf From cbe8448b0a01a395b5fdc16c63349a3878d36e0f Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 15:00:07 +0000 Subject: [PATCH 10/23] test --- .github/workflows/update_readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 37c6f8e4..bcff50c6 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -18,7 +18,7 @@ jobs: pip install -r requirements.txt - name: Build coverage file run: | - pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt + pytest -m --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt - name: Pytest coverage comment id: coverageComment From b2a1c33edcddb10bab654bbae2d3ea106b8d0fd7 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 15:06:27 +0000 Subject: [PATCH 11/23] test --- .github/workflows/update_readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index bcff50c6..675e81ac 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -18,7 +18,7 @@ jobs: pip install -r requirements.txt - name: Build coverage file run: | - pytest -m --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt + python -m pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt - name: Pytest coverage comment id: coverageComment From 75245507548fd3b833f398bca518237b5fa5a0f8 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 16:06:50 +0000 Subject: [PATCH 12/23] test --- .github/workflows/update_readme.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 675e81ac..e5a4b930 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -18,14 +18,14 @@ jobs: pip install -r requirements.txt - name: Build coverage file run: | - python -m pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyrelational tests/ | tee pytest-coverage.txt + python -m pytest --junitxml=pytest.xml --cov=pyrelational tests/ | tee pytest-coverage.txt - name: Pytest coverage comment id: coverageComment uses: MishaKav/pytest-coverage-comment@main with: - pytest-coverage-path: ./data/pytest-coverage.txt - junitxml-path: ./data/pytest.xml + pytest-coverage-path: pytest-coverage.txt + junitxml-path: pytest.xml - name: Check the output coverage run: | From 32eae27de50c2e34112a14699833a01b21bee414 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 16:22:11 +0000 Subject: [PATCH 13/23] test --- .github/workflows/update_readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index e5a4b930..52a7b1f1 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -42,7 +42,7 @@ jobs: - name: Create the Badge uses: schneegans/dynamic-badges-action@v1.0.0 with: - auth: ${{ secrets.GITHUB }} + auth: ${{ secrets.GITHUB_TOKEN }} gistID: 5e90d640f8c212ab7bbac38f72323f80 filename: pytest-coverage-comment__main.json label: Coverage Report From 2727b515d7a6f07f2d4cffb7e4950103c9fa76d4 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 16:52:39 +0000 Subject: [PATCH 14/23] gist token --- .github/workflows/update_readme.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 52a7b1f1..175391a8 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -42,9 +42,9 @@ jobs: - name: Create the Badge uses: schneegans/dynamic-badges-action@v1.0.0 with: - auth: ${{ secrets.GITHUB_TOKEN }} + auth: ${{ secrets.GIST_TOKEN }} gistID: 5e90d640f8c212ab7bbac38f72323f80 - filename: pytest-coverage-comment__main.json + filename: pytest-coverage-comment.json label: Coverage Report message: ${{ steps.coverageComment.outputs.coverage }} color: ${{ steps.coverageComment.outputs.color }} From c1fe4c8d743d954a8d2efab41e169b8f582ff469 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 16:57:57 +0000 Subject: [PATCH 15/23] gist token --- .github/workflows/update_readme.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml index 175391a8..2ab224bc 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/update_readme.yaml @@ -43,7 +43,7 @@ jobs: uses: schneegans/dynamic-badges-action@v1.0.0 with: auth: ${{ secrets.GIST_TOKEN }} - gistID: 5e90d640f8c212ab7bbac38f72323f80 + gistID: 99eba16a0a4fad7eadf98ef938afe38c filename: pytest-coverage-comment.json label: Coverage Report message: ${{ steps.coverageComment.outputs.coverage }} From 2d3a76fb3016043835d9039fcecd82132d0a5636 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 17:09:40 +0000 Subject: [PATCH 16/23] gist token --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37545e2c..bc01a6a4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

- + From 88d4122fe31ec655153da207762fb14a90fd5517 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 17:13:38 +0000 Subject: [PATCH 17/23] automatic coverage report --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc01a6a4..6b17a942 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

- + From 11744524a9b60edccbc1ac07812dc88401779aef Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 17:36:33 +0000 Subject: [PATCH 18/23] automatic badges --- .../{update_readme.yaml => code_coverage.yaml} | 8 ++++---- README.md | 13 +++---------- 2 files changed, 7 insertions(+), 14 deletions(-) rename .github/workflows/{update_readme.yaml => code_coverage.yaml} (95%) diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/code_coverage.yaml similarity index 95% rename from .github/workflows/update_readme.yaml rename to .github/workflows/code_coverage.yaml index 2ab224bc..d5d4311b 100644 --- a/.github/workflows/update_readme.yaml +++ b/.github/workflows/code_coverage.yaml @@ -1,9 +1,9 @@ -name: My Pytest Coverage Comment +name: Pytest Coverage on: - push: + push: [main] jobs: live-test: - name: Live Test + name: Test runs-on: ubuntu-latest steps: - name: Checkout code @@ -45,7 +45,7 @@ jobs: auth: ${{ secrets.GIST_TOKEN }} gistID: 99eba16a0a4fad7eadf98ef938afe38c filename: pytest-coverage-comment.json - label: Coverage Report + label: Test Coverage message: ${{ steps.coverageComment.outputs.coverage }} color: ${{ steps.coverageComment.outputs.color }} namedLogo: python diff --git a/README.md b/README.md index 6b17a942..b417baa8 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,8 @@ # PyRelationAL -

- - - - - - - - -

+![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/RelationTherapeutics/99eba16a0a4fad7eadf98ef938afe38c/raw/pytest-coverage-comment.json) +[![PyPI version](https://badge.fury.io/py/pyrelational.svg)](https://badge.fury.io/py/pyrelational) +[![Documentation Status](https://readthedocs.org/projects/pyrelational/badge/?version=stable)](https://pyrelational.readthedocs.io/en/stable/?badge=stable) PyRelationAL is an open source Python library for the rapid and reliable construction of active learning (AL) pipelines and strategies. The toolkit offers a modular design for a flexible workflow that enables active learning with as little change to your models and datasets as possible. The package is primarily aimed at researchers so that they can rapidly reimplement, adapt, and create novel active learning strategies. For more information on how we achieve this you can consult the sections below, our comprehensive docs, or our paper. PyRelationAL is principally designed with PyTorch workflows in mind but can easily be extended to work with other ML frameworks. From cb4da56c37a973d58e2d9b845551003488d9787b Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 17:40:32 +0000 Subject: [PATCH 19/23] tests.yaml only on PR, on push to main is handled by code coverage --- .github/workflows/tests.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ef6f2f71..68bdec4b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,9 +2,6 @@ name: tests # Run this workflow every time a new commit pushed to your repository on: - push: - branches: - - main pull_request: jobs: From 4247046f68113d9f36ba3c4a8341bcc1fe3289e7 Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 18:08:41 +0000 Subject: [PATCH 20/23] update requirements.txt --- requirements.txt | 15 +++++++-------- setup.py | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index 63d3d07c..f12ab151 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,20 +1,19 @@ -numpy>=1.22 -pandas +numpy>=1.22.0 +pandas>=1.3.0 pytorch-lightning>=1.6 -torch +torch>=1.9.0 torchvision gpytorch scikit-learn -tabulate +tabulate>=0.7.0 pre-commit black pytest setuptools flake8 flake8-bugbear -gpytorch -pyreadr -xlrd -openpyxl +pyreadr>=0.4.4 +xlrd>=2.0.1 +openpyxl>=3.0.9 pytest-cov protobuf diff --git a/setup.py b/setup.py index 471347ac..24c91991 100644 --- a/setup.py +++ b/setup.py @@ -8,9 +8,9 @@ tests_require = ["pytest", "pytest-cov", "mock"] install_requires = [ - "numpy>=1.20.0", + "numpy>=1.22.0", "pandas>=1.3.0", - "pytorch-lightning>=1.5", + "pytorch-lightning>=1.6", "torch>=1.9.0", "scikit-learn>=1.0.2", "tabulate>=0.7.0", From b221d85b5c1fb50c478df3d58b3a84f35ebbfc3e Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Fri, 11 Nov 2022 20:46:41 +0000 Subject: [PATCH 21/23] update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index b417baa8..10f3dae9 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,3 @@ Make sure you have `sphinx` and `sphinx-rtd-theme` packages installed (`pip inst To generate the docs, `cd` into the `docs/` directory and run `make html`. This will generate the docs at `docs/_build/html/index.html`. - -### Code testing coverage - - From aa67db21e46f13b69aa0dbaa07f0b0bc6174146d Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Mon, 14 Nov 2022 10:41:44 +0000 Subject: [PATCH 22/23] test on multiple python versions --- .github/workflows/tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 68bdec4b..95ede725 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,6 +10,10 @@ jobs: # when a job name is not provided run-tests: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + name: Tests # Name the Job steps: @@ -17,10 +21,10 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install basic dependencies run: | - pip install --upgrade pip==21.3.0 + pip install --upgrade pip pip install pytest-cov pip install -r requirements.txt - name: Test with pytest From e324854b4b5005485d05bc81c28cb80259e03b6e Mon Sep 17 00:00:00 2001 From: thomasgaudelet Date: Mon, 14 Nov 2022 10:43:29 +0000 Subject: [PATCH 23/23] fix code coverage workflow --- .github/workflows/code_coverage.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_coverage.yaml b/.github/workflows/code_coverage.yaml index d5d4311b..e8ba69d7 100644 --- a/.github/workflows/code_coverage.yaml +++ b/.github/workflows/code_coverage.yaml @@ -1,6 +1,9 @@ name: Pytest Coverage on: - push: [main] + push: + branches: + - main + jobs: live-test: name: Test