https://github.com/jayrbolton/kbase_sdk
https://github.com/jayrbolton/kbase_sdk
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jayrbolton/kbase_sdk
- Owner: jayrbolton
- Created: 2018-05-17T01:39:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T21:23:28.000Z (almost 7 years ago)
- Last Synced: 2025-01-04T23:41:49.443Z (4 months ago)
- Language: Python
- Size: 227 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
kbase_sdk
=========Core utilities for KBase SDK apps. **Note: experimental**
Installation
------------.. code:: sh
$ pip install --extra-index-url https://test.pypi.org/simple kbase_sdk
This package currently only lives in test PyPi
Usage
-----*Initialize app context*
.. code:: python
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*
.. code:: python
import kbase_sdk
job = kbase_sdk.run_app(context, {
app: 'AssemblyUtil',
method: 'get_assembly_as_fasta',
params: { 'ref': 'x/y/z' }
})Development
-----------Before working, activate a virtualenv with python3 and install
dependencies.. code:: sh
# 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.txtTests
~~~~~.. code:: sh
# 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.pyBuild
^^^^^Pip
.. code:: sh
# 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/xProject anatomy
---------------The python packages are found in ``/kbase_sdk/``. Tests are found in ``/test/``.
Key files:
- ``Makefile`` -- targets for testing and publishing
- ``setup.py`` -- python setuptools configuration for pip packaging
- ``conda_recipe`` -- config for conda packaging