Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.8 to CI #11023

Merged
merged 9 commits into from
Jan 13, 2021
Merged
276 changes: 276 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,61 @@ jobs:
services:
- docker
stage: Bootstrap Pants
- addons:
apt:
packages:
- lib32stdc++6
- lib32z1
- lib32z1-dev
- gcc-multilib
- python-dev
- openssl
- libssl-dev
- jq
- unzip
- shellcheck
after_failure:
- ./build-support/bin/ci-failure.sh
before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- find build-support -name "*.py[co]" -delete
- ./build-support/bin/prune_travis_cache.sh
before_install:
- ./build-support/bin/install_aws_cli_for_ci.sh
- pyenv global 2.7.17 3.6.10 3.7.6 3.8.1
cache:
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT_OSX}
- ${HOME}/.rustup
- ${HOME}/.cargo
- build-support/virtualenvs
- src/rust/engine/target
timeout: 500
dist: bionic
env:
- CACHE_NAME=bootstrap.linux.py38
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.linux
language: python
name: Build Linux native engine and pants.pex (Python 3.8)
os: linux
python:
- '2.7'
- '3.6'
- '3.7'
script:
- docker build --rm -t travis_ci --build-arg "TRAVIS_USER=$(id -un)" --build-arg
"TRAVIS_UID=$(id -u)" --build-arg "TRAVIS_GROUP=$(id -gn)" --build-arg "TRAVIS_GID=$(id
-g)" build-support/docker/travis_ci/
- docker run --rm -t -v "${HOME}:/travis/home" -v "${TRAVIS_BUILD_DIR}:/travis/workdir"
travis_ci:latest sh -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
| sh -s -- -y --default-toolchain none && source /travis/home/.cargo/env &&
./build-support/bin/bootstrap_and_deploy_ci_pants_pex.py --python-version 3.8
--aws-bucket ${AWS_BUCKET} --native-engine-so-key-prefix ${NATIVE_ENGINE_SO_KEY_PREFIX}
--pex-key ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}"
services:
- docker
stage: Bootstrap Pants (Cron)
- after_failure:
- ./build-support/bin/ci-failure.sh
before_cache:
Expand Down Expand Up @@ -131,6 +186,50 @@ jobs:
--aws-bucket ${AWS_BUCKET} --native-engine-so-key-prefix ${NATIVE_ENGINE_SO_KEY_PREFIX}
--pex-key ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
stage: Bootstrap Pants
- after_failure:
- ./build-support/bin/ci-failure.sh
before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- find build-support -name "*.py[co]" -delete
- ./build-support/bin/prune_travis_cache.sh
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh ${MACOS_PYENV_PY27_VERSION} ${MACOS_PYENV_PY38_VERSION}
before_script:
- ulimit -n 8192
cache:
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT_OSX}
- ${HOME}/.rustup
- ${HOME}/.cargo
- build-support/virtualenvs
- src/rust/engine/target
timeout: 500
env:
- PATH="/usr/local/opt/openssl/bin:${PATH}"
- LDFLAGS="-L/usr/local/opt/openssl/lib"
- CPPFLAGS="-I/usr/local/opt/openssl/include"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY27_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY37_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY38_VERSION}/bin:${PATH}"
- CACHE_NAME=bootstrap.osx.py38
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.osx
language: generic
name: Build macOS native engine and pants.pex (Python 3.8)
os: osx
osx_image: xcode8
script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain
none
- source ${HOME}/.cargo/env
- ./build-support/bin/bootstrap_and_deploy_ci_pants_pex.py --python-version 3.8
--aws-bucket ${AWS_BUCKET} --native-engine-so-key-prefix ${NATIVE_ENGINE_SO_KEY_PREFIX}
--pex-key ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
stage: Bootstrap Pants (Cron)
- addons:
apt:
packages:
Expand Down Expand Up @@ -183,6 +282,58 @@ jobs:
- travis-wait-enhanced --timeout 50m --interval 9m -- ./build-support/bin/ci.py
--githooks --smoke-tests --lint --python-version 3.7
stage: Test Pants
- addons:
apt:
packages:
- lib32stdc++6
- lib32z1
- lib32z1-dev
- gcc-multilib
- python-dev
- openssl
- libssl-dev
- jq
- unzip
- shellcheck
after_failure:
- ./build-support/bin/ci-failure.sh
before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- rm -rf "${HOME}/.cargo/registry/src"
- du -m -d2 ${HOME}/.cache/pants | sort -r -n
- ./build-support/bin/prune_travis_cache.sh
before_install:
- sudo sysctl fs.inotify.max_user_watches=524288
- ./build-support/bin/install_aws_cli_for_ci.sh
- pyenv global 2.7.17 3.6.10 3.7.6 3.8.1
- wget -qO- "https://github.com/crazy-max/travis-wait-enhanced/releases/download/v0.2.1/travis-wait-enhanced_0.2.1_linux_x86_64.tar.gz"
| tar -zxvf - travis-wait-enhanced
- mv travis-wait-enhanced /home/travis/bin/
before_script:
- ./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${AWS_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
cache:
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT_OSX}
timeout: 500
dist: bionic
env:
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.linux
- CACHE_NAME=lint.py38
language: python
name: Self-checks and lint (Python 3.8)
os: linux
python:
- '2.7'
- '3.6'
- '3.7'
script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain
none
- source ${HOME}/.cargo/env
- travis-wait-enhanced --timeout 50m --interval 9m -- ./build-support/bin/ci.py
--githooks --smoke-tests --lint --python-version 3.8
stage: Test Pants (Cron)
- before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- find build-support -name "*.py[co]" -delete
Expand Down Expand Up @@ -303,6 +454,57 @@ jobs:
- travis-wait-enhanced --timeout 65m --interval 9m -- ./build-support/bin/ci.py
--unit-tests --integration-tests --python-version 3.7
stage: Test Pants
- addons:
apt:
packages:
- lib32stdc++6
- lib32z1
- lib32z1-dev
- gcc-multilib
- python-dev
- openssl
- libssl-dev
- jq
- unzip
- shellcheck
after_failure:
- ./build-support/bin/ci-failure.sh
after_success:
- ./build-support/bin/upload_coverage.sh
before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- rm -rf "${HOME}/.cargo/registry/src"
- du -m -d2 ${HOME}/.cache/pants | sort -r -n
- ./build-support/bin/prune_travis_cache.sh
before_install:
- sudo sysctl fs.inotify.max_user_watches=524288
- ./build-support/bin/install_aws_cli_for_ci.sh
- pyenv global 2.7.17 3.6.10 3.7.6 3.8.1
- wget -qO- "https://github.com/crazy-max/travis-wait-enhanced/releases/download/v0.2.1/travis-wait-enhanced_0.2.1_linux_x86_64.tar.gz"
| tar -zxvf - travis-wait-enhanced
- mv travis-wait-enhanced /home/travis/bin/
before_script:
- ./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${AWS_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
cache:
directories:
- ${AWS_CLI_ROOT}
- ${PYENV_ROOT_OSX}
timeout: 500
dist: bionic
env:
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.linux
- CACHE_NAME=python_tests.py38
language: python
name: Python tests (Python 3.8)
os: linux
python:
- '2.7'
- '3.6'
- '3.7'
script:
- travis-wait-enhanced --timeout 65m --interval 9m -- ./build-support/bin/ci.py
--unit-tests --integration-tests --python-version 3.8
stage: Test Pants (Cron)
- before_cache:
- sudo chown -R travis:travis "${HOME}" "${TRAVIS_BUILD_DIR}"
- find build-support -name "*.py[co]" -delete
Expand Down Expand Up @@ -503,6 +705,30 @@ jobs:
script:
- ./build-support/bin/ci.py --platform-specific-tests --python-version 3.7
stage: Test Pants
- before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh ${MACOS_PYENV_PY27_VERSION} ${MACOS_PYENV_PY38_VERSION}
before_script:
- ulimit -n 8192
- ./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${AWS_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
env:
- PATH="/usr/local/opt/openssl/bin:${PATH}"
- LDFLAGS="-L/usr/local/opt/openssl/lib"
- CPPFLAGS="-I/usr/local/opt/openssl/include"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY27_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY37_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY38_VERSION}/bin:${PATH}"
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.osx
- CACHE_NAME=osx_platform_tests.py38
language: generic
name: macOS platform-specific tests (Python 3.8)
os: osx
script:
- ./build-support/bin/ci.py --platform-specific-tests --python-version 3.8
stage: Test Pants (Cron)
- before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
Expand All @@ -528,6 +754,31 @@ jobs:
script:
- MODE=debug ./build-support/bin/ci.py --smoke-tests --python-version 3.7
stage: Test Pants
- before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh ${MACOS_PYENV_PY27_VERSION} ${MACOS_PYENV_PY38_VERSION}
before_script:
- ulimit -n 8192
- ./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${AWS_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
env:
- PATH="/usr/local/opt/openssl/bin:${PATH}"
- LDFLAGS="-L/usr/local/opt/openssl/lib"
- CPPFLAGS="-I/usr/local/opt/openssl/include"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY27_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY37_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY38_VERSION}/bin:${PATH}"
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.osx
- CACHE_NAME=osx_smoke_tests.10_12.py38
language: generic
name: macOS 10.12 smoke test (Python 3.8)
os: osx
osx_image: xcode9.2
script:
- MODE=debug ./build-support/bin/ci.py --smoke-tests --python-version 3.8
stage: Test Pants (Cron)
- before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
Expand All @@ -553,6 +804,31 @@ jobs:
script:
- MODE=debug ./build-support/bin/ci.py --smoke-tests --python-version 3.7
stage: Test Pants
- before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64
-o /usr/local/bin/jq
- chmod 755 /usr/local/bin/jq
- ./build-support/bin/install_aws_cli_for_ci.sh
- ./build-support/bin/install_python_for_ci.sh ${MACOS_PYENV_PY27_VERSION} ${MACOS_PYENV_PY38_VERSION}
before_script:
- ulimit -n 8192
- ./build-support/bin/get_ci_bootstrapped_pants_pex.sh ${AWS_BUCKET} ${BOOTSTRAPPED_PEX_KEY_PREFIX}.${BOOTSTRAPPED_PEX_KEY_SUFFIX}
env:
- PATH="/usr/local/opt/openssl/bin:${PATH}"
- LDFLAGS="-L/usr/local/opt/openssl/lib"
- CPPFLAGS="-I/usr/local/opt/openssl/include"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY27_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY37_VERSION}/bin:${PATH}"
- PATH="${PYENV_ROOT}/versions/${MACOS_PYENV_PY38_VERSION}/bin:${PATH}"
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py38.osx
- CACHE_NAME=osx_smoke_tests.10_13.py38
language: generic
name: macOS 10.13 smoke test (Python 3.8)
os: osx
osx_image: xcode10.1
script:
- MODE=debug ./build-support/bin/ci.py --smoke-tests --python-version 3.8
stage: Test Pants (Cron)
- addons:
apt:
packages:
Expand Down
1 change: 1 addition & 0 deletions build-support/bin/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def main() -> None:

class PythonVersion(Enum):
py37 = "3.7"
py38 = "3.8"

def __str__(self) -> str:
return str(self.value)
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/generate_travis_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def ignore_aliases(self, data):


def main() -> None:
supported_python_versions = [PythonVersion.py37]
supported_python_versions = [PythonVersion.py37, PythonVersion.py38]
generated_yaml = yaml.dump(
{
# Conditions are documented here: https://docs.travis-ci.com/user/conditions-v1
Expand Down
4 changes: 3 additions & 1 deletion src/python/pants/util/objects_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ class FallbackToObject:
get_docstring(FallbackToObject, fallback_to_ancestors=True, ignored_ancestors=[object])
is None
)
object_docstring = object.__doc__
assert object_docstring is not None
assert (
get_docstring(FallbackToObject, fallback_to_ancestors=True, ignored_ancestors=[])
== object.__doc__
== object_docstring.rstrip()
)