From edb11b0a4104851a84b5f12da83d6ad98a643bb2 Mon Sep 17 00:00:00 2001 From: Tal Einat Date: Fri, 17 Apr 2020 02:08:16 +0300 Subject: [PATCH] add testing with PyPy on Linux via Travis-CI --- .travis.yml | 12 ++++++++++++ README.rst | 3 ++- setup.py | 1 + tox.ini | 29 +++++++++++++++-------------- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index c05689b..a70fd87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,18 @@ matrix: - python: "3.8" env: - TOXENV=py38-with_coverage + - python: "pypy" + env: + - TOXENV=pypy-without_coverage + - python: "pypy" + env: + - TOXENV=pypy-with_coverage + - python: "pypy3" + env: + - TOXENV=pypy3-without_coverage + - python: "pypy3" + env: + - TOXENV=pypy3-with_coverage install: - pip install coveralls diff --git a/README.rst b/README.rst index bc60fbe..96102a6 100644 --- a/README.rst +++ b/README.rst @@ -68,7 +68,8 @@ For more info, see the `documentation `_. Installation ------------ -``fuzzysearch`` supports Python versions 2.7 and 3.5+. +``fuzzysearch`` supports Python versions 2.7 and 3.5+, as well as PyPy 2.7 and +3.6. .. code:: diff --git a/setup.py b/setup.py index 01c7683..8bcd443 100644 --- a/setup.py +++ b/setup.py @@ -136,6 +136,7 @@ def run_setup(with_binary=True): 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules', ], cmdclass={'build_ext': ve_build_ext}, diff --git a/tox.ini b/tox.ini index 3b381b6..224b539 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35,36,37,38}-{with,without}_coverage-{,appveyor} +envlist = {py27,py35,py36,py37,py38,pypy,pypy3}-{with,without}_coverage-{,appveyor} [testenv] install_command = @@ -13,11 +13,10 @@ install_command = deps = ; use specific versions of testing tools with which this is known to work with_coverage: coverage>=5,<6 - py{27}: unittest2==1.1.0 - py{27}: mock==1.3.0 - py{27}: biopython<=1.76 - py{35}: biopython<=1.76 - py{36,37,38}: biopython + {py27,pypy}: unittest2==1.1.0 + {py27,pypy}: mock==1.3.0 + {py27,py35}: biopython<=1.76 + {py36,py37,py38,pypy3}: biopython whitelist_externals = mv commands = @@ -26,16 +25,16 @@ commands = ; * if running with coverage, merge the coverage run results from both runs ; * for Python 2.6 use the unit2 script since -m unittest2 doesn't work ; (but when running with coverage, coverage run -m unittest2 works) - py{27}-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir} - py{27}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests - py{35,36,37,38}-without_coverage: {envpython} -m unittest discover tests - py{35,36,37,38}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests + {py27,pypy}-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir} + {py27,pypy}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests + {py35,py36,py37,py38,pypy3}-without_coverage: {envpython} -m unittest discover tests + {py35,py36,py37,py38,pypy3}-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(os.path.join(r"{envsitepackagesdir}", "fuzzysearch")) for fn in fns if fn.endswith((".so", ".pyd"))]' - py{27}-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir} - py{27}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests - py{35,36,37,38}-without_coverage: {envpython} -m unittest discover tests - py{35,36,37,38}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests + {py27,pypy}-without_coverage: {envbindir}/unit2 discover tests -t {toxinidir} + {py27,pypy}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest2 discover tests + {py35,py36,py37,py38,pypy3}-without_coverage: {envpython} -m unittest discover tests + {py35,py36,py37,py38,pypy3}-with_coverage: {envbindir}/coverage run --source=fuzzysearch -m unittest discover tests with_coverage: mv .coverage .coverage.no_extensions with_coverage: {envbindir}/coverage combine basepython = @@ -44,4 +43,6 @@ basepython = py36: python3.6 py37: python3.7 py38: python3.8 + pypy: pypy + pypy3: pypy3 appveyor: {env:PYTHON:}\\python.exe