From 3cc1069d37431efd366a0894067aa4c3293dca3e Mon Sep 17 00:00:00 2001 From: Jon Betts Date: Fri, 30 Apr 2021 18:57:48 +0100 Subject: Add a tox file to automatically run the tests and add Python 3.9 --- .python-version | 8 ++++++++ .travis.yml | 4 +++- README.md | 4 ++++ setup.py | 2 ++ tox.ini | 18 ++++++++++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .python-version create mode 100644 tox.ini diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..0d88666 --- /dev/null +++ b/.python-version @@ -0,0 +1,8 @@ +3.9.2 +3.8.8 +3.7.10 +3.6.13 +3.5.10 +2.7.18 +pypy-5.7.1 +pypy3.7-7.3.3 diff --git a/.travis.yml b/.travis.yml index ee9335c..3c917db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: - "3.6" - "3.7" - "3.8" + - "3.9" - "pypy" - "pypy3" @@ -14,7 +15,8 @@ install: - pip install pip -U - pip install -e . - pip install pycodestyle - - pip install coveralls + # Avoid cryptography compilation problems with pypy and 2.7 + - pip install coveralls 'cryptography<=3.0;python_version=="2.7"' - pip install https://github.com/un33k/pyflakes/tarball/master before_script: diff --git a/README.md b/README.md index c5803f1..0e0195f 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,10 @@ quick-brown-fox-jumps-over-lazy-dog Running the tests ==================== +To run the tests against all environments: + + tox + To run the tests against the current environment: python test.py diff --git a/setup.py b/setup.py index 506f77b..038a85f 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,8 @@ classifiers = [ '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', ] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..d189cbd --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = py{39,38,37,36,35,27},pypy,pypy3 + +[testenv] +deps= + -e . +commands = + python -m unittest test + +[testenv:format] +deps = pycodestyle +allowlist_externals = sh +commands = sh format.sh + +[testenv:coverage] +deps = coverage +commands = + coverage run --source=slugify test.py \ No newline at end of file -- cgit v1.2.1