Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Use Python 3 Explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
marns93 committed Sep 23, 2019
1 parent 7d687de commit 54da9b6
Showing 1 changed file with 5 additions and 38 deletions.
43 changes: 5 additions & 38 deletions build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -104,49 +104,16 @@ endif
PULUMI_BIN := $(PULUMI_ROOT)/bin
PULUMI_NODE_MODULES := $(PULUMI_ROOT)/node_modules

GO_TEST_FAST = go test -short -v -count=1 -cover -timeout 1h -parallel ${TESTPARALLELISM}
GO_TEST = go test -v -count=1 -cover -timeout 1h -parallel ${TESTPARALLELISM}
GO_TEST_FAST = go test -short -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM}
GO_TEST = go test -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM}

.PHONY: default all ensure only_build only_test build lint install test_all core

# ensure that `default` is the target that is run when no arguments are passed to make
default::

# Ensure the requisite tools are on the PATH.
# - Prefer Python2 over Python.
PYTHON := $(shell command -v python2 2>/dev/null)
ifeq ($(PYTHON),)
PYTHON = $(shell command -v python 2>/dev/null)
endif
ifeq ($(PYTHON),)
ensure::
$(error "missing python 2.7 (`python2` or `python`) from your $$PATH; \
please see https://github.com/pulumi/home/wiki/Package-Management-Prerequisites")
else
PYTHON_VERSION := $(shell command $(PYTHON) --version 2>&1)
ifeq (,$(findstring 2.7,$(PYTHON_VERSION)))
ensure::
$(error "$(PYTHON) did not report a 2.7 version number ($(PYTHON_VERSION)); \
please see https://github.com/pulumi/home/wiki/Package-Management-Prerequisites")
endif
endif
# - Prefer Pip2 over Pip.
PIP := $(shell command -v pip2 2>/dev/null)
ifeq ($(PIP),)
PIP = $(shell command -v pip 2>/dev/null)
endif
ifeq ($(PIP),)
ensure::
$(error "missing pip 2.7 (`pip2` or `pip`) from your $$PATH; \
please see https://github.com/pulumi/home/wiki/Package-Management-Prerequisites")
else
PIP_VERSION := $(shell command $(PIP) --version 2>&1)
ifeq (,$(findstring python 2.7,$(PIP_VERSION)))
ensure::
$(error "$(PIP) did not report a 2.7 version number ($(PIP_VERSION)); \
please see https://github.com/pulumi/home/wiki/Package-Management-Prerequisites")
endif
endif
PYTHON ?= python3
PIP ?= pip3

# If there are sub projects, our default, all, and ensure targets will
# recurse into them.
Expand Down Expand Up @@ -181,7 +148,7 @@ all:: build install lint test_all
ensure::
$(call STEP_MESSAGE)
@if [ -e 'Gopkg.toml' ]; then echo "dep ensure -v"; dep ensure -v; \
elif [ -e 'go.mod' ]; then echo "GO111MODULE=on go mod vendor"; GO111MODULE=on go mod vendor; gomod-doccopy -provider terraform-provider-$(TF_NAME); fi
elif [ -e 'go.mod' ]; then echo "GO111MODULE=on go mod vendor"; GO111MODULE=on go mod vendor; gomod-doccopy -provider terraform-provider-$(PACK); fi
@if [ -e 'package.json' ]; then echo "yarn install"; yarn install; fi

build::
Expand Down

0 comments on commit 54da9b6

Please sign in to comment.