Core utilities for KBase SDK apps. Note: experimental
$ pip install --extra-index-url https://test.pypi.org/simple kbase_sdk
This package currently only lives in test PyPi
Initialize app context
import kbase_sdk
context = kbase_sdk.init_context()
# You can also explicitly pass in the root directory of your app
# Useful if it is not your current working directory
context = kbase_sdk.init_context(root_directory)
Run another app as a remote job
import kbase_sdk
job = kbase_sdk.run_app(context, {
app: 'AssemblyUtil',
method: 'get_assembly_as_fasta',
params: { 'ref': 'x/y/z' }
})
Before working, activate a virtualenv with python3 and install dependencies
# Init the virtual environment
$ python3 -m venv env
$ source env/bin/activate
# Install package dependencies
$ pip install -e .
# Install dev dependencies
$ pip install -r dev-requirements.txt
# Make sure you are in a virtualenv
$ source env/bin/activate
# Make sure dependencies are installed
$ pip install -e .
$ pip install -r dev-requirements.txt
# Run all tests
$ make test
# Run a single test module
$ python -m unittest test/test_something.py
Pip
# Generates a build file into dist/
$ python setup.py bdist_wheel
# Uploads the build to pypi
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/x
The python packages are found in /kbase_sdk/
. Tests are found in /test/
.
Key files:
Makefile
-- targets for testing and publishingsetup.py
-- python setuptools configuration for pip packagingconda_recipe
-- config for conda packaging