<commit_before># After changing this file, check it on:
#   http://lint.travis-ci.org/
language: python

addons:
  apt:
    packages: &common_packages
    - libatlas-base-dev
    - liblapack-dev
    - gfortran
    - libgmp-dev
    - libmpfr-dev
    - libsuitesparse-dev
    - ccache
    - swig
    - libmpc-dev

env:
  global:
   # Wheelhouse for pre-release wheels
   - PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"
   # Using a single thread can actually speed up some computations on Travis
   - OPENBLAS_NUM_THREADS=1
   - OTHERSPEC=""

matrix:
  include:
    - python: 3.6
      name: "Lint"
      env:
        - PYFLAKES=1
        - PEP8=1
        - NUMPYSPEC="--upgrade numpy"
      before_install:
        - pip install pycodestyle==2.5.0
        - pip install pyflakes==2.1.1
      script:
        # TODO: remove "ignore[import]" filter below when moving to pyflakes==2.1.2 or above
        - PYFLAKES_NODOCTEST=1 pyflakes scipy benchmarks/benchmarks 2>&1 | grep -E -v 'unable to detect undefined names|assigned to but never used|imported but unused|redefinition of unused|may be undefined, or defined from star imports|syntax error in type comment .ignore.import.' > test.out; cat test.out; test \! -s test.out
        - pycodestyle scipy benchmarks/benchmarks
        - tools/lint_diff.py
        - tools/unicode-check.py
    - python: 3.7
      name: "ARM - Test Group 1"
      arch: arm64
      dist: bionic
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - PIP_NO_CACHE_DIR=off
        - NUMPYSPEC="numpy"
        - TEST_GROUP_COUNT=2
        - TEST_GROUP=1
    - python: 3.7
      name: "ARM - Test Group 2"
      arch: arm64
      dist: bionic
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - PIP_NO_CACHE_DIR=off
        - NUMPYSPEC="numpy"
        - TEST_GROUP_COUNT=2
        - TEST_GROUP=2
    - python: 3.7
      name: "Pre-release Dependencies, Source Dist"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="--pre --upgrade --timeout=60 -i $PRE_WHEELS numpy"
        - OTHERSPEC="--pre --upgrade --timeout=60"
        # Need a test with most recent Python version where we build from an
        # sdist (uses pip build isolation), to check that the version we
        # specify in pyproject.toml (will be older than --pre --upgrade) works
        - USE_SDIST=1
    - python: 3.7
      name: "Coverage, Full test suite"
      env:
        - TESTMODE=full
        - COVERAGE="--coverage --gcov"
        - NUMPYSPEC="numpy==1.15.4"
    # Test SciPy with the debug version of Python.
    # However travis only specifies regular or development builds of Python
    # so we must install python3.6-dbg using apt.
    - language: generic
      name: "Python 3.7 Debug"
      dist: bionic
      env:
        - USE_DEBUG=python3.7-dbg
        - TESTMODE=fast
        - NUMPYSPEC="--upgrade numpy"
      addons:
        apt:
          packages:
            - *common_packages
            - python3.7-dbg
            - python3.7-dev
    - python: 3.8
      name: "Pre-release Deps, 64-bit BLAS"
      env:
        - TESTMODE=full
        - NUMPYSPEC="--pre --upgrade --timeout=60 -i $PRE_WHEELS numpy"
        - OTHERSPEC="--pre --upgrade --timeout=60"
        - NPY_USE_BLAS_ILP64=1
    - python: 3.6
      name: "Refguide-check, Latest NumPy"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - REFGUIDE_CHECK=1
        - NUMPYSPEC="--upgrade numpy"
        - ASV_CHECK=1
    - python: 3.6
      name: "Source Distribution"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="numpy==1.17.4"
        - USE_SDIST=1
    - python: 3.6
      name: "Wheel, Optimised"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - NUMPYSPEC="numpy==1.14.6"
        # The following is needed for optimized "-OO" test run but since we use
        # pytest-xdist plugin for load scheduling its workers don't pick up the
        # flag. This environment variable starts all Py instances in -OO mode.
        - PYTHONOPTIMIZE=2
    - python: 3.6
      name: "Power PC"
      os: linux
      arch: ppc64le
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="--upgrade numpy --no-cache-dir"

cache:
  directories:
    - $HOME/.ccache
    - $HOME/.cache/pip
    - $HOME/Library/Caches/pip


before_install:
  - echo $TRAVIS_OS_NAME
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      free -m
      export PATH=/usr/lib/ccache:$PATH
      ccache --zero-stats
    fi
  - |
    if [[ "$NPY_USE_BLAS_ILP64" == "1" ]]; then
      target=$(python tools/openblas_support.py)
      echo "[openblas64_]" > site.cfg
      echo "library_dirs = $target/lib" >> site.cfg
      echo "include_dirs = $target/include" >> site.cfg
      echo "runtime_library_dirs = $target/lib" >> site.cfg
    fi
  - export CCACHE_COMPRESS=1
  - python --version # just to check
  - export NPY_NUM_BUILD_JOBS=2
  - uname -a
  - df -h
  - ulimit -a
  - set -o pipefail
  - if [[ "${TRAVIS_CPU_ARCH}" == "arm64" ]]; then
      wget -q "https://github.com/conda-forge/miniforge/releases/download/4.8.2-1/Miniforge3-4.8.2-1-Linux-aarch64.sh"  -O miniconda.sh;
      chmod +x miniconda.sh;
      ./miniconda.sh -b -p $HOME/miniconda3;
      export PATH=$HOME/miniconda3/bin:$PATH;
      conda config --set always_yes yes --set auto_update_conda false;
      conda install pip conda;
      conda update -n base conda;
      conda info -a;
      conda install pytest pytest-xdist $NUMPYSPEC mpmath gmpy2 Cython pybind11;
    fi
  - mkdir builds
  - cd builds
  - |
    if [ -n "${USE_DEBUG}" ]; then
        # Work in our own virtualenv to isolate from travis-ci packages.
        virtualenv --python=$USE_DEBUG venv
        source venv/bin/activate
    fi
  - python -V -V
  - python -c 'import sys; print("Python debug build:", hasattr(sys, "gettotalrefcount"))'
  # arm64 build uses conda (there aren't any arm64 wheels on PyPI, need
  # Miniforge / conda-forge), so skip arm64 here
  - |
    if [[ "$TRAVIS_CPU_ARCH" != "arm64" ]]; then
         travis_retry pip install --upgrade pip setuptools wheel $OTHERSPEC cython pytest pytest-xdist mpmath argparse gmpy2 pybind11
         travis_retry pip install --upgrade $NUMPYSPEC
    fi
  - |
    if [ -n "${USE_DEBUG}" ]; then
        # see gh-10676; need to pin pytest version with debug
        # Python 3.6
        travis_retry pip install pytest
    fi
  - |
    if [ -z "${USE_DEBUG}" -a "${TRAVIS_CPU_ARCH}" == "amd64" -a "${TRAVIS_PYTHON_VERSION}" != "3.8" ]; then
        if ! expr "$NUMPYSPEC" : ".*--pre.*" > /dev/null; then
            # Install these only when not using Numpy prerelease
            travis_retry pip install numba==0.49.1
            travis_retry pip install --only-binary=:all: sparse
        fi
    fi
  - |
    if [ -n "${TEST_GROUP_COUNT}" ]; then
        travis_retry pip install pytest-test-groups
        export TEST_GROUP_ARGS="--test-group-count=${TEST_GROUP_COUNT} --test-group=${TEST_GROUP} --test-group-random-seed=1234"
    fi
  - |
    if [ "${TESTMODE}" == "full" ]; then
        travis_retry pip install matplotlib scikit-umfpack scikit-sparse
    fi
  - |
    if [ -n "${COVERAGE}" ]; then
        travis_retry pip install pytest-cov coverage codecov
    fi
  - |
    if [ "${REFGUIDE_CHECK}" == "1" ]; then
        travis_retry pip install matplotlib Sphinx==1.7.2
    fi
  - |
    if [ "${ASV_CHECK}" == "1" ]; then
        travis_retry pip install "asv>=0.4.1"
    fi
  - |
    if [ "${TRAVIS_CPU_ARCH}" != "arm64" ]; then
         pip uninstall -y nose
    fi
  - ccache -s
  - cd ..


script:
  - python -c 'import numpy as np; print("relaxed strides checking:", np.ones((10,1),order="C").flags.f_contiguous)'
  # Make sure that relaxed strides checking is actually in effect; otherwise fail loudly
  - if [ "$NPY_RELAXED_STRIDES_CHECKING" == "1" ]; then python -c'import numpy as np; assert np.ones((10,1),order="C").flags.f_contiguous'; fi
  # Test that mpmath actually uses gmpy2
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python -c 'import mpmath.libmp; assert mpmath.libmp.BACKEND == "gmpy"'; fi
  - |
    if [ "${USE_WHEEL}" == "1" ]; then
        # Run setup.py build before pip wheel, to build in current directory
        # and make more efficient use of ccache
        echo "setup.py build"
        python tools/suppress_output.py python setup.py build
        echo "pip wheel"
        python tools/suppress_output.py pip wheel --no-build-isolation .
        pip install --no-cache-dir scipy*.whl
        USE_WHEEL_BUILD="--no-build"
    elif [ "${USE_SDIST}" == "1" ]; then
        echo "setup.py sdist"
        python tools/suppress_output.py python setup.py sdist
        # Move out of source directory to avoid finding local scipy
        cd dist
        echo "pip install"
        # Note: uses build isolation, which is what pip does with sdists by default
        # Note: don't use a fixed build dir (which would help for ccache), because
        #       --build is partially broken and the workaround in commit b4617dd764
        #       messes with build isolation.
        pip install $PWD/scipy* -v
        cd ..
        USE_WHEEL_BUILD="--no-build"
    fi
  - export SCIPY_AVAILABLE_MEM=3G
  - python -u runtests.py -g -j2 --build-only $USE_WHEEL_BUILD
  # Only run tests against pull-requests
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
      python -u runtests.py -g -j2 -m $TESTMODE $COVERAGE $USE_WHEEL_BUILD -- -rfEX --durations=10 $TEST_GROUP_ARGS 2>&1 | tee runtests.log
      tools/validate_runtests_log.py $TESTMODE < runtests.log
    fi
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${REFGUIDE_CHECK}" == "1" ]; then
      python runtests.py -g --refguide-check
    fi
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${ASV_CHECK}" == "1" ]; then
      (cd benchmarks && python -masv check -E existing)
    fi
  # Check dynamic symbol hiding works on Linux
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
      ./tools/check_pyext_symbol_hiding.sh build
    fi


after_script:
  - ccache -s
  # Upload coverage information
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ -n "${COVERAGE}" ]; then
        RUN_DIR=`echo build/testenv/lib/python*/site-packages`
        # Produce gcov output for codecov to find
        find build -name '*.gcno' -type f -exec gcov -pb {} +
        mv *.gcov "$RUN_DIR/"
        # Run codecov
        pushd "$RUN_DIR"
        codecov -X gcov
        popd
    fi


notifications:
  # Perhaps we should have status emails sent to the mailing list, but
  # let's wait to see what people think before turning that on.
  email: false
<commit_msg>CI: Test with plain pip on arm64<commit_after># After changing this file, check it on:
#   http://lint.travis-ci.org/
language: python

addons:
  apt:
    packages: &common_packages
    - libatlas-base-dev
    - liblapack-dev
    - gfortran
    - libgmp-dev
    - libmpfr-dev
    - libsuitesparse-dev
    - ccache
    - swig
    - libmpc-dev

env:
  global:
   # Wheelhouse for pre-release wheels
   - PRE_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"
   # Using a single thread can actually speed up some computations on Travis
   - OPENBLAS_NUM_THREADS=1
   - OTHERSPEC=""

matrix:
  include:
    - python: 3.6
      name: "Lint"
      env:
        - PYFLAKES=1
        - PEP8=1
        - NUMPYSPEC="--upgrade numpy"
      before_install:
        - pip install pycodestyle==2.5.0
        - pip install pyflakes==2.1.1
      script:
        # TODO: remove "ignore[import]" filter below when moving to pyflakes==2.1.2 or above
        - PYFLAKES_NODOCTEST=1 pyflakes scipy benchmarks/benchmarks 2>&1 | grep -E -v 'unable to detect undefined names|assigned to but never used|imported but unused|redefinition of unused|may be undefined, or defined from star imports|syntax error in type comment .ignore.import.' > test.out; cat test.out; test \! -s test.out
        - pycodestyle scipy benchmarks/benchmarks
        - tools/lint_diff.py
        - tools/unicode-check.py
    - python: 3.7
      name: "ARM - Test Group 1"
      arch: arm64
      dist: bionic
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - PIP_NO_CACHE_DIR=off
        - NUMPYSPEC="numpy"
        - TEST_GROUP_COUNT=2
        - TEST_GROUP=1
    - python: 3.7
      name: "ARM - Test Group 2"
      arch: arm64
      dist: bionic
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - PIP_NO_CACHE_DIR=off
        - NUMPYSPEC="numpy"
        - TEST_GROUP_COUNT=2
        - TEST_GROUP=2
    - python: 3.7
      name: "Pre-release Dependencies, Source Dist"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="--pre --upgrade --timeout=60 -i $PRE_WHEELS numpy"
        - OTHERSPEC="--pre --upgrade --timeout=60"
        # Need a test with most recent Python version where we build from an
        # sdist (uses pip build isolation), to check that the version we
        # specify in pyproject.toml (will be older than --pre --upgrade) works
        - USE_SDIST=1
    - python: 3.7
      name: "Coverage, Full test suite"
      env:
        - TESTMODE=full
        - COVERAGE="--coverage --gcov"
        - NUMPYSPEC="numpy==1.15.4"
    # Test SciPy with the debug version of Python.
    # However travis only specifies regular or development builds of Python
    # so we must install python3.6-dbg using apt.
    - language: generic
      name: "Python 3.7 Debug"
      dist: bionic
      env:
        - USE_DEBUG=python3.7-dbg
        - TESTMODE=fast
        - NUMPYSPEC="--upgrade numpy"
      addons:
        apt:
          packages:
            - *common_packages
            - python3.7-dbg
            - python3.7-dev
    - python: 3.8
      name: "Pre-release Deps, 64-bit BLAS"
      env:
        - TESTMODE=full
        - NUMPYSPEC="--pre --upgrade --timeout=60 -i $PRE_WHEELS numpy"
        - OTHERSPEC="--pre --upgrade --timeout=60"
        - NPY_USE_BLAS_ILP64=1
    - python: 3.6
      name: "Refguide-check, Latest NumPy"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - REFGUIDE_CHECK=1
        - NUMPYSPEC="--upgrade numpy"
        - ASV_CHECK=1
    - python: 3.6
      name: "Source Distribution"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="numpy==1.17.4"
        - USE_SDIST=1
    - python: 3.6
      name: "Wheel, Optimised"
      env:
        - TESTMODE=fast
        - COVERAGE=
        - USE_WHEEL=1
        - NUMPYSPEC="numpy==1.14.6"
        # The following is needed for optimized "-OO" test run but since we use
        # pytest-xdist plugin for load scheduling its workers don't pick up the
        # flag. This environment variable starts all Py instances in -OO mode.
        - PYTHONOPTIMIZE=2
    - python: 3.6
      name: "Power PC"
      os: linux
      arch: ppc64le
      env:
        - TESTMODE=fast
        - COVERAGE=
        - NUMPYSPEC="--upgrade numpy --no-cache-dir"

cache:
  directories:
    - $HOME/.ccache
    - $HOME/.cache/pip
    - $HOME/Library/Caches/pip


before_install:
  - echo $TRAVIS_OS_NAME
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      free -m
      export PATH=/usr/lib/ccache:$PATH
      ccache --zero-stats
    fi
  - |
    if [[ "$NPY_USE_BLAS_ILP64" == "1" ]]; then
      target=$(python tools/openblas_support.py)
      echo "[openblas64_]" > site.cfg
      echo "library_dirs = $target/lib" >> site.cfg
      echo "include_dirs = $target/include" >> site.cfg
      echo "runtime_library_dirs = $target/lib" >> site.cfg
    fi
  - export CCACHE_COMPRESS=1
  - python --version # just to check
  - export NPY_NUM_BUILD_JOBS=2
  - uname -a
  - df -h
  - ulimit -a
  - set -o pipefail
  - mkdir builds
  - cd builds
  - |
    if [ -n "${USE_DEBUG}" ]; then
        # Work in our own virtualenv to isolate from travis-ci packages.
        virtualenv --python=$USE_DEBUG venv
        source venv/bin/activate
    fi
  - python -V -V
  - python -c 'import sys; print("Python debug build:", hasattr(sys, "gettotalrefcount"))'
  - |
    travis_retry pip install --upgrade pip setuptools wheel $OTHERSPEC cython pytest pytest-xdist mpmath argparse gmpy2 pybind11
    travis_retry pip install --upgrade $NUMPYSPEC
  - |
    if [ -n "${USE_DEBUG}" ]; then
        # see gh-10676; need to pin pytest version with debug
        # Python 3.6
        travis_retry pip install pytest
    fi
  - |
    if [ -z "${USE_DEBUG}" -a "${TRAVIS_CPU_ARCH}" == "amd64" -a "${TRAVIS_PYTHON_VERSION}" != "3.8" ]; then
        if ! expr "$NUMPYSPEC" : ".*--pre.*" > /dev/null; then
            # Install these only when not using Numpy prerelease
            travis_retry pip install numba==0.49.1
            travis_retry pip install --only-binary=:all: sparse
        fi
    fi
  - |
    if [ -n "${TEST_GROUP_COUNT}" ]; then
        travis_retry pip install pytest-test-groups
        export TEST_GROUP_ARGS="--test-group-count=${TEST_GROUP_COUNT} --test-group=${TEST_GROUP} --test-group-random-seed=1234"
    fi
  - |
    if [ "${TESTMODE}" == "full" ]; then
        travis_retry pip install matplotlib scikit-umfpack scikit-sparse
    fi
  - |
    if [ -n "${COVERAGE}" ]; then
        travis_retry pip install pytest-cov coverage codecov
    fi
  - |
    if [ "${REFGUIDE_CHECK}" == "1" ]; then
        travis_retry pip install matplotlib Sphinx==1.7.2
    fi
  - |
    if [ "${ASV_CHECK}" == "1" ]; then
        travis_retry pip install "asv>=0.4.1"
    fi
  - pip uninstall -y nose
  - ccache -s
  - cd ..


script:
  - python -c 'import numpy as np; print("relaxed strides checking:", np.ones((10,1),order="C").flags.f_contiguous)'
  # Make sure that relaxed strides checking is actually in effect; otherwise fail loudly
  - if [ "$NPY_RELAXED_STRIDES_CHECKING" == "1" ]; then python -c'import numpy as np; assert np.ones((10,1),order="C").flags.f_contiguous'; fi
  # Test that mpmath actually uses gmpy2
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python -c 'import mpmath.libmp; assert mpmath.libmp.BACKEND == "gmpy"'; fi
  - |
    if [ "${USE_WHEEL}" == "1" ]; then
        # Run setup.py build before pip wheel, to build in current directory
        # and make more efficient use of ccache
        echo "setup.py build"
        python tools/suppress_output.py python setup.py build
        echo "pip wheel"
        python tools/suppress_output.py pip wheel --no-build-isolation .
        pip install --no-cache-dir scipy*.whl
        USE_WHEEL_BUILD="--no-build"
    elif [ "${USE_SDIST}" == "1" ]; then
        echo "setup.py sdist"
        python tools/suppress_output.py python setup.py sdist
        # Move out of source directory to avoid finding local scipy
        cd dist
        echo "pip install"
        # Note: uses build isolation, which is what pip does with sdists by default
        # Note: don't use a fixed build dir (which would help for ccache), because
        #       --build is partially broken and the workaround in commit b4617dd764
        #       messes with build isolation.
        pip install $PWD/scipy* -v
        cd ..
        USE_WHEEL_BUILD="--no-build"
    fi
  - export SCIPY_AVAILABLE_MEM=3G
  - python -u runtests.py -g -j2 --build-only $USE_WHEEL_BUILD
  # Only run tests against pull-requests
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
      python -u runtests.py -g -j2 -m $TESTMODE $COVERAGE $USE_WHEEL_BUILD -- -rfEX --durations=10 $TEST_GROUP_ARGS 2>&1 | tee runtests.log
      tools/validate_runtests_log.py $TESTMODE < runtests.log
    fi
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${REFGUIDE_CHECK}" == "1" ]; then
      python runtests.py -g --refguide-check
    fi
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "${ASV_CHECK}" == "1" ]; then
      (cd benchmarks && python -masv check -E existing)
    fi
  # Check dynamic symbol hiding works on Linux
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
      ./tools/check_pyext_symbol_hiding.sh build
    fi


after_script:
  - ccache -s
  # Upload coverage information
  - |
    if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ -n "${COVERAGE}" ]; then
        RUN_DIR=`echo build/testenv/lib/python*/site-packages`
        # Produce gcov output for codecov to find
        find build -name '*.gcno' -type f -exec gcov -pb {} +
        mv *.gcov "$RUN_DIR/"
        # Run codecov
        pushd "$RUN_DIR"
        codecov -X gcov
        popd
    fi


notifications:
  # Perhaps we should have status emails sent to the mailing list, but
  # let's wait to see what people think before turning that on.
  email: false

{'fraction_non_alphanumeric': 0.1181276432141484, 'fraction_numerical': 0.016339869281045753, 'mean_word_length': 2.1211939403029847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '283787', 'n_tokens_mistral': 7341, 'n_tokens_neox': 7090, 'n_words': 1920}