tox.ini: refactor and adapt for py3 and dj22 (#42801)
This commit is contained in:
parent
d377e55090
commit
4bb0f21480
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Get venv site-packages path
|
||||||
|
DSTDIR=`python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
|
||||||
|
|
||||||
|
# Get not venv site-packages path
|
||||||
|
# Remove first path (assuming that is the venv path)
|
||||||
|
NONPATH=`echo $PATH | sed 's/^[^:]*://'`
|
||||||
|
SRCDIR=`PATH=$NONPATH python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
rm -f $DSTDIR/lasso.*
|
||||||
|
rm -f $DSTDIR/_lasso.*
|
||||||
|
|
||||||
|
# Link
|
||||||
|
ln -sv /usr/lib/python3/dist-packages/lasso.py $DSTDIR/
|
||||||
|
for SOFILE in /usr/lib/python3/dist-packages/_lasso.cpython-*.so
|
||||||
|
do
|
||||||
|
ln -sv $SOFILE $DSTDIR/
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
set -e -x
|
|
||||||
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
|
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
|
||||||
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
|
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
|
||||||
elif [ -f pylint.django.rc ]; then
|
elif [ -f pylint.django.rc ]; then
|
||||||
|
@ -9,4 +10,4 @@ else
|
||||||
echo No pylint RC found
|
echo No pylint RC found
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
|
pylint -f parseable --rcfile ${PYLINT_RC} "$@" > pylint.out || /bin/true
|
||||||
|
|
83
tox.ini
83
tox.ini
|
@ -5,43 +5,68 @@
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-wallonie-connect/{env:BRANCH_NAME:}
|
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-wallonie-connect/{env:BRANCH_NAME:}
|
||||||
envlist = py27-dj111-pg-coverage
|
envlist =
|
||||||
|
py2-dj111-drf34
|
||||||
|
py3-dj111-drf34
|
||||||
|
py3-dj22-drf39
|
||||||
|
|
||||||
|
[tox:jenkins]
|
||||||
|
envlist =
|
||||||
|
pylint
|
||||||
|
py2-dj111-drf34
|
||||||
|
py3-dj111-drf34
|
||||||
|
py3-dj22-drf39
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
# django.contrib.auth is not tested it does not work with our templates
|
|
||||||
basepython = python2
|
|
||||||
setenv =
|
setenv =
|
||||||
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
|
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
|
||||||
DJANGO_SETTINGS_MODULE=authentic2.settings
|
DJANGO_SETTINGS_MODULE=authentic2.settings
|
||||||
pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
|
DB_ENGINE=django.db.backends.postgresql_psycopg2
|
||||||
coverage: COVERAGE=--junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc
|
JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml}
|
||||||
fast: FAST=--nomigrations
|
COVERAGE={tty::--junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc}
|
||||||
usedevelop =
|
usedevelop =
|
||||||
coverage: True
|
coverage: True
|
||||||
nocoverage: False
|
nocoverage: False
|
||||||
deps =
|
deps =
|
||||||
dj111: django>=1.11,<1.12
|
|
||||||
dj111: django-tables2>=1.1,<2
|
|
||||||
pg: psycopg2
|
|
||||||
coverage
|
|
||||||
pytest-cov
|
|
||||||
pytest-django<3.4.6
|
|
||||||
Pillow<7
|
|
||||||
mock
|
|
||||||
pytest
|
|
||||||
lxml
|
|
||||||
cssselect
|
|
||||||
pylint<1.8
|
|
||||||
pylint-django<0.8.1
|
|
||||||
django-webtest<1.9.3
|
|
||||||
WebTest
|
|
||||||
pyquery
|
|
||||||
httmock
|
|
||||||
pytz
|
|
||||||
requests
|
|
||||||
pytest-freezegun
|
|
||||||
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
||||||
|
# dependency constraints for authentic
|
||||||
|
py2: django-appconf<1.0.4
|
||||||
|
py2: django-filter<2
|
||||||
|
drf34: djangorestframework>=3.4,<3.4.1
|
||||||
|
drf39: djangorestframework>=3.9.2,<3.10
|
||||||
|
dj111: django<2.0
|
||||||
|
dj22: django<2.3
|
||||||
|
django-tables<2.0
|
||||||
|
psycopg2-binary
|
||||||
|
|
||||||
|
# pytest requirements
|
||||||
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
pytest-django
|
||||||
|
django-webtest
|
||||||
|
pyquery
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
./getlasso.sh
|
py2: ./getlasso.sh
|
||||||
dj111: ./pylint.sh src/authentic2_wallonie_connect
|
py3: ./getlasso3.sh
|
||||||
py.test {env:FAST:} {env:COVERAGE:} {posargs:tests/}
|
py.test {env:COVERAGE:} {env:JUNIT:} {tty:--sw:} {posargs:tests/}
|
||||||
|
|
||||||
|
[testenv:pylint]
|
||||||
|
skip_install = True
|
||||||
|
deps =
|
||||||
|
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
||||||
|
Django<2.3
|
||||||
|
pylint
|
||||||
|
pylint-django
|
||||||
|
commands =
|
||||||
|
/bin/bash -c "./pylint.sh src/*/"
|
||||||
|
|
||||||
|
[pytest]
|
||||||
|
filterwarnings =
|
||||||
|
error
|
||||||
|
# there is nothing we can do about that
|
||||||
|
ignore:defusedxml.lxml is no longer supported:DeprecationWarning:openpyxl.xml.functions
|
||||||
|
ignore:Using or importing the ABCs from 'collections':DeprecationWarning:django.*
|
||||||
|
ignore:Role QuerySet won't use Meta.ordering::django\..*
|
||||||
|
# remind us later
|
||||||
|
once:.*staticfiles.*::django\..*
|
||||||
|
|
Loading…
Reference in New Issue