tox.ini: add a getmagic.sh to use Debian version of python-magic
Passerelle is developped on the Debian python-magic package which is extracted from libmagic but does not exist on pypi, it makes testing those part of passerelle from a virtualenv a bit difficult.
This commit is contained in:
parent
6d3f24333b
commit
1a88910fed
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Get venv site-packages path
|
||||
DSTDIR=`python -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 python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
|
||||
|
||||
# Clean up
|
||||
rm -f $DSTDIR/magic.py
|
||||
|
||||
# Link
|
||||
ln -sv $SRCDIR/magic.py $DSTDIR
|
||||
|
||||
exit 0
|
||||
|
6
tox.ini
6
tox.ini
|
@ -3,12 +3,9 @@ envlist = django17,django18
|
|||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
sitepackages = True
|
||||
setenv =
|
||||
DJANGO_SETTINGS_MODULE=passerelle.settings
|
||||
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
||||
commands =
|
||||
py.test --junitxml=test_results.xml --cov-report xml --cov=passerelle/ --cov-config .coveragerc tests/
|
||||
deps =
|
||||
django17: django>1.7,<1.8
|
||||
django18: django>=1.8,<1.9
|
||||
|
@ -27,3 +24,6 @@ deps =
|
|||
astroid==1.3.2
|
||||
django-jsonresponse
|
||||
gadjo
|
||||
commands =
|
||||
./getmagic.sh
|
||||
py.test --junitxml=test_results.xml --cov-report xml --cov=passerelle/ --cov-config .coveragerc tests/
|
||||
|
|
Loading…
Reference in New Issue