Use pipenv from the toolset

- Remove the forked copy of the toolset
- Stop installing `pipenv` in sdk/python/Makefile

After this, we'll require that you already have `pipenv` present
before building.
This commit is contained in:
Matt Ellis 2018-11-06 12:25:58 -08:00
parent c398e8ba80
commit adb0d9aee6
7 changed files with 11 additions and 154 deletions

View file

@ -16,15 +16,16 @@ sudo: true # give us 7.5GB and >2 bursted cores.
git:
depth: false
before_install:
- source ./build/travis/prepare-environment.sh
- if [ "${TRAVIS_SECURE_ENV_VARS:-}" = "true" ]; then source "${PULUMI_SCRIPTS}/ci/keep-failed-tests.sh"; fi
- git clone https://github.com/pulumi/scripts ${GOPATH}/src/github.com/pulumi/scripts
- source ${GOPATH}/src/github.com/pulumi/scripts/ci/prepare-environment.sh
- source ${PULUMI_SCRIPTS}/ci/keep-failed-tests.sh
install:
- source ./build/travis/install-common-toolchain.sh
- source ${PULUMI_SCRIPTS}/ci/install-common-toolchain.sh
before_script:
- ./build/travis/ensure-dependencies
- ${PULUMI_SCRIPTS}/ci/ensure-dependencies
script:
- make travis_${TRAVIS_EVENT_TYPE}
after_failure:
- if [ "${TRAVIS_SECURE_ENV_VARS:-}" = "true" ]; then "${PULUMI_SCRIPTS}/ci/upload-failed-tests"; fi
- ${PULUMI_SCRIPTS}/ci/upload-failed-tests
notifications:
webhooks: https://ufci1w66n3.execute-api.us-west-2.amazonaws.com/stage/travis

View file

@ -8,9 +8,9 @@ For larger features, we'd appreciate it if you open a [new issue](https://github
To hack on Pulumi, you'll need to get a development environment set up. You'll want to install the following on your machine:
- Go 1.9 or Later
- NodeJS 6.10.X or 8.11.X (LTS releases). Others may work, but there are [known issues using Node 10](https://github.com/pulumi/pulumi/issues/1270).
- Python 2.7.X
- Go 1.9 or later
- NodeJS 6.10.X or later
- Python 3.6 or later
- [pipenv](https://github.com/pypa/pipenv)
- [dep](https://github.com/golang/dep)
- [Gometalinter](https://github.com/alecthomas/gometalinter)
@ -21,7 +21,7 @@ To hack on Pulumi, you'll need to get a development environment set up. You'll w
You can easily get all required dependencies with brew
```bash
brew install node pipenv python@2 typescript dep yarn pandoc
brew install node pipenv python@3 typescript dep yarn pandoc
```
## Make build system

View file

@ -1,8 +0,0 @@
YARN_VERSION="1.3.2"
DEP_VERSION="0.4.1"
GOMETALINTER_VERSION="2.0.3"
PIP_VERSION="10.0.0"
VIRTUALENV_VERSION="15.2.0"
AWSCLI_VERSION="1.14.30"
WHEEL_VERSION="0.30.0"
TWINE_VERSION="1.9.1"

View file

@ -1,12 +0,0 @@
#!/bin/bash
set -o nounset -o errexit -o pipefail
# Run our target to dep ensure and yarn install everything
make ensure
# Ensure the working tree is clean (make ensure may have updated lock files)
$(go env GOPATH)/src/github.com/pulumi/scripts/ci/check-worktree-is-clean.sh
# Set stdout back to blocking to avoid problems writing large outputs.
# https://github.com/travis-ci/travis-ci/issues/4704
python -c 'import fcntl, os, sys; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); print("stdout was " + ("nonblocking" if flags & os.O_NONBLOCK else "blocking")); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)'

View file

@ -1,89 +0,0 @@
nvm install ${NODE_VERSION-v8.11.1}
# Travis sources this script, so we can export variables into the
# outer shell, so we don't want to set options like nounset because
# they would be set in the outer shell as well, so do as much logic as
# we can in a subshell.
(
set -o errexit -o pipefail
[ -e "$(go env GOPATH)/bin" ] || mkdir -p "$(go env GOPATH)/bin"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
. ${DIR}/../tool-versions.sh
OS=""
case $(uname) in
"Linux") OS="linux";;
"Darwin") OS="darwin";;
*) echo "error: unknown host os $(uname)" ; exit 1;;
esac
# Tool installs and workarounds specific to macOS.
if [ "${TRAVIS_OS_NAME:-}" = "osx" ]; then
brew install jq
# On Travis, pip is called pip2.7, so alias it.
if [ ! -f /usr/local/bin/pip ]; then
sudo ln -s $(which pip2.7) /usr/local/bin/pip
fi
fi
echo "installing yarn ${YARN_VERSION}"
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}
echo "installing dep ${DEP_VERSION}"
curl -L -o "$(go env GOPATH)/bin/dep" https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-${OS}-amd64
chmod +x "$(go env GOPATH)/bin/dep"
echo "installing Gometalinter ${GOMETALINTER_VERSION}"
curl -L "https://github.com/alecthomas/gometalinter/releases/download/v${GOMETALINTER_VERSION}/gometalinter-v${GOMETALINTER_VERSION}-${OS}-amd64.tar.bz2" | tar -jxv --strip-components=1 -C "$(go env GOPATH)/bin"
chmod +x "$(go env GOPATH)/bin/gometalinter"
chmod +x "$(go env GOPATH)/bin/linters/"*
# Gometalinter looks for linters on the $PATH, so let's move them out
# of the linters folder and into GOBIN (which we know is on the $PATH)
mv "$(go env GOPATH)/bin/linters/"* "$(go env GOPATH)/bin/."
rm -rf "$(go env GOPATH)/bin/linters/"
echo "installing gocovmerge"
# gocovmerge does not publish versioned releases, but it also hasn't been updated in two years, so
# getting HEAD is pretty safe.
go get -v github.com/wadey/gocovmerge
echo "upgrading Pip to ${PIP_VERSION}"
sudo pip install --upgrade "pip>=${PIP_VERSION}"
pip install --user --upgrade "pip>=${PIP_VERSION}"
echo "installing virtualenv ${VIRTUALENV_VERSION}"
sudo pip install "virtualenv==${VIRTUALENV_VERSION}"
pip install --user "virtualenv==${VIRTUALENV_VERSION}"
echo "installing AWS cli ${AWSCLI_VERSION}"
pip install --user "awscli==${AWSCLI_VERSION}"
echo "installing Wheel and Twine, so we can publish Python packages"
pip install --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}"
echo "installing pandoc, so we can generate README.rst for Python packages"
if [ "${TRAVIS_OS_NAME:-}" = "linux" ]; then
sudo apt-get update
sudo apt-get install pandoc
else
brew install pandoc
fi
)
# If the sub shell failed, bail out now.
[ "$?" -eq 0 ] || exit 1
# By default some tools are not on the PATH, let's fix that
# On OSX, the user folder that `pip` installs tools to is not on the
# $PATH by default.
if [ "${TRAVIS_OS_NAME:-}" = "osx" ]; then
export PATH=$PATH:$HOME/Library/Python/2.7/bin
fi
# Add yarn to the $PATH
export PATH=$HOME/.yarn/bin:$PATH

View file

@ -1,27 +0,0 @@
# Travis sources this script, so we can export variables into the
# outer shell, so we don't want to set options like nounset because
# they would be set in the outer shell as well, so do as much logic as
# we can in a subshell.
export PULUMI_SCRIPTS="$(go env GOPATH)/src/github.com/pulumi/scripts"
(
set -o nounset -o errexit -o pipefail
if [ "${TRAVIS_OS_NAME:-}" = "osx" ]; then
sudo mkdir /opt/pulumi
sudo chown "${USER}" /opt/pulumi
fi
git clone https://github.com/pulumi/scripts "${PULUMI_SCRIPTS}"
# If we have an NPM token, put it in the .npmrc file, so we can use it:
if [ ! -z "${NPM_TOKEN:-}" ]; then
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc
fi
# Put static entries for Pulumi backends in /etc/hosts
"${PULUMI_SCRIPTS}/ci/pulumi-hosts" | sudo tee -a /etc/hosts
) || exit 1 # Abort outer script if subshell fails.
export PULUMI_ROOT=/opt/pulumi

View file

@ -10,13 +10,6 @@ ifeq ($(PIP),)
PIP := pip
endif
ifneq ($(PYTHON_2),)
PIPENV_PYTHON_VERSION := --two
else
PIPENV_PYTHON_VERSION := --three
endif
PIPENV_VERSION := 2018.05.18
PYENV := ./env
PYENVSRC := $(PYENV)/src
@ -26,8 +19,7 @@ GOMETALINTER := ${GOMETALINTERBIN} --config=../../Gometalinter.json
include ../../build/common.mk
ensure::
$(PIP) install pipenv==$(PIPENV_VERSION) --user
pipenv $(PIPENV_PYTHON_VERSION) install --dev
pipenv --python 3 install --dev
mkdir -p $(PYENVSRC)
build_package::