Skip to content

Latest commit

 

History

History
118 lines (81 loc) · 3.78 KB

README.md

File metadata and controls

118 lines (81 loc) · 3.78 KB

Virtool Workflow

Tests PyPI version

A framework for developing bioinformatic workflows in Python.

from virtool_workflow import step


@step
def step_function():
    ...


@step
def step_function_2():
    ...

Contributing

Commits

All commits must follow the Conventional Commits specification.

These standardized commit messages are used to automatically publish releases using semantic-release after commits are merged to main from successful PRs.

Example

feat: add API support for assigning labels to existing samples

Descriptive bodies and footers are required where necessary to describe the impact of the commit. Use bullets where appropriate.

Additional Requirements

  1. Write in the imperative. For example, "fix bug", not "fixed bug" or "fixes bug".
  2. Don't refer to issues or code reviews. For example, don't write something like this: "make style changes requested in review". Instead, "update styles to improve accessibility".
  3. Commits are not your personal journal. For example, don't write something like this: "got server running again" or "oops. fixed my code smell".

From Tim Pope: A Note About Git Commit Messages

Poetry

Dependencies & virtual environments are managed with Poetry

To install poetry:

sudo pip install poetry

To install dependencies, and the virtool-workflow package, into a virtual environment:

git clone https://github.com/virtool/virtool-workflow
cd virtool-workflow

poetry install

To run commands in the virtual environment:

poetry run <<command>>

Tests

Pytest is used to implement unit and integration tests.

A pytest plugin, pytest-docker-compose handles starting and stopping any required external services for integration tests. docker-compose will need to be installed on your system for this to work. It might also be necessary to setup a docker user group on your system, so you can use docker without sudo.

virtool-workflow depends on some external bioinformatics tools such as Bowtie 2, FastQC, and Skewer. Installation of these tools can be somewhat involved, so it's best to run the test suite using docker. The virtool/workflow-tools image provides a base with all of the external dependencies pre-installed.

./tests/docker-compose.yml will run the test suite inside a container based on virtool/workflow-tools and mount the local docker socket so that pytest, running inside the container, can manage the other services required by the integration tests.

To run the entire test suite:

cd tests
docker-compose up --exit-code-from pytest

To run a subset of the tests, tests/integration only for example:

cd tests
TEST_PATH=tests/integration docker-compose up --exit-code-from pytest

⚠️ The TEST_PATH is a relative path from the repository root, not the tests directory.