From 9d1e2c511c60267cbed122b65ec201a86240e585 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 27 Jun 2019 23:55:33 +0200 Subject: [PATCH] Arrange packaging, Tox and pytest configuration --- pytest.ini | 6 ++++++ setup.py | 19 ++++++++++++++++--- tox.ini | 17 +++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 pytest.ini create mode 100644 tox.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..75579e0e --- /dev/null +++ b/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +addopts = --cov=moulinette -s -v --no-cov-on-fail +norecursedirs = dist doc build .tox .eggs +testpaths = test/ +env = + MOULINETTE_LOCALES_DIR = {PWD}/locales diff --git a/setup.py b/setup.py index ea4ded50..2ebd93b3 100755 --- a/setup.py +++ b/setup.py @@ -1,12 +1,11 @@ #!/usr/bin/env python + import os import sys - from distutils.core import setup from moulinette.globals import LOCALES_DIR - # Extend installation locale_files = [] @@ -31,5 +30,19 @@ setup(name='Moulinette', 'moulinette.utils', ], data_files=[(LOCALES_DIR, locale_files)], - tests_require=["pytest", "webtest"], + python_requires='==2.7.*', + install_requires=[ + 'argcomplete', + 'psutil', + 'pytz', + 'pyyaml', + ], + tests_require=[ + 'pytest', + 'pytest-cov', + 'pytest-env', + 'pytest-mock', + 'requests', + 'requests-mock', + ], ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..33cdb31f --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist = py27 +skipdist = True +isolated_build = True + +[testenv] +usedevelop = True +passenv = * +deps = + pytest >= 4.6.3, < 5.0 + pytest-cov >= 2.7.1, < 3.0 + pytest-mock >= 1.10.4, < 2.0 + pytest-env >= 0.6.2, < 1.0 + requests >= 2.22.0, < 3.0 + requests-mock >= 1.6.0, < 2.0 +commands = + pytest {posargs}