Copy of CI from master to 2020
[gromacs.git] / admin / ci-scripts / build-and-test-py-gmxapi-0.1.sh
blob9c405de8d7a814c04141030dd6a92e827caae030
1 #!/usr/bin/env bash
3 # Build, install, and test the gmxapi 0.1.x Python package distributed with
4 # GROMACS 2020.
6 # It is assumed that this script is run in an activated Python venv with the
7 # gmxapi dependencies already installed, with `python` resolvable by the shell
8 # to the appropriate Python interpreter.
10 # This script is intended to support automated GROMACS testing infrastructure,
11 # and may be removed without notice.
13 # WARNING: This script assumes OpenMPI mpiexec. Syntax for launch wrappers from
14 # other implementations will need different syntax, and we should get a
15 # MPIRUNNER from the environment, or something.
17 # Make sure the script errors if any commands error.
18 set -ev
20 # Create "sdist" source distribution archive.
21 pushd python_packaging/src
22 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
23 python setup.py sdist
24 # TODO: Identify SDIST
26 # Build and install from sdist.
27 GMXTOOLCHAINDIR=$INSTALL_DIR/share/cmake/gromacs \
28 python -m pip install \
29 --no-cache-dir \
30 --no-deps \
31 --no-index \
32 --no-build-isolation \
33 dist/gmxapi*
34 # TODO: Build and install from $SDIST instead of wildcard.
35 popd
37 # Run Python unit tests.
38 python -m pytest $PWD/python_packaging/src/test --junitxml=$PY_UNIT_TEST_XML
39 # TODO: enable MPI tests
40 #if [ -x `which mpiexec` ]; then
41 # PYTHONDONTWRITEBYTECODE=1 \
42 # mpiexec --allow-run-as-root \
43 # --mca opal_warn_on_missing_libcuda 0 \
44 # --mca orte_base_help_aggregate 0 \
45 # -n 2 \
46 # `which python` -m pytest \
47 # -p no:cacheprovider \
48 # $PWD/python_packaging/src/test \
49 # --junitxml=$PY_MPI_UNIT_TEST_XML
50 #fi
52 # Run Python acceptance tests.
53 python -m pytest $PWD/python_packaging/test --junitxml=$PY_ACCEPTANCE_TEST_XML
54 # TODO: enable MPI tests
55 #if [ -x `which mpiexec` ]; then
56 # PYTHONDONTWRITEBYTECODE=1 \
57 # mpiexec --allow-run-as-root \
58 # --mca opal_warn_on_missing_libcuda 0 \
59 # --mca orte_base_help_aggregate 0 \
60 # -n 2 \
61 # `which python` -m pytest \
62 # -p no:cacheprovider \
63 # $PWD/python_packaging/test \
64 # --junitxml=$PY_MPI_ACCEPTANCE_TEST_XML
65 #fi