Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate codecov #21

Merged
merged 23 commits into from
Nov 17, 2022
54 changes: 54 additions & 0 deletions .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Pytest Coverage
on:
push:
branches:
- main

jobs:
live-test:
name: Test
runs-on: ubuntu-latest
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: Build coverage file
run: |
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: pytest-coverage.txt
junitxml-path: pytest.xml

- name: Check the output coverage
run: |
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:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 99eba16a0a4fad7eadf98ef938afe38c
filename: pytest-coverage-comment.json
label: Test Coverage
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python
11 changes: 6 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,17 +10,21 @@ 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:
- name: Checkout code
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
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# PyRelationAL

<p>
<a alt="coverage">
<img src="https://img.shields.io/badge/coverage-94%25-green" /></a>
<a alt="semver">
<img src="https://img.shields.io/badge/semver-0.1.6-blue" /></a>
<a alt="documentation" href="https://pyrelational.readthedocs.io/en/latest/index.html">
<img src="https://img.shields.io/badge/documentation-online-orange" /></a>
<a alt="pypi" href="https://pypi.org/project/pyrelational/">
<img src="https://img.shields.io/badge/pypi-online-yellow" /></a>
</p>
![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.

Expand Down
37 changes: 18 additions & 19 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
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.0
pandas>=1.3.0
pytorch-lightning>=1.6
torch>=1.9.0
torchvision
gpytorch
scikit-learn
tabulate>=0.7.0
pre-commit
black
pytest
setuptools
flake8
flake8-bugbear
pyreadr>=0.4.4
xlrd>=2.0.1
openpyxl>=3.0.9
pytest-cov
protobuf~=3.19.0
protobuf
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down