Skip to content

Commit

Permalink
Move interpreter constraints to Docker env entry
Browse files Browse the repository at this point in the history
Docker does not pull in external env vars. Instead, we must specify this in the Dockerfile.

This change has added benefit that it moves all of the Py2 logic into the Dockerfile out of .travis.yml, and leaves .travis.yml solely to call the Dockerfile.
  • Loading branch information
Eric-Arellano committed Feb 26, 2019
1 parent b9efbf0 commit f810849
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,6 @@ py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2
name: "Build wheels - Linux and cp27m (UCS2)"
env:
- *base_build_wheels_env
# While we install 2.7.15 with UCS2, the Centos6 image already has 2.7.13 (UCS4). To disambiguate
# what `python2` resolves to and ensure we always use UCS2, we require exactly 2.7.15.
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==2.7.15']"
- CACHE_NAME=linuxwheelsbuild.ucs2
script:
- docker build --rm -t travis_ci_py27_ucs2
Expand Down
3 changes: 2 additions & 1 deletion build-support/docker/travis_ci_py27_ucs2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM pantsbuild/centos6:latest

# Note we use 2.7.15, rather than 2.7.13, as the centos6 image already comes with 2.7.13
# installed, which uses UCS4 instead of UCS2. We pair this change with setting
# PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS to exactly 2.7.15 in `.travis.yml` to disambiguate
# PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS to exactly 2.7.15 to disambiguate
# the two and always choose the UCS2 interpeter.
ARG PYTHON_2_VERSION=2.7.15
RUN yum install sqlite-devel -y
Expand All @@ -21,6 +21,7 @@ RUN /usr/bin/scl enable devtoolset-7 -- bash -c '\
${PYENV_ROOT}/bin/pyenv install ${PYTHON_2_VERSION} \
&& ${PYENV_ROOT}/bin/pyenv global ${PYTHON_2_VERSION}'
ENV PATH "${PYENV_ROOT}/shims:${PATH}"
ENV PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS "['CPython==${PYTHON_2_VERSION}']"

# Setup mount points for the travis ci user & workdir.
VOLUME /travis/home
Expand Down
3 changes: 0 additions & 3 deletions build-support/travis/travis.yml.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@ py27_linux_build_wheels_ucs2: &py27_linux_build_wheels_ucs2
name: "Build wheels - Linux and cp27m (UCS2)"
env:
- *base_build_wheels_env
# While we install 2.7.15 with UCS2, the Centos6 image already has 2.7.13 (UCS4). To disambiguate
# what `python2` resolves to and ensure we always use UCS2, we require exactly 2.7.15.
- PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS="['CPython==2.7.15']"
- CACHE_NAME=linuxwheelsbuild.ucs2
script:
- docker build --rm -t travis_ci_py27_ucs2
Expand Down

0 comments on commit f810849

Please sign in to comment.