This repository has been archived by the owner on Mar 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
language: python | ||
env: | ||
global: | ||
- SETUP_SCRIPT=setup-pyenv.sh | ||
matrix: | ||
include: | ||
# Without PyPy | ||
- python: "2.7" | ||
- python: '2.7' | ||
# Basic options | ||
- python: "pypy" | ||
env: PYPY_VERSION="5.3.1" | ||
- python: pypy | ||
env: PYENV_VERSION=pypy-5.4.1 PYENV_VERSION_STRING='PyPy 5.4.1' | ||
# Custom options | ||
- python: "pypy" | ||
env: PYPY_VERSION="5.3" PYENV_ROOT=$HOME/.pyenv-pypy PYENV_RELEASE=v20160629 PYTHON_BUILD_CACHE=$HOME/.pyenv-pypy-cache | ||
- python: pypy | ||
env: PYENV_VERSION=pypy-5.4.1 PYENV_VERSION_STRING='PyPy 5.4.1' PYENV_ROOT=$HOME/.pyenv-pypy PYENV_RELEASE=v1.0.2 PYTHON_BUILD_CACHE=$HOME/.pyenv-pypy-cache | ||
# Legacy setup-pypy.sh | ||
- python: pypy | ||
env: PYPY_VERSION=5.4.1 SETUP_SCRIPT=setup-pypy.sh | ||
|
||
cache: | ||
- pip | ||
- directories: | ||
- $HOME/.pyenv_cache | ||
|
||
script: | ||
- source setup-pypy.sh | ||
- source $SETUP_SCRIPT | ||
- python --version | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: ZbOjmIOmz3TsPFhM7U+RddpJxVJDfudHhKyr+ZIgc/xTDYuzGDD8VRkexpT3dGoDUpgve0SyHPeeg0Otq54mHaaig4RKQN+xDmBtFnbK+zlqjH9pM14p239wPfuMOksWIUzM15QqWe2DQoJ2BrcTdgP2EntNfJIshsoWK8EZADlqIflwLVSRNJ3qKCW+ScO+XI9CGavnKvm+J1/tBUfF8MyR4HGdFlUw17jzsdz0p5O/D7EM8VHqSGNMy6FtKkvnwuyK6gDgE8Y1o1luTDA6Ii1Qr9d0d1Oo23QIk7XxxLICnBZ+BuUIxr457TKQ1/G52J77xj7rmlo8ntdpY29I1cH8qxsyv2eUZskfO+Zvycgw/cVPkUVW24AiBT2s6cyifI56jIMircPaBGvvA/w0kbkUKAKKBsm49esgaQoxb+ewkxhNUXVo85P6IOG+vuOLiefKByOrDAYhRn8vgWwi51IBZlakjZpwP2x7Os9ffllBlRsQp4l2F6QzNVlkshJpBP7HeEl0HbWjnewmRYhmrnCpvQwI4jBFCrjMcFv763z2BNwTbfLVLZvXCKY4bQM4A/h9bdmt83OVwHqVE8sUuFs6/7iLXdfV+phSEWk/fjR9KA/pf49Jja1rzsqCS+SwPU1rr9M865RPm+1zy4ll2BnUde2o3g6kZEz5XAKl1Ig= | ||
file: setup-pypy.sh | ||
file: setup-pyenv.sh | ||
on: | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# NOTE: This script needs to be sourced so it can modify the environment. | ||
# | ||
# Environment variables that can be set: | ||
# - PYENV_VERSION | ||
# Python to install [required] | ||
# - PYENV_VERSION_STRING | ||
# String to `fgrep` against the output of `python --version` to validate | ||
# that the correct Python was installed (recommended) [default: none] | ||
# - PYENV_ROOT | ||
# Directory in which to install pyenv [default: ~/.pyenv] | ||
# - PYENV_RELEASE | ||
# Release tag of pyenv to download [default: clone from master] | ||
# - PYTHON_BUILD_CACHE_PATH: | ||
# Directory in which to cache PyPy builds [default: ~/.pyenv_cache] | ||
|
||
if [[ -z "$PYENV_VERSION" ]]; then | ||
echo "\$PYENV_VERSION is not set. Not installing a pyenv." | ||
return 0 | ||
fi | ||
|
||
# Get out of the virtualenv we're in. | ||
deactivate | ||
|
||
# Install pyenv | ||
PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}" | ||
if [[ -n "$PYENV_RELEASE" ]]; then | ||
# Fetch the release archive from Github (slightly faster than cloning) | ||
mkdir "$PYENV_ROOT" | ||
curl -fsSL "https://github.com/yyuu/pyenv/archive/$PYENV_RELEASE.tar.gz" \ | ||
| tar -xz -C "$PYENV_ROOT" --strip-components 1 | ||
else | ||
# Don't have a release to fetch, so just clone directly | ||
git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT" | ||
fi | ||
|
||
export PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
|
||
# Make sure the cache directory exists | ||
PYTHON_BUILD_CACHE_PATH="${PYTHON_BUILD_CACHE_PATH:-$HOME/.pyenv_cache}" | ||
mkdir -p "$PYTHON_BUILD_CACHE_PATH" | ||
|
||
# Install the pyenv | ||
pyenv install "$PYENV_VERSION" | ||
pyenv global "$PYENV_VERSION" | ||
|
||
# Make and source a new virtualenv | ||
VIRTUAL_ENV="$HOME/ve-pyenv-$PYENV_PYTHON" | ||
virtualenv -p "$(which python)" "$VIRTUAL_ENV" | ||
source "$VIRTUAL_ENV/bin/activate" | ||
|
||
if [[ -n "$PYENV_VERSION_STRING" ]]; then | ||
if ! python --version 2>&1 | fgrep "$PYENV_VERSION_STRING"; then | ||
echo "Failed to verify that the pyenv was properly installed." | ||
return 1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters