Skip to content
Permalink
Browse files

Also deduplicate Pyenv env vars for OSX

Realized this is a better design while working on pantsbuild#7261.
  • Loading branch information...
Eric-Arellano committed Feb 19, 2019
1 parent ad45b2d commit dc36d945da8b5f32010866b073205a41b3cd88e2
@@ -170,11 +170,8 @@ py36_osx_config: &py36_osx_config
packages: &py36_osx_config_brew_packages
- openssl
env:
# Fix Python 3 issue linking to OpenSSL
- &py36_osx_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" PYENV_ROOT="${HOME}/.pyenv" PATH="${PYENV_ROOT}/shims:${PATH}"
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
@@ -206,9 +203,7 @@ py36_osx_test_config: &py36_osx_test_config
env:
# Must duplicate py36_osx_config's env because it cannot be merged into a new anchor
- &py36_osx_test_config_env >
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" PYENV_ROOT="${HOME}/.pyenv" PATH="${PYENV_ROOT}/shims:${PATH}"
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx

linux_with_fuse: &linux_with_fuse
@@ -463,11 +458,9 @@ py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include"
- PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" PYENV_ROOT="${HOME}/.pyenv" PATH="${PYENV_ROOT}/shims:${PATH}"

- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
- PYENV_ROOT="${HOME}/.pyenv"
- PATH="${PYENV_ROOT}/shims:${PATH}"
- RUN_PANTS_FROM_PEX=0
before_install:
- curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 -o /usr/local/bin/jq
@@ -0,0 +1 @@
PATH="/usr/local/opt/openssl/bin:$PATH" LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" PYENV_ROOT="${HOME}/.pyenv" PATH="${PYENV_ROOT}/shims:${PATH}"
@@ -31,7 +31,7 @@ def get_mustache_file(file_name):
template = get_mustache_file('travis.yml.mustache')
before_install_linux = get_mustache_file('before_install_linux.mustache')
before_install_osx = get_mustache_file('before_install_osx.mustache')
osx_openssl_env = get_mustache_file('osx_openssl_env.mustache')
env_osx_with_pyenv = get_mustache_file('env_osx_with_pyenv.mustache')

context = {
'header': HEADER,
@@ -45,6 +45,6 @@ def get_mustache_file(file_name):
renderer = pystache.Renderer(partials={
'before_install_linux': before_install_linux,
'before_install_osx': before_install_osx,
'osx_openssl_env': osx_openssl_env
'env_osx_with_pyenv': env_osx_with_pyenv
})
print(renderer.render(template, context))

This file was deleted.

Oops, something went wrong.
@@ -156,11 +156,8 @@ py36_osx_config: &py36_osx_config
packages: &py36_osx_config_brew_packages
- openssl
env:
# Fix Python 3 issue linking to OpenSSL
- &py36_osx_config_env >
{{>osx_openssl_env}}
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
{{>env_osx_with_pyenv}}
before_install:
{{>before_install_osx}}
# Clone pyenv directly from GitHub. For multiple osx images, brew's version of pyenv is too old to get
@@ -190,9 +187,7 @@ py36_osx_test_config: &py36_osx_test_config
env:
# Must duplicate py36_osx_config's env because it cannot be merged into a new anchor
- &py36_osx_test_config_env >
{{>osx_openssl_env}}
PYENV_ROOT="${HOME}/.pyenv"
PATH="${PYENV_ROOT}/shims:${PATH}"
{{>env_osx_with_pyenv}}
BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.osx
linux_with_fuse: &linux_with_fuse
@@ -442,10 +437,8 @@ py27_osx_build_wheels_ucs4: &py27_osx_build_wheels_ucs4
- *py27_osx_test_config_env
- *base_build_wheels_env
- CACHE_NAME=osxwheelsbuild.ucs4
- {{>osx_openssl_env}}
- {{>env_osx_with_pyenv}}
- PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4
- PYENV_ROOT="${HOME}/.pyenv"
- PATH="${PYENV_ROOT}/shims:${PATH}"
- RUN_PANTS_FROM_PEX=0
before_install:
{{>before_install_osx}}

0 comments on commit dc36d94

Please sign in to comment.
You can’t perform that action at this time.