Skip to content

Commit 016eac1

Browse files
authored
Merge pull request #24 from bcgsc/release/v0.1.0
Release/v0.1.0
2 parents c1c0e04 + 054c346 commit 016eac1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2191
-1791
lines changed

.github/workflows/gkb_workflows/pytest.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/publishdevdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: [3.8]
13+
python-version: [3.9]
1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@v1
16+
uses: actions/checkout@v3
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v3
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: install and build
2222
run: |
2323
python -m pip install --upgrade pip setuptools
2424
pip install .[docs]
2525
pip install markdown_refdocs mkdocs mkdocs-material
26-
markdown_refdocs ipr -o docs/reference --link
26+
markdown_refdocs pori_python -o docs/reference --link
2727
mkdocs build
2828
- name: Deploy
2929
uses: peaceiris/actions-gh-pages@v3

.github/workflows/publishgkbdevdocs.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/gkb_workflows/pypipublish.yml renamed to .github/workflows/pypitestpublish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# This workflows will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

4-
name: upload to pypi
4+
name: upload to testpypi
55

6-
on:
7-
release:
8-
types: [released]
9-
workflow_dispatch:
6+
on: workflow_dispatch
107

118
jobs:
129
deploy:
@@ -25,8 +22,8 @@ jobs:
2522
pip install setuptools wheel twine
2623
- name: Build and publish
2724
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }}
26+
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }}
3027
run: |
3128
python setup.py sdist bdist_wheel install
32-
twine upload dist/*
29+
twine upload --repository testpypi dist/*

.github/workflows/pytest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: build
66
on:
77
push:
88
branches:
9-
- master
9+
- main
1010
- develop
1111
pull_request:
1212

@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
19+
python-version: ['3.9', '3.10', '3.11', '3.12']
2020

2121
steps:
2222
- uses: actions/checkout@v3
@@ -32,15 +32,15 @@ jobs:
3232
run: |
3333
pip install flake8
3434
# stop the build if there are Python syntax errors or undefined names
35-
flake8 ipr graphkb --count --select=E9,F63,F7,F82 --show-source --statistics
35+
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
3636
- name: Check with black
3737
run: |
3838
pip install black
39-
black --check -S -l 100 ipr graphkb tests
39+
black --check -S -l 100 pori_python tests
4040
- name: Full Tests with pytest
4141
run: |
4242
pip list
43-
pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov ipr --cov-report term --cov-report xml
43+
pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov pori_python --cov-report term --cov-report xml
4444
env:
4545
IPR_USER: ${{ secrets.IPR_TEST_USER }}
4646
IPR_PASS: ${{ secrets.IPR_TEST_PASSWORD }}

.github/workflows/quick-pytest.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: quick-tests
55

66
on:
7-
- push
7+
push:
88

99
jobs:
1010
build:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
16+
python-version: ['3.11']
1717

1818
steps:
1919
- uses: actions/checkout@v3
@@ -29,11 +29,11 @@ jobs:
2929
run: |
3030
pip install flake8
3131
# stop the build if there are Python syntax errors or undefined names
32-
flake8 ipr graphkb --count --select=E9,F63,F7,F82 --show-source --statistics
32+
flake8 pori_python --count --select=E9,F63,F7,F82 --show-source --statistics
3333
- name: Check with black
3434
run: |
3535
pip install black
36-
black --check -S -l 100 ipr graphkb tests
36+
black --check -S -l 100 pori_python tests
3737
- name: Short Tests with pytest
3838
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov ipr --cov-report term --cov-report xml
3939
env:
@@ -43,3 +43,4 @@ jobs:
4343
GRAPHKB_PASS: ${{ secrets.GKB_TEST_PASS }}
4444
EXCLUDE_INTEGRATION_TESTS: 1
4545
# EXCLUDE_INTEGRATION_TESTS: ${{ matrix.python-version != '3.11' }}
46+
if: github.event_name != 'pull_request'

README.md

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11

2-
# IPR
2+
# PORI Python Adaptor
33

4-
![build](https://github.com/bcgsc/pori_ipr_python/workflows/build/badge.svg) [![PyPi](https://img.shields.io/pypi/v/ipr.svg)](https://pypi.org/project/ipr) [![codecov](https://codecov.io/gh/bcgsc/pori_ipr_python/branch/master/graph/badge.svg)](https://codecov.io/gh/bcgsc/pori_ipr_python) [![PyPI - Downloads](https://img.shields.io/pypi/dm/ipr)](https://pypistats.org/packages/ipr) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5730671.svg)](https://doi.org/10.5281/zenodo.5730671)
4+
![build](https://github.com/bcgsc/pori_python/workflows/build/badge.svg) [![codecov](https://codecov.io/gh/bcgsc/pori_python/branch/master/graph/badge.svg)](https://codecov.io/gh/bcgsc/pori_python)
55

66
This repository is part of the [Platform for Oncogenomic Reporting and Interpretation (PORI)](https://bcgsc.github.io/pori/).
77

8+
This is a python adaptor package for querying the GraphKB API and IPR API.
9+
810
This python tool takes in variant inputs as tab-delimited files and annotates them using GraphKB.
911
The resulting output is uploaded to IPR as a report. Additional report content such as images and
1012
metadata can be passed to be included in the report upload.
1113

12-
For documentation on how to create reports using this adaptor, see the [main documentation site](https://bcgsc.github.io/pori/) for the platform.
14+
For documentation on how to create reports using the IPR adaptor, see the [main documentation site](https://bcgsc.github.io/pori/) for the platform. For the GraphKB adaptor, see the [user manual](https://bcgsc.github.io/pori/graphkb/scripting/).
15+
16+
- [Getting Started](#getting-started)
17+
- [Install (For developers)](#install-for-developers)
18+
- [Documentation](#documentation)
19+
- [Deployment (Publishing)](#deployment-publishing)
1320

1421
## Getting Started
1522

@@ -18,8 +25,8 @@ For documentation on how to create reports using this adaptor, see the [main doc
1825
clone this repository
1926

2027
```bash
21-
git clone https://github.com/bcgsc/pori_ipr_python.git
22-
cd pori_ipr_python
28+
git clone https://github.com/bcgsc/pori_python.git
29+
cd pori_python
2330
```
2431

2532
create a virtual environment
@@ -36,67 +43,47 @@ pip install -U pip setuptools
3643
pip install -e .[dev]
3744
```
3845

39-
Run the tests
46+
Run the tests:
4047

41-
```bash
42-
pytest tests
43-
```
48+
Export usernames, passwords, and set test options.
4449

45-
## Documentation
46-
47-
The user documentation for this tool is hosted with the [main documentation site](https://bcgsc.github.io/pori/).
50+
Note that IPR tests will try to use the BCGSC production GraphKB API by default.
51+
If you want to test interaction with a different instance, you will need to
52+
set the GraphKB variables.
4853

49-
Developers: Any updates to this tool should be edited and reflected in the main site documentation as well.
50-
51-
52-
# GraphKB (Python)
53-
54-
![build](https://github.com/bcgsc/pori_graphkb_python/workflows/build/badge.svg) [![PyPi](https://img.shields.io/pypi/v/graphkb.svg)](https://pypi.org/project/graphkb) [![codecov](https://codecov.io/gh/bcgsc/pori_graphkb_python/branch/master/graph/badge.svg)](https://codecov.io/gh/bcgsc/pori_graphkb_python) [![PyPI - Downloads](https://img.shields.io/pypi/dm/graphkb)](https://pypistats.org/packages/graphkb) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5730523.svg)](https://doi.org/10.5281/zenodo.5730523)
55-
56-
This repository is part of the [platform for oncogenomic reporting and interpretation](https://github.com/bcgsc/pori).
57-
58-
Python adapter package for querying the GraphKB API. See the [user manual](https://bcgsc.github.io/pori/graphkb/scripting/)
59-
60-
- [Getting Started](#getting-started)
61-
- [Install (For developers)](#install-for-developers)
62-
- [Run Tests](#run-tests)
63-
- [Generating the Documentation](#generating-the-documentation)
64-
- [Deployment (Publishing)](#deployment-publishing)
65-
66-
## Getting Started
67-
68-
### Install (For developers)
69-
70-
clone this repository
54+
Set EXCLUDE vars to 1 if you don't want to run these tests.
55+
ONCOKB and BCGSC tests are enabled by default.
7156

7257
```bash
73-
git clone https://github.com/bcgsc/pori_graphkb_python
74-
cd pori_graphkb_python
58+
export IPR_USER='pori_admin'
59+
export IPR_PASS='pori_admin'
60+
export IPR_URL='http://localhost:8081/api'
61+
export GRAPHKB_USER='pori_admin'
62+
export GRAPHKB_PASS='pori_admin'
63+
export GRAPHKB_URL='http://localhost:8080/api'
64+
EXCLUDE_BCGSC_TESTS = 1
65+
EXCLUDE_ONCOKB_TESTS = 1
7566
```
7667

77-
create a virtual environment
68+
If you want to run tests that upload reports to a live IPR instance,
69+
specify the url of the IPR API you want to use and set the test var to 1.
70+
These tests are disabled by default.
7871

7972
```bash
80-
python3 -m venv venv
81-
source venv/bin/activate
73+
export IPR_TEST_URL='http://localhost:8081/api'
74+
INCLUDE_UPLOAD_TESTS = 1
8275
```
8376

84-
install the package and its development dependencies
85-
8677
```bash
87-
pip install -U pip setuptools
88-
pip install -e .[dev]
78+
pytest tests
8979
```
9080

91-
### Run Tests
81+
## Documentation
9282

93-
```bash
94-
pytest tests
95-
```
83+
The user documentation for this tool is hosted with the [main documentation site](https://bcgsc.github.io/pori/).
9684

97-
## Generating the Documentation
85+
Developers: Any updates to this tool should be edited and reflected in the main site documentation as well.
9886

99-
User documentation for this repository is hosted in the [central PORI repository](https://github.com/bcgsc/pori/)
10087

10188
## Deployment (Publishing)
10289

pori_python/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from . import ipr
2-
from . import graphkb
1+
from . import graphkb, ipr # noqa: F401

pori_python/graphkb/classes.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<body>
33
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
44
<div class="mermaid">
5-
5+
66
classDiagram
77
class BasicPosition {
88
pos : int
@@ -78,9 +78,9 @@
7878
untemplatedSeqSize : Optional[int]
7979
}
8080
class Statement {
81-
conditions : List[OntologyLink]
82-
evidence : List[OntologyLink]
83-
evidenceLevel : List[OntologyLink]
81+
conditions : List[Ontology]
82+
evidence : List[Ontology]
83+
evidenceLevel : List[Ontology]
8484
relevance : Union
8585
source : Union
8686
sourceId : str
@@ -90,12 +90,12 @@
9090
displayName : str
9191
germline : bool
9292
reference1 : Union
93-
reference2 : Optional[OntologyLink]
93+
reference2 : Optional[Ontology]
9494
type : Union
9595
zygosity : str
9696
}
9797
PositionalVariant --|> Variant
98-
98+
9999
</div>
100100
</body>
101101
</html>

0 commit comments

Comments
 (0)