Skip to content

Commit

Permalink
add support for Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
taleinat committed Jan 23, 2017
1 parent bd12639 commit e5f04b6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
24 changes: 17 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
sudo: false # use Travis's container-based infrastructure
language: python
python:
- "3.5"
install:
- pip install coveralls
# virtualenv < 14 is required to keep the Python 3.2 builds running
- pip install "virtualenv<14"
- pip install tox==2.1.1

python: "3.5"
env:
- TOXENV=py26-without_coverage
- TOXENV=py27-without_coverage
Expand All @@ -20,8 +15,23 @@ env:
- TOXENV=py33-with_coverage
- TOXENV=py34-with_coverage
- TOXENV=py35-with_coverage

matrix:
include:
- python: "3.6"
env:
- TOXENV=py36-without_coverage
- TOXENV=py36-with_coverage

install:
- pip install coveralls
# virtualenv < 14 is required to keep the Python 3.2 builds running
- pip install "virtualenv<14"
- pip install tox==2.1.1

script:
- tox

after_success:
case "$TOXENV" in
*with_coverage*)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ def run_setup(with_binary=True):
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand Down
4 changes: 4 additions & 0 deletions src/fuzzysearch/no_deletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def _expand(subsequence, sequence, max_substitutions, max_insertions,
if not subsequence:
return (0, 0)

# Calculate the minimum number of substitutions required for each number
# of insertions between 0 and max_insertions.
#
# This is done using a "dynamic programming" algorithm.
n_subs = array.array('L', [0] * (max_insertions + 1))
for subseq_index, char in enumerate(subsequence):
n_subs[0] += (char != sequence[subseq_index])
Expand Down
13 changes: 7 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{26,27,32,33,34,35}-{with,without}_coverage
envlist = py{26,27,32,33,34,35,36}-{with,without}_coverage

[testenv]
; setenv =
Expand All @@ -14,7 +14,7 @@ deps =
py26: unittest2==1.1.0
py{26,27,32}: mock==1.3.0
; use the latest version of BioPython
py{27,33,34,35}: biopython
py{27,33,34,35,36}: biopython
whitelist_externals =
mv
commands =
Expand All @@ -25,14 +25,14 @@ commands =
; (but when running with coverage, coverage run -m unittest2 works)
py26-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir}
py26-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests
py{27,32,33,34,35}-without_coverage: {envpython} -m unittest discover tests
py{27,32,33,34,35}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests
py{27,32,33,34,35,36}-without_coverage: {envpython} -m unittest discover tests
py{27,32,33,34,35,36}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests
with_coverage: mv .coverage .coverage.with_extensions
{envpython} -c 'import os; [os.remove(os.path.join(d, fn)) for (d, dns, fns) in os.walk("{envsitepackagesdir}/fuzzysearch") for fn in fns if fn.endswith(".so")]'
py26-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir}
py26-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests
py{27,32,33,34,35}-without_coverage: {envpython} -m unittest discover tests
py{27,32,33,34,35}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests
py{27,32,33,34,35,36}-without_coverage: {envpython} -m unittest discover tests
py{27,32,33,34,35,36}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests
with_coverage: mv .coverage .coverage.no_extensions
with_coverage: {envbindir}/coverage combine
basepython =
Expand All @@ -42,3 +42,4 @@ basepython =
py33: python3.3
py34: python3.4
py35: python3.5
py36: python3.6

0 comments on commit e5f04b6

Please sign in to comment.