Skip to content

Commit

Permalink
Trac #29367: tox.ini: Add tests for python2
Browse files Browse the repository at this point in the history
These tests can be run by adding `-python2` to the tox environment,
such as
{{{
    tox -e local-homebrew-macos-standard-python2
    tox -e docker-ubuntu-bionic-standard-python2
}}}

Additionally, now `local` environments (introduced in #29104 for
homebrew) respect the environment variable `EXTRA_CONFIGURE_ARGS` that
was already available for `docker` environments.

URL: https://trac.sagemath.org/29367
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Mar 29, 2020
2 parents 84d2576 + a33b72a commit ff04513
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
envlist =
check_configure,
{
{
### "docker" toxenvs copy sources from the source tree subject to the exclusions in
### the file ".dockerignore". This should work out of non-clean source trees, and all
### "docker" toxenvs can be run in parallel.
Expand Down Expand Up @@ -64,15 +65,31 @@ envlist =
# $ tox -e local-homebrew-macos-standard -- ppl-clean ppl V=1
#
local-homebrew-macos
}-{minimal,standard,maximal},
}
-{###
### Package factors:
###
minimal, # Install a minimal set of system packages that supports bootstrapping and compiling Sage.
standard, # Install all known system packages equivalent to standard packages that have spkg-configure.m4
maximal # Install all known system packages equivalent to standard/optional packages that have spkg-configure.m4
},
###
### The "local-direct" toxenv passes the whole environment on to the sage build.
### Whatever is in PATH etc. will be used.
###
local-direct
}
-{###
### Configuration factors:
###
python2 # configure Sage to use Python 2 instead of the default (Python 3)
}

skipsdist = true

[testenv]
passenv =
EXTRA_CONFIGURE_ARGS
docker: EXTRA_DOCKER_BUILD_ARGS
local: MAKE
local-direct: *
Expand Down Expand Up @@ -215,6 +232,16 @@ setenv =
local-homebrew: PATH={env:HOMEBREW}/bin:/usr/bin:/bin:/usr/sbin:/sbin
local-homebrew: SETENV=. .homebrew-build-env

#
# Configuration factors
#
python2: CONFIG_CONFIGURE_ARGS_1=--with-python=2

#
# Resulting full configuration args, including EXTRA_CONFIGURE_ARGS from the user environment
#
CONFIGURE_ARGS={env:CONFIG_CONFIGURE_ARGS_1:} {env:CONFIG_CONFIGURE_ARGS_2:} {env:EXTRA_CONFIGURE_ARGS:}

# environment will be skipped if regular expression does not match against the sys.platform string
platform =
local-macos: darwin
Expand Down Expand Up @@ -243,13 +270,13 @@ commands =
# configure binfmt-support on the Docker host (works locally or remotely, i.e: using boot2docker)
docker-{arm64,armhf}: docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker: docker build . -f {envdir}/Dockerfile \
docker: --build-arg EXTRA_CONFIGURE_ARGS="{env:EXTRA_CONFIGURE_ARGS:}" \
docker: --build-arg EXTRA_CONFIGURE_ARGS="{env:CONFIGURE_ARGS}" \
docker: --build-arg BASE_IMAGE={env:FULL_BASE_IMAGE_AND_TAG} \
docker-conda: --build-arg USE_CONDARC="{env:CONDARC}" \
docker: {env:EXTRA_DOCKER_BUILD_ARGS:}
# pathpy checksuite needs tox. #28728: gap fails its test suite.
# linbox/cysignals testsuites fail.
local: bash -c 'export PATH={env:PATH} && {env:SETENV} && ./bootstrap && ./configure --prefix={envdir}/local && make -k V=0 base-toolchain && SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox" make -k V=0 {posargs:build}'
local: bash -c 'export PATH={env:PATH} && {env:SETENV} && ./bootstrap && ./configure --prefix={envdir}/local {env:CONFIGURE_ARGS} && make -k V=0 base-toolchain && SAGE_CHECK=yes SAGE_CHECK_PACKAGES="!cython,!r,!python3,!python2,!nose,!pathpy,!gap,!cysignals,!linbox" make -k V=0 {posargs:build}'

[testenv:check_configure]
## Test that configure behaves properly
Expand Down

0 comments on commit ff04513

Please sign in to comment.