Arrange packaging, Tox and pytest configuration

This commit is contained in:
Luke Murphy 2019-06-27 23:55:33 +02:00
parent b78a7ca584
commit 9d1e2c511c
No known key found for this signature in database
GPG key ID: 5E2EF5A63E3718CC
3 changed files with 39 additions and 3 deletions

6
pytest.ini Normal file
View file

@ -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

View file

@ -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',
],
)

17
tox.ini Normal file
View file

@ -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}