Skip to content

Commit

Permalink
Adding tox, pytest, flake8, and travis configurations
Browse files Browse the repository at this point in the history
Lets test some tests!
  • Loading branch information
sbliven committed Nov 7, 2018
1 parent 4d64746 commit 90ed1ed
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 13 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: python
python:
- "3.3"
- "3.6"
- "3.7" # 3.7 development branch
# command to install dependencies
install:
- pip install tox-travis
# command to run tests
script:
- tox
15 changes: 15 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,18 @@ or mv the TRAL configuration directory from your root dir to your home, e.g.::
$ cd ~
$ sudo mv /root/.tral ./
$ sudo chown -R $(whoami) .tral


Development
-----------

To compile locally, run

$ pip install -r requirements_dev.py
$ python setup.py install

TRAL uses tox and pytest for testing. The following commands relate to testing and code style:

$ flake8 # check code style
$ python setup.py test # Run tests
$ tox # Run comprehensive test suite on multiple python versions
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--index-url https://pypi.python.org/simple/

-e .
3 changes: 3 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--index-url https://pypi.python.org/simple/

-e .[develop,docs]
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[aliases]
test=pytest

[flake8]
exclude = docs
max-line-length = 120
25 changes: 20 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,30 @@ def read(*paths):
"Operating System :: OS Independent",
],
install_requires=[
"Biopython >= 1.64",
"biopython >= 1.64",
"configobj >= 5.0.6",
#"docutils >= 0.11", # Uncomment if you wish to create the documentation locally.
"numpy >= 1.6.1",
#"pypandoc >= 0.9.6" # Uncomment if you wish to convert the markdown readme to a rest readme for upload on Pypi.
#"pytest >= 2.5.2", # Uncomment if you wish to run the tests locally.
"scipy >=0.12.0",
#"Sphinx >= 1.2.2", # Uncomment if you wish to create the documentation locally.
],
setup_requires=["pytest-runner"],
tests_require=[
"pytest >= 2.5.2",
],
# Install with e.g. `python setup.py install tral[docs]`
extras_require={
'docs': [
"docutils >= 0.11",
"pypandoc >= 0.9.6",
"Sphinx >= 1.2.2",
],
'develop': [
"flake8 >= 3.6",
"tox >= 3.5",
],
'workflow': [
"pyfaidx==0.4.7.1", # Used by the workflow example for fasta indexing
]
},
# package_data: None-module files, which should still be distributed are mentioned here:
package_data={"tral": ["tral_configuration/*.ini",
"tral_configuration/data/hhrepid/*",
Expand Down
8 changes: 0 additions & 8 deletions site-requirements.txt

This file was deleted.

24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
; could add some more environments in the future
envlist = py37, flake8

[travis]
python =
3.7: py37
3.6: py36
3.5: py35
3.4: py34
3.3: py33

[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 tral

[testenv]
deps =
-r{toxinidir}/requirements_dev.txt

commands =
pip install -U pip
python setup.py test

0 comments on commit 90ed1ed

Please sign in to comment.