Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.
Open
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
81 changes: 80 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
version: 2

# Common steps for building server Docker images
pypi_step: &pypi_step
name: Init .pypirc
command: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers =" >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e " longtailbio" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[longtailbio]" >> ~/.pypirc
echo -e "repository: https://pypi.longtailbio.com" >> ~/.pypirc
echo -e "username: $LT_PYPI_USERNAME" >> ~/.pypirc
echo -e "password: $LT_PYPI_PASSWORD" >> ~/.pypirc
mkdir ~/.pip
echo -e "[global]" >> ~/.pip/pip.conf
echo -e "extra-index-url = https://pypi.longtailbio.com/simple/" >> ~/.pip/pip.conf


jobs:
build:
test_package:
docker:
- image: themattrix/tox

Expand All @@ -12,6 +32,8 @@ jobs:

- checkout

- run: *pypi_step

- run:
name: Run tests with py35
command: tox -e py35
Expand All @@ -28,3 +50,60 @@ jobs:
name: Run pylint
command: tox -e pylint
when: always

deploy:
docker:
- image: circleci/python:3.6.3-jessie

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: Install Python Dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt

- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}

- run: *pypi_step

- run:
name: Build package
command: |
. venv/bin/activate
python setup.py bdist_wheel --universal

- run:
name: Upload to Longtail PyPi
command: |
. venv/bin/activate
pip install twine
twine upload -r longtailbio dist/*



workflows:
version: 2
build_and_deploy:
jobs:
- test_package:
context: longtail-pypi
- deploy:
context: longtail-pypi
filters:
branches:
only: master
requires:
- test_package
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Simply run:

$ pipsi install .

**Note:** this relies packages from the Longtail Bio PyPi index. See [`pangea-modules`](https://github.com/LongTailBio/pangea-modules/tree/develop#pangea-modules) for instructions on setting that up.

### Usage

Expand Down
5 changes: 2 additions & 3 deletions metagenscope_cli/cli/upload_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sys import stderr
import click

from metagenscope_cli.sample_sources.data_super_source import DataSuperSource
from metagenscope_cli.sample_sources.file_source import FileSource
from pangea_modules.sample_source import DataSuperSource, FileSystemSource

from .utils import batch_upload, add_authorization, parse_metadata

Expand Down Expand Up @@ -52,7 +51,7 @@ def datasuper(uploader, group, group_name):
@click.argument('result_files', nargs=-1)
def files(uploader, group, result_files):
"""Upload all samples from llist of tool result files."""
sample_source = FileSource(files=result_files)
sample_source = FileSystemSource(files=result_files)
samples = sample_source.get_sample_payloads()

batch_upload(uploader, samples, group_uuid=group)
2 changes: 1 addition & 1 deletion metagenscope_cli/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import click
from requests.exceptions import HTTPError
from pangea_modules.sample_source.parser import parse_metadata_from_csv

from metagenscope_cli.network import Knex, Uploader
from metagenscope_cli.network.token_auth import TokenAuth
from metagenscope_cli.tools.parse_metadata import parse_metadata_from_csv


def parse_metadata(filename, sample_names):
Expand Down
2 changes: 1 addition & 1 deletion metagenscope_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
TOKEN_OPTION_KEY = 'token'


class MetagenscopeConfiguration(object):
class MetagenscopeConfiguration:
"""MetaGenScope configuration."""

def __init__(self, filename, dirname='~'):
Expand Down
2 changes: 1 addition & 1 deletion metagenscope_cli/network/knex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from metagenscope_cli.constants import DEFAULT_HOST


class Knex(object):
class Knex:
"""Knex wraps MetaGenScope requests requiring authentication."""

def __init__(self, token_auth, host=None, headers=None):
Expand Down
2 changes: 1 addition & 1 deletion metagenscope_cli/network/token_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, jwt_token=None):
if self.jwt_token is None:
try:
self.jwt_token = config.get_token()
except KeyError:
except KeyError: # pylint: disable=try-except-raise
# No saved token
raise

Expand Down
49 changes: 0 additions & 49 deletions metagenscope_cli/sample_sources/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions metagenscope_cli/sample_sources/constants.py

This file was deleted.

35 changes: 0 additions & 35 deletions metagenscope_cli/sample_sources/data_super_source.py

This file was deleted.

42 changes: 0 additions & 42 deletions metagenscope_cli/sample_sources/file_source.py

This file was deleted.

1 change: 0 additions & 1 deletion metagenscope_cli/tools/__init__.py

This file was deleted.

48 changes: 0 additions & 48 deletions metagenscope_cli/tools/constants.py

This file was deleted.

18 changes: 0 additions & 18 deletions metagenscope_cli/tools/parse_metadata.py

This file was deleted.

Loading