diff --git a/pkgs/sagemath-gap/tox.ini b/pkgs/sagemath-gap/tox.ini new file mode 100644 index 00000000000..492c30f3252 --- /dev/null +++ b/pkgs/sagemath-gap/tox.ini @@ -0,0 +1,64 @@ +# To build and test in the tox environment: +# +# ./sage -sh -c '(cd pkgs/sagemath-gap && tox -v -v -v -e sagepython)' +# +# To test interactively: +# +# pkgs/sagemath-gap/.tox/sagepython/bin/python +# +[tox] +envlist = + sagepython-norequirements + +[testenv] +deps = + !norequirements: -rrequirements.txt + # tox 3.x does not handle extras when using --installpkg. https://github.com/tox-dev/tox/issues/1576 + sagemath-repl + +extras = test + +passenv = + # Variables set by .homebrew-build-env + CPATH + LIBRARY_PATH + PKG_CONFIG_PATH + # Parallel build + SAGE_NUM_THREADS + SAGE_NUM_THREADS_PARALLEL + # SAGE_VENV only for referring to the basepython or finding the wheels + sagepython, sagewheels: SAGE_VENV + # Location of the wheels + sagewheels: SAGE_SPKG_WHEELS + +setenv = + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + # We supply pip options by environment variables so that they + # apply both to the installation of the dependencies and of the package + sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + nopypi: PIP_NO_INDEX=true + +whitelist_externals = + bash + +commands = + # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + # Importing sage.libs.gap.libgap does not work yet because of the runtime dep on 'sage.rings.polynomial' + # {envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.libs.gap.libgap' + + +[testenv:sagepython] +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:sagepython-sagewheels-nopypi] +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:sagepython-sagewheels-nopypi-norequirements] +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:sagepython-sagewheels] +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:sagepython-norequirements] +basepython = {env:SAGE_VENV}/bin/python3