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

Add automated testing to rs-booster #22

Merged
merged 3 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']

# Skip CI if 'skip ci' is contained in latest commit message
if: "!contains(github.event.head_commit.message, 'skip ci')"

steps:

- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install rsbooster
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
- name: Test with pytest
run: |
python -m pytest
9 changes: 8 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
[metadata]
description_file = README.md
description_file = README.md

[aliases]
test=pytest

[tool:pytest]
addopts = -n auto

3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def getVersionNumber():
"Source Code": "https://github.com/Hekstra-Lab/rs-booster",
}

# Testing requirements
tests_require = ["pytest", "pytest-xdist", "pytest-runner"]

setup(
name="rs-booster",
Expand All @@ -36,6 +38,7 @@ def getVersionNumber():
project_urls=PROJECT_URLS,
python_requires=">3.7",
install_requires=["reciprocalspaceship", "matplotlib", "seaborn"],
extras_require={"dev": tests_require},
entry_points={
"console_scripts": [
"rs.extrapolate=rsbooster.esf.extrapolate:main",
Expand Down
Empty file added tests/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions tests/test_rsbooster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import rsbooster


def test_version():
"""
Test rsbooster.getVersionNumber() method exists and gives same result as
rsbooster.__version__
"""
assert rsbooster.getVersionNumber() == rsbooster.__version__