Skip to content

Commit

Permalink
Improved static/dynamic analysis configs (#29)
Browse files Browse the repository at this point in the history
Travis now passes!
  • Loading branch information
clintval committed Jan 1, 2019
1 parent 357e2d9 commit 1d0e73b
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 35 deletions.
33 changes: 20 additions & 13 deletions .travis.yml
@@ -1,27 +1,34 @@
language: python
cache: pip

python:
- 3.6
- "3.6"

before_install:
- sudo rm -f /etc/boto.cfg

install:
- sudo apt-get update
- wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda install virtualenv # Use conda's virtualenv for Tox
- pip install codecov tox-travis
- pip install requests jinja2 anaconda-client
- conda update --quiet conda
- conda info --all
- conda config --add channels defaults
- conda config --add channels conda-forge
- conda config --add channels bioconda
- conda create -q -n snakemake snakemake virtualenv python=$TRAVIS_PYTHON_VERSION
- source activate snakemake
- pip install ./
- pip install --requirement test-requirements.txt codecov tox

script:
- tox
- conda build conda-recipe
- source activate snakemake
- ./run-tests

after_success:
- codecov
# after_success:
# - source activate snakemake
# - codecov

notifications:
email: false
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -41,7 +41,7 @@ Features:
- Continuous support for new tool arguments and options by smart parameter style conversion:
```python
>>> params:
... this_flag_is_so_new=false
... this_flag_is_so_new=False
>>> wrapper: scale('picard', 'tool')
```
```bash
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -8,6 +8,7 @@ exclude = '''
\.git
| \.mypy_cache
| \.tox
| \.snakemake
| venv
| _build
| buck-out
Expand Down
5 changes: 5 additions & 0 deletions run-tests
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eou pipefail

pytest -v -s
tox
2 changes: 1 addition & 1 deletion snakescale/__init__.py
Expand Up @@ -54,4 +54,4 @@ def scale(
wrapper_file = wrapper_dir / DEFAULT_SCALE_FILENAME

assert wrapper_file.exists(), f'Wrapper does not exist: {wrapper_file}'
return wrapper_dir.as_uri() if as_uri is True else str(wrapper_dir)
return f'file:{wrapper_dir}' if as_uri is True else str(wrapper_dir)
2 changes: 0 additions & 2 deletions snakescale/wrappers/latest/bedtools/subtract/environment.yaml
Expand Up @@ -2,5 +2,3 @@ channels:
- bioconda
dependencies:
- bedtools
- pip:
- snakescale>=0.7.0
Expand Up @@ -3,6 +3,7 @@ from snakescale import scale
rule bedtools_subtract:
input: a='data/a.bed', b='data/b.bed'
output: 'data/result.bed'
log: 'data/result.log'
params:
no_name_check=True,
g='data/ref.genome'
Expand Down
1 change: 0 additions & 1 deletion test-requirements.txt
Expand Up @@ -5,7 +5,6 @@ flake8-eradicate
flake8-blind-except
flake8-builtins
flake8-bugbear
flake8-docstrings
flake8-import-order
flake8-logging-format
flake8-rst-docstrings
Expand Down
3 changes: 3 additions & 0 deletions tests/test_wrappers.py
@@ -1,4 +1,7 @@
from snakescale.testing import run_tool_test
from snakescale import scale

from pathlib import Path


def test_bedtools_subtract():
Expand Down
23 changes: 6 additions & 17 deletions tox.ini
Expand Up @@ -12,14 +12,13 @@ envlist =
description = run the test suite with (basepython)
deps = -rtest-requirements.txt
extras = full
commands = pytest {posargs}

[testenv:py36-lint]
description = check the code style
basepython = python3.6
commands =
black --check {toxinidir}
# flake8 {toxinidir}/snakescale # Taking forever, for some reason.
flake8 {toxinidir}/snakescale
pylint {toxinidir}/snakescale --errors-only --output-format=colorized --disable=E0602

[testenv:py36-type]
Expand All @@ -46,8 +45,6 @@ commands =
branch = true
source = snakescale
parallel = true
omit =
snakescale/wrappers/*

[flake8]
doctests = True
Expand All @@ -58,8 +55,7 @@ ignore =
D100 # Missing docstring in public module
D105 # Missing docstring in magic method
D107 # Missing docstring in __init__
E501 # line too long (121 > 99 characters) TODO: REMOVE THIS AFTER ALL WRAPPERS ARE :thumbs-up:
F821 # undefined name "X" TODO: REMOVE ALONG WITH E0602 in PYLINT and hand-mark each line
F821 # undefined name "X"
RST304 # Unknown interpreted text role "X", https://github.com/peterjc/flake8-rst-docstrings/issues/7
enable-extensions=G
application-import-names = snakescale
Expand Down Expand Up @@ -92,20 +88,16 @@ warn_return_any = True
warn_redundant_casts = True

[pytest]
testpaths =
tests
docs
snakescale
testpaths = snakescale tests docs
addopts =
--cov=snakescale
--cov-config tox.ini
--cov-report html
--doctest-modules
--doctest-continue-on-failure
--doctest-plus
--doctest-rst
--doctest-glob '*.rst'
--show-capture=no
doctest_plus = enabled
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
mock_use_standalone_module = true
norecursedirs =
'.*'
'build'
Expand All @@ -116,6 +108,3 @@ norecursedirs =
'*.egg'
'venv'
'wrappers'
doctest_plus = enabled
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
mock_use_standalone_module = true

0 comments on commit 1d0e73b

Please sign in to comment.