forked from pulumi/pulumi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROJECT_NAME := Pulumi Python SDK
LANGHOST_PKG := github.com/pulumi/pulumi/sdk/python/cmd/pulumi-language-python
VERSION := $(shell ../../scripts/get-py-version)
PYENV := ./env
PYENVSRC := $(PYENV)/src
include ../../build/common.mk
ensure::
pipenv --python 3 install --dev
mkdir -p $(PYENVSRC)
build_package::
rm -rf $(PYENVSRC) && cp -R ./lib/. $(PYENVSRC)/
sed -i.bak "s/\$${VERSION}/$(VERSION)/g" $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
cp ../../README.md $(PYENVSRC)
cd $(PYENVSRC) && pipenv run python setup.py build bdist_wheel --universal
build_plugin::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/python/pkg/version.Version=${VERSION}" ${LANGHOST_PKG}
build:: build_package build_plugin
lint::
pipenv run pylint ./lib/pulumi --rcfile=.pylintrc
golangci-lint run
install_package::
cp ./cmd/pulumi-language-python-exec "$(PULUMI_BIN)"
cp ./dist/pulumi-resource-pulumi-python "$(PULUMI_BIN)"
install_plugin::
GOBIN=$(PULUMI_BIN) go install \
-ldflags "-X github.com/pulumi/pulumi/sdk/python/pkg/version.Version=${VERSION}" ${LANGHOST_PKG}
install:: install_package install_plugin
test_fast::
pipenv run pip install ./env/src
pipenv run python -m unittest discover -s lib/test -v
test_all:: test_fast
dist::
go install -ldflags "-X github.com/pulumi/pulumi/sdk/python/pkg/version.Version=${VERSION}" ${LANGHOST_PKG}
cp ./cmd/pulumi-language-python-exec "$$(go env GOPATH)"/bin/
cp ./dist/pulumi-resource-pulumi-python "$$(go env GOPATH)"/bin/