diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0e53464 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: tests + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + tests: + name: "Python ${{ matrix.python-version }} ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + + strategy: + matrix: + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] + os: [ubuntu-latest, macos-latest, windows-latest] + exclude: + - os: windows-latest + python-version: "2.7" + fail-fast: false + + steps: + - uses: "actions/checkout@v2" + with: + submodules: true + - uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + - name: "Install dependencies" + run: | + python -VV + python -m site + python -m pip install --upgrade pip setuptools wheel + python -m pip install --upgrade virtualenv tox tox-gh-actions + python -m pip install --upgrade cython + + - name: "Rebuild CPP files using Cython" + run: "./update_cpp.sh" + + - name: "Run tox targets for ${{ matrix.python-version }}" + run: "python -m tox" \ No newline at end of file diff --git a/setup.py b/setup.py index 16a2dc8..db92a8e 100755 --- a/setup.py +++ b/setup.py @@ -30,10 +30,11 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Scientific/Engineering :: Information Analysis', diff --git a/src/dawg.pyx b/src/dawg.pyx index 6dba921..37258d9 100644 --- a/src/dawg.pyx +++ b/src/dawg.pyx @@ -569,7 +569,7 @@ cdef class BytesDAWG(CompletionDAWG): self._completer.length(), b64_decoder_storage ) - results.push_back(string(b64_decoder_storage, key_len)) + results.push_back(string(b64_decoder_storage, key_len)) return results diff --git a/tox.ini b/tox.ini index 6f12e09..4028884 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,23 @@ [tox] -envlist = py27,py35,py35-locale,py36,py37,py38 +envlist = py27,py36,py36-locale,py37,py38,py39,py310 + +[gh-actions] +python = + 2.7: py27 + 3.6: py36-locale + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 [testenv] +changedir = {envtmpdir} deps = pytest -commands= - python setup.py install - py.test [] +commands = + py.test {toxinidir}/tests {posargs} -[testenv:py35-locale] -basepython = python3.5 +[testenv:py36-locale] +basepython = python3.6 setenv = LC_ALL=C diff --git a/update_cpp.sh b/update_cpp.sh index 7f771a7..8f6508a 100755 --- a/update_cpp.sh +++ b/update_cpp.sh @@ -1,2 +1 @@ -#!/bin/sh cython src/*.pyx src/*.pxd -a --cplus -2