-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First set of tools
- Loading branch information
Showing
25 changed files
with
2,230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Python package | ||
|
||
on: [push] | ||
env: | ||
POETRY_VERSION: 1.0 | ||
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
PYTHON_VERSION: [3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{matrix.PYTHON_VERSION}} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{matrix.PYTHON_VERSION}} | ||
- name: Install poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry==${{env.POETRY_VERSION}} | ||
- name: Install deps | ||
run: | | ||
poetry install | ||
- name: Run pytest | ||
run: | | ||
poetry run python -m pytest --cov=pyfgaws --cov-branch | ||
- name: Style checking | ||
run: | | ||
poetry run black --line-length 99 --check pyfgaws | ||
- name: Run lint | ||
run: | | ||
poetry run flake8 --config=ci/flake8.cfg pyfgaws | ||
- name: Run mypy | ||
run: | | ||
poetry run mypy -p pyfgaws --config=ci/mypy.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# PyCharm | ||
.idea | ||
|
||
# Python compiled & optimized files | ||
*.pyc | ||
*.pyo | ||
|
||
# MyPy Cache directory | ||
.mypy_cache | ||
|
||
# for develop installs | ||
*.egg-info | ||
|
||
# venv set up | ||
.venv | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2020 Fulcrum Genomics LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
function banner() { | ||
echo | ||
echo "================================================================================" | ||
echo $* | ||
echo "================================================================================" | ||
echo | ||
} | ||
|
||
##################################################################### | ||
# Takes two parameters, a "name" and a "command". | ||
# Runs the command and prints out whether it succeeded or failed, and | ||
# also tracks a list of failed steps in $failures. | ||
##################################################################### | ||
function run() { | ||
local name=$1 | ||
local cmd=$2 | ||
|
||
banner "Running $name [$cmd]" | ||
set +e | ||
$cmd | ||
exit_code=$? | ||
set -e | ||
|
||
if [[ $exit_code == 0 ]]; then | ||
echo Passed $name: "[$cmd]" | ||
else | ||
echo Failed $name: "[$cmd]" | ||
if [ -z "$failures" ]; then | ||
failures="$failures $name" | ||
else | ||
failures="$failures, $name" | ||
fi | ||
fi | ||
} | ||
|
||
parent=$(cd $(dirname $0) && pwd -P) | ||
|
||
banner "Executing in conda environment ${CONDA_DEFAULT_ENV} in directory ${root}" | ||
run "Unit Tests" "python -m pytest -vv -r sx pyfgaws" | ||
run "Style Checking" "black --line-length 99 --check pyfgaws" | ||
run "Linting" "flake8 --config=$parent/flake8.cfg pyfgaws" | ||
run "Type Checking" "mypy -p pyfgaws --config $parent/mypy.ini" | ||
|
||
if [ -z "$failures" ]; then | ||
banner "Checks Passed" | ||
else | ||
banner "Checks Failed with failures in: $failures" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# flake8 config file | ||
|
||
[flake8] | ||
max_line_length = 100 | ||
show-source = true | ||
ignore = E701 W504 W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[mypy] | ||
strict_optional = False | ||
ignore_missing_imports = True | ||
disallow_untyped_decorators = False | ||
follow_imports = "silent" | ||
disallow_untyped_defs = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Setup python version and poetry | ||
python=3.8.2 | ||
poetry=1.0.5 |
Oops, something went wrong.