Skip to content

Commit

Permalink
No longer release a Python 2 wheel or PEX (pantsbuild#7888)
Browse files Browse the repository at this point in the history
We will now require Python 3 to run Pants for new releases (1.18.x or greater), per https://groups.google.com/forum/#!topic/pants-devel/-bMRstFtMZU.

Here, we remove Python 2 from all release related code, including:

* Remove Python 2 wheel building shards.
* Remove Python 2 UCS 4 Docker image.
* Remove `-2` and `--py2` logic from `release.sh` and `packages.py`.
* Remove documentation claiming support for running with Python 2.7.
  • Loading branch information
Eric-Arellano authored Jun 21, 2019
1 parent df7ac26 commit 4830e7b
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 466 deletions.
192 changes: 33 additions & 159 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,24 +354,24 @@ base_linux_build_engine: &base_linux_build_engine
<<: *native_engine_cache_config
<<: *travis_docker_image
stage: *bootstrap
# Callers of this anchor are expected to provide values in their `env` for
# `docker_image_name` and `docker_run_command` (i.e. the bash command(s) to run).
# Callers of this anchor are expected to provide a value in their `env` for `docker_run_command`
# (i.e. the bash command(s) to run).
script:
- >
docker build
--rm -t "${docker_image_name}"
--rm -t travis_ci
--build-arg "BASE_IMAGE=pantsbuild/centos${docker_centos_version:-6}:latest"
--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/${docker_image_name}/
build-support/docker/travis_ci/
- >
docker run
--rm -t
-v "${HOME}:/travis/home"
-v "${TRAVIS_BUILD_DIR}:/travis/workdir"
${docker_image_name}:latest
travis_ci:latest
sh -c "${docker_run_command}"
- *aws_deploy_pants_pex

Expand All @@ -380,7 +380,6 @@ py27_linux_build_engine: &py27_linux_build_engine
<<: *base_linux_build_engine
name: "Build Linux native engine and pants.pex (Py2.7 PEX)"
env:
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/ci.py --bootstrap --python-version 2.7"
- CACHE_NAME=linuxpexbuild.py27
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py27.linux
Expand All @@ -390,7 +389,6 @@ py36_linux_build_engine: &py36_linux_build_engine
<<: *base_linux_build_engine
name: "Build Linux native engine and pants.pex (Py3.6 PEX)"
env:
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/ci.py --bootstrap && ./build-support/bin/release.sh -f"
- PREPARE_DEPLOY=1
- CACHE_NAME=linuxpexbuild.py36
Expand All @@ -403,7 +401,6 @@ py37_linux_build_engine: &py37_linux_build_engine
name: "Build Linux native engine and pants.pex (Py3.7 PEX)"
env:
- docker_centos_version=7
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/ci.py --bootstrap --python-version 3.7"
- CACHE_NAME=linuxpexbuild.py37
- BOOTSTRAPPED_PEX_KEY_SUFFIX=py37.linux
Expand Down Expand Up @@ -522,128 +519,44 @@ cargo_audit: &cargo_audit
# Build wheels
# -------------------------------------------------------------------------

# N.B. With Python 2, we must build pantsbuild.pants with both UCS2 and UCS4 to provide full
# compatibility for end users. This is because we constrain our ABI due to the native engine.
# See https://www.python.org/dev/peps/pep-0513/#ucs-2-vs-ucs-4-builds. Note this distinction is
# not necessary with Python 3.3+ due to flexible storage of Unicode strings (https://www.python.org/dev/peps/pep-0393/).
#
# We treat both Linux UCS4 and OSX UCS2 normally, as these are the defaults for those environments.
# The Linux UCS2 and OSX UCS4 shards, however, must rebuild Python with
# `PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs{2,4}` set, along with bootstrapping Pants again rather
# than pulling the PEX from AWS.

base_build_wheels: &base_build_wheels
stage: *test
env:
- &base_build_wheels_env PREPARE_DEPLOY=1

base_linux_build_wheels: &base_linux_build_wheels
# Similar to the bootstrap shard, we build Linux wheels in a docker image to maximize compatibility.
py36_linux_build_wheels: &py36_linux_build_wheels
<<: *travis_docker_image
<<: *base_build_wheels
# Callers of this anchor are expected to provide values in their `env` for
# `docker_image_name` and `docker_run_command` (i.e. the bash command(s) to run).
<<: *py36_linux_test_config
name: "Build wheels - Linux and abi3 (Py3.6+)"
env:
- *py36_linux_test_config_env
- *base_build_wheels_env
- docker_run_command="./build-support/bin/check_pants_pex_abi.py abi3 cp36m
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -n"
- CACHE_NAME=linuxwheelsbuild.abi3
script:
- >
docker build
--rm -t "${docker_image_name}"
--rm -t travis_ci
--build-arg "BASE_IMAGE=pantsbuild/centos${docker_centos_version:-6}:latest"
--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/${docker_image_name}/
build-support/docker/travis_ci/
- >
docker run
--rm -t
-v "${HOME}:/travis/home"
-v "${TRAVIS_BUILD_DIR}:/travis/workdir"
${docker_image_name}:latest
travis_ci:latest
sh -c "${docker_run_command}"
py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2
<<: *py27_linux_config
<<: *base_linux_build_wheels
<<: *native_engine_cache_config
name: "Build wheels - Linux and cp27m (UCS2)"
env:
- *base_build_wheels_env
- docker_image_name=travis_ci_py27_ucs2
- docker_run_command="./build-support/bin/ci.py --bootstrap --python-version 2.7
&& ./build-support/bin/check_pants_pex_abi.py cp27m
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n"
- CACHE_NAME=linuxwheelsbuild.ucs2

py27_linux_build_wheels_ucs4: &py27_linux_build_wheels_ucs4
<<: *base_linux_build_wheels
<<: *py27_linux_test_config
# `py27_linux_test_config` overrides the stage set by `base_build_wheels`, so we re-override it.
stage: *test
name: "Build wheels - Linux and cp27mu (UCS4)"
env:
- *py27_linux_test_config_env
- *base_build_wheels_env
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/check_pants_pex_abi.py cp27mu
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n"
- CACHE_NAME=linuxwheelsbuild.ucs4

py36_linux_build_wheels: &py36_linux_build_wheels
<<: *base_linux_build_wheels
<<: *py36_linux_test_config
name: "Build wheels - Linux and abi3 (Py3.6+)"
env:
- *py36_linux_test_config_env
- *base_build_wheels_env
- docker_image_name=travis_ci
- docker_run_command="./build-support/bin/check_pants_pex_abi.py abi3 cp36m
&& RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -n"
- CACHE_NAME=linuxwheelsbuild.abi3

base_osx_build_wheels: &base_osx_build_wheels
<<: *base_build_wheels
osx_image: xcode8

py27_osx_build_wheels_ucs2: &py27_osx_build_wheels_ucs2
<<: *py27_osx_test_config
<<: *base_osx_build_wheels
name: "Build wheels - OSX and cp27m (UCS2)"
env:
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs2
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2
# We ensure selection of the the pyenv interpreter by PY aware scripts and pants.pex with these
# env vars.
- PY=${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin/python
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==${PYENV_PY27_VERSION}']"
script:
- ./build-support/bin/check_pants_pex_abi.py cp27m
- RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n

py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
<<: *py27_osx_config
<<: *base_osx_build_wheels
<<: *native_engine_cache_config
name: "Build wheels - OSX and cp27mu (UCS4)"
env:
- *py27_osx_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
# We ensure selection of the the pyenv interpreter by PY aware scripts and pants.pex with these
# env vars.
- PY=${PYENV_ROOT}/versions/${PYENV_PY27_VERSION}/bin/python
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==${PYENV_PY27_VERSION}']"
script:
- ./build-support/bin/ci.py --bootstrap --python-version 2.7
- ./build-support/bin/check_pants_pex_abi.py cp27mu
- RUN_PANTS_FROM_PEX=1 ./build-support/bin/release.sh -2n

py36_osx_build_wheels: &py36_osx_build_wheels
<<: *py36_osx_test_config
<<: *base_osx_build_wheels
name: "Build wheels - OSX and abi3 (Py3.6+)"
osx_image: xcode8
env:
- *py36_osx_test_config_env
- *base_build_wheels_env
Expand Down Expand Up @@ -844,22 +757,24 @@ base_deploy: &base_deploy
dist: trusty
language: python
python:
- "2.7"
- "3.6"
before_install:
# TODO(John Sirois): Get rid of this in favor of explicitly adding pyenv versions to the PATH:
# https://github.com/pantsbuild/pants/issues/7601
- pyenv global 2.7.14 3.6.3
- pyenv global 3.6.3
env:
- &base_deploy_env RUN_PANTS_FROM_PEX=1

base_deploy_stable_muliplatform_pex: &base_deploy_stable_muliplatform_pex
py36_deploy_stable_pex: &py36_deploy_stable_pex
<<: *base_deploy
name: "Deploy stable pants.pex (Py3.6 PEX)"
stage: *build_stable
env:
- &base_deploy_stable_env PANTS_PEX_RELEASE=stable
- *base_deploy_env
- PANTS_PEX_RELEASE=stable
- CACHE_NAME=linuxpexdeploystable.py36
script:
- ./build-support/bin/release.sh -p ${RELEASE_ARGS}
- ./build-support/bin/release.sh -p
deploy:
# See https://docs.travis-ci.com/user/deployment/releases/
provider: releases
Expand All @@ -874,52 +789,19 @@ base_deploy_stable_muliplatform_pex: &base_deploy_stable_muliplatform_pex
tags: true
repo: pantsbuild/pants

py27_deploy_stable_multiplatform_pex: &py27_deploy_stable_multiplatform_pex
<<: *base_deploy_stable_muliplatform_pex
name: "Deploy stable multiplatform pants.pex (Py2.7 PEX)"
env:
- *base_deploy_env
- *base_deploy_stable_env
- RELEASE_ARGS="-2"
- CACHE_NAME=linuxpexdeploystable.py27

py36_deploy_stable_multiplatform_pex: &py36_deploy_stable_multiplatform_pex
<<: *base_deploy_stable_muliplatform_pex
name: "Deploy stable multiplatform pants.pex (Py3.6 PEX)"
env:
- *base_deploy_env
- *base_deploy_stable_env
- RELEASE_ARGS=""
- CACHE_NAME=linuxpexdeploystable.py36

base_deploy_unstable_multiplatform_pex: &base_deploy_unstable_multiplatform_pex
py36_deploy_unstable_pex: &py36_deploy_unstable_pex
<<: *base_deploy
name: "Deploy unstable pants.pex (Py3.6 PEX)"
stage: *build_unstable
env:
- &base_deploy_unstable_env PREPARE_DEPLOY=1
- *base_deploy_env
- PREPARE_DEPLOY=1
- CACHE_NAME=linuxpexdeployunstable.py36
script:
- ./build-support/bin/release.sh -p ${RELEASE_ARGS}
- ./build-support/bin/release.sh -p
- mkdir -p dist/deploy/pex/
- mv dist/pants*.pex dist/deploy/pex/

py27_deploy_unstable_multiplatform_pex: &py27_deploy_unstable_multiplatform_pex
<<: *base_deploy_unstable_multiplatform_pex
name: "Deploy unstable multiplatform pants.pex (Py2.7 PEX)"
env:
- *base_deploy_env
- *base_deploy_unstable_env
- RELEASE_ARGS="-2"
- CACHE_NAME=linuxpexdeployunstable.py27

py36_deploy_unstable_multiplatform_pex: &py36_deploy_unstable_multiplatform_pex
<<: *base_deploy_unstable_multiplatform_pex
name: "Deploy unstable multiplatform pants.pex (Py3.6 PEX)"
env:
- *base_deploy_env
- *base_deploy_unstable_env
- RELEASE_ARGS=""
- CACHE_NAME=linuxpexdeployunstable.py36

# -------------------------------------------------------------------------
# Test matrix
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -1002,12 +884,7 @@ matrix:
- ./build-support/bin/ci.py --plugin-tests --python-version 3.7
- ./build-support/bin/ci.py --python-tests-v1 --python-version 3.7

- <<: *py27_linux_build_wheels_ucs2
- <<: *py27_linux_build_wheels_ucs4
- <<: *py36_linux_build_wheels

- <<: *py27_osx_build_wheels_ucs2
- <<: *py27_osx_build_wheels_ucs4
- <<: *py36_osx_build_wheels

- <<: *py36_linux_test_config
Expand Down Expand Up @@ -1910,11 +1787,8 @@ matrix:
- <<: *py36_jvm_tests
- <<: *py37_jvm_tests

- <<: *py27_deploy_stable_multiplatform_pex
- <<: *py36_deploy_stable_multiplatform_pex

- <<: *py27_deploy_unstable_multiplatform_pex
- <<: *py36_deploy_unstable_multiplatform_pex
- <<: *py36_deploy_stable_pex
- <<: *py36_deploy_unstable_pex

deploy:
provider: script
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We use [Coveralls](https://coveralls.io) to monitor test coverage
At a minimum, Pants requires the following to run properly:

* Linux or macOS.
* Python 2.7 or 3.6.
* Python 3.6+.
* A C compiler, system headers, Python headers (to compile native Python modules) and the libffi
library and headers (to compile and link modules that use CFFI to access native code).
* Internet access (so that Pants can fully bootstrap itself)
Expand Down
Loading

0 comments on commit 4830e7b

Please sign in to comment.