Skip to content

Commit

Permalink
Merge branch 'feature/compatibility' into 'develop'
Browse files Browse the repository at this point in the history
Remove python 2 support and move to github actions

See merge request core/sevenbridges-python!77
  • Loading branch information
Dejan Knezevic committed Dec 23, 2020
2 parents ce39166 + fa53a9d commit 0fe8fbd
Show file tree
Hide file tree
Showing 102 changed files with 896 additions and 1,431 deletions.
Empty file removed .coveragerc
Empty file.
57 changes: 57 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
push:
branches:
- develop
pull_request:
branches:
- develop
release:
types:
- published

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
flake8
pytest --verbose --cov-config setup.cfg
release:
needs: tests
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install wheel twine
export PACKAGE_VERSION=${GITHUB_REF:10}
echo "__version__ = '$PACKAGE_VERSION'" > sevenbridges/version.py
python setup.py sdist bdist_wheel
twine upload dist/*
42 changes: 12 additions & 30 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
image: python:3.8-buster

variables:
REQUIREMENTS: "requirements.txt"
REQUIREMENTS2: "requirements2.txt"
image: python:3.9-slim-buster

stages:
- test
Expand All @@ -11,54 +7,40 @@ stages:
.test: &test
stage: test
before_script:
- infinity config build-info
- python --version
- pip install -U -r $REQUIREMENTS
- pip install -r requirements-dev.txt
- export PYTHONPATH=$(pwd):$PYTHONPATH
script:
- flake8
- pytest -v --cov-config setup.cfg
- pytest --verbose --cov-config setup.cfg
artifacts:
paths:
- coverage_report/*

# Test with python 2.7
test:2.7:
stage: test
before_script:
- infinity config build-info
- python --version
- pip install -U -r $REQUIREMENTS2
- export PYTHONPATH=$(pwd):$PYTHONPATH
script:
- flake8
- pytest -v --cov-config setup.cfg
image: python:2.7

# Test with python 3.5
test:3.5:
<<: *test
image: python:3.5

# Test with python 3.6
test:3.6:
<<: *test
image: python:3.6
image: python:3.6-slim-buster

# Test with python 3.7
test:3.7:
<<: *test
image: python:3.7-stretch
image: python:3.7-slim-buster

# Test with python 3.8
test:3.8:
<<: *test
image: python:3.8-buster
image: python:3.8-slim-buster

# Test with python 3.9
test:3.9:
<<: *test
image: python:3.9-slim-buster

sonar:
stage: sonar
image: emeraldsquad/sonar-scanner:1.0.0
script: infinity sonar scanner
allow_failure: true
dependencies:
- test:3.8
- test:3.9
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include sevenbridges/VERSION LICENCE README.md requirements*.txt setup.cfg
include LICENCE
include README.md
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sevenbridges-python
===================

[![Travis](https://travis-ci.org/sbg/sevenbridges-python.svg)](https://travis-ci.org/sbg/sevenbridges-python)
[![PyPI version](https://badge.fury.io/py/sevenbridges-python.svg)](https://pypi.python.org/pypi/sevenbridges-python)
[![Documentation](https://readthedocs.org/projects/sevenbridges-python/badge/?version=latest)](http://sevenbridges-python.readthedocs.org/en/latest/)
[![Licence](https://img.shields.io/badge/licence-Apache-orange.svg)](https://github.com/sbg/sevenbridges-python/blob/develop/LICENCE)
Expand All @@ -12,7 +11,7 @@ sevenbridges-python is a [Python](http://www.python.org/) library that
provides an interface for the [Seven Bridges Platform](https://www.sbgenomics.com/) the
[Cancer Genomics Cloud](http://www.cancergenomicscloud.org/) and
[Cavatica](http://www.cavatica.org) public APIs. It works with Python
versions 2.6+ and supports Python 3.
versions 3.6+.

The [Seven Bridges Platform](https://www.sbgenomics.com/) is a
cloud-based environment for conducting bioinformatic analyses. It is a
Expand All @@ -32,7 +31,7 @@ than a petabyte of multi-dimensional data available immediately to
authorized researchers. You can add your own data to analyze alongside
TCGA using predefined analytical workflows or your own tools.

[Cavatica](http://www.cavatica.org/),
The [Cavatica](http://www.cavatica.org/),
powered by [Seven Bridges](https://www.sbgenomics.com/), is a data analysis and sharing
platform designed to accelerate discovery in a scalable, cloud-based
compute environment where data, results, and workflows are shared among
Expand All @@ -48,7 +47,7 @@ The latest documentation can be found on [readthedocs](http://sevenbridges-pytho
Installation
------------

The easiest way to install sevenbridges-python is using pip. :
The easiest way to install sevenbridges-python is using pip:

$ pip install sevenbridges-python

Expand All @@ -69,16 +68,15 @@ package, or install it into your site-packages by invoking: :

If you are interested in reviewing this documentation locally, clone
this repository, position yourself in the docs directory and after
installing `requirements.txt` (or `requirements2.txt` if using python 2), invoke:
installing `requirements-dev.txt`, invoke:

$ make html

Run Tests
---------

In order to run tests clone this repository, position yourself in the
root of the cloned project and after installing `requirements.txt` (or
`requirements2.txt` if using python 2), invoke:
root of the cloned project and after installing `requirements-dev.txt`, invoke:

$ pytest

Expand Down Expand Up @@ -116,8 +114,8 @@ before using this library:
Initialize configuration using the configuration file
-----------------------------------------------------

Once you obtain your authentication token you can pass it to the Config
object. You can instantiate your API object by passing the appropriate
Once you obtain your authentication token, you can pass it to the Config
object. You can instantiate the API object by passing the appropriate
configuration. There are three ways you can pass configure the library:

1. Pass parameters `url` and `token` explicitly when initializing the
Expand All @@ -137,9 +135,8 @@ api = sbg.Api(url='https://api.sbgenomics.com/v2', token='<TOKEN_HERE>')
### Initialization via environment variables

```python
import sevenbridges as sbg

import os
import sevenbridges as sbg

# Usually these would be set in the shell beforehand
os.environ['SB_API_ENDPOINT'] = 'https://api.sbgenomics.com/v2'
Expand Down Expand Up @@ -222,7 +219,7 @@ before submitting a pull request.
Copyright
---------

Copyright (c) 2016-2018 Seven Bridges Genomics, Inc. All rights
Copyright (c) 2020 Seven Bridges Genomics, Inc. All rights
reserved.

This project is open-source via the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
18 changes: 9 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

import os
import sys

from datetime import datetime

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
extra_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.environ['SPHINX_DOC'] = 'True'
sys.path.append(extra_path)
from sevenbridges import __version__ as version_pkg
from sevenbridges import __version__ as version_pkg # noqa

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -54,9 +54,9 @@
master_doc = 'index'

# General information about the project.
project = u'sevenbridges-python'
copyright = u'2018, Seven Bridges Genomics Inc.'
author = u'Seven Bridges Genomics'
project = 'sevenbridges-python'
copyright = f'{datetime.utcnow().year}, Seven Bridges Genomics Inc.'
author = 'Seven Bridges Genomics'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -227,8 +227,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'sbg.tex', u'sbg Documentation',
u'Seven Bridges Genomics', 'manual'),
(master_doc, 'sbg.tex', 'sbg Documentation',
'Seven Bridges Genomics', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -257,7 +257,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sbg', u'sbg Documentation',
(master_doc, 'sbg', 'sbg Documentation',
[author], 1)
]

Expand All @@ -271,7 +271,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'sbg', u'sbg Documentation',
(master_doc, 'sbg', 'sbg Documentation',
author, 'sbg', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
9 changes: 9 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-r requirements.txt

flake8==3.8.4
pytest==6.2.1
pytest-cov==2.10.1
requests-mock==1.8.0
faker==5.0.2
sphinx==3.4.0
sphinx_rtd_theme==0.5.0
12 changes: 2 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
six>=1.10.0
requests>=2.20.0

flake8==3.8.4
pytest==6.1.2
pytest-cov==2.10.1
requests-mock==1.8.0
faker==4.14.2
sphinx==3.3.0
sphinx_rtd_theme==0.1.9
requests>=2.25.1
urllib3>=1.26.2
12 changes: 0 additions & 12 deletions requirements2.txt

This file was deleted.

12 changes: 0 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
[bdist_wheel]
universal=1

[metadata]
description-file =
README.md

[flake8]
exclude =
docs/conf.py
sevenbridges/__init__.py

[tool:pytest]
addopts =
--cov=sevenbridges
Expand Down

0 comments on commit 0fe8fbd

Please sign in to comment.