Skip to content
  • David L. Jones's avatar
    Change Python kokoro configs to test only their specified version. (#7927) · b774da0d
    David L. Jones authored
    Using non-versioned scripts for `build_file` means every Python version is
    tested (under Tox), and this is multiplied by each Python version running Tox.
    
    For example, when the `python38` config is used to run Tox, the
    Tox layer runs on Python 3.8. This then tests all of the Python versions
    individually, including, for example, python27 tests.
    
    This change fixes the `build_file` paths to point to the same-pathed build
    script. For example, `kokoro/linux/python27/presubmit.cfg` now uses
    `kokoro/linux/python27/build.sh`.
    
    Some additional fixes:
    
    *  Use `python -m tox` in tests.sh instead of just `tox`. This helps non-site
       installations of tox, where the `tox` script may not be on `$PATH`.
    *  Ensure tox (and other Python build-related packages) are available in
       Python testing images. (New images have been pushed.)
    *  Disable `--warnings_as_errors` due to deprecated function.
    *  Remove apt lists per [Docker best practices][1].
    
    [1]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
    b774da0d