Skip to content

Introduction

SoftPack Core

pypi python Build Status codecov
License: MIT Contributor Covenant

SoftPack Core - GraphQL backend service

Features

  • Provides GraphQL API for managing SoftPack environments.

Installation

External dependencies

SoftPack Core requires Python version 3.11 or greater.

This project also relies on Spack. Install that first:

$ git clone -c feature.manyFiles=true --depth 1 https://github.com/spack/spack.git
$ source spack/share/spack/setup-env.sh

To start the service, you will also need to configure a git repository to store artifacts.

Stable release

To install SoftPack Core, run this command in your terminal:

$ pip install softpack-core

This is the preferred method to install SoftPack Core, as it will always install the most recent stable release.

If you don't have pip installed, this Python installation guide can guide you through the process.

From source

The source for SoftPack Core can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone https://github.com/wtsi-hgi/softpack-core.git

Or download the tarball:

$ curl -OJL https://github.com/wtsi-hgi/softpack-core/tarball/master

Once you have a copy of the source, you can install it with:

$ pip install .
Development

For development mode, clone the repository and use Poetry to install the package.

$ git clone https://github.com/wtsi-hgi/softpack-core.git

Install Poetry:

$ pip install poetry

Install Poetry environments for development:

poetry install --with dev,doc,test

Run tests with Tox

poetry run tox

To run integration tests, you need a git repository set up with token access and a branch named after your git repo username (stripped of any @domain if your username is an email address).

Make sure the artifacts/repo section of ~/.softpack/core/config.yml is configured correctly:

artifacts:
  repo:
    url: https://github.com/[your-org]/development-softpack-artifacts.git
    username: [your-username]
    author: [your-name]
    email: [your-email]
    writer: [your-token]

Then enable the integration tests by suppling --repo to poetry run pytest, or to tox like this:

poetry run tox -- -- --repo

To discover all tests and run them (skipping integration tests with no --repo):

poetry run pytest tests -sv

To run just the integration tests:

poetry run pytest tests/integration -sv --repo

To run an individual test:

poetry run pytest tests/integration/test_artifacts.py::test_clone -sv --repo

Run MkDocs server to view documentation:

poetry run mkdocs serve

Credits

This package was created with Cookiecutter and the altaf-ali/cookiecutter-pypackage project template.

SoftPack mascot and logo courtesy of Cartoon Vectors by Vecteezy.