-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
31 lines (23 loc) · 1016 Bytes
/
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
PROJECT_NAME := Pulumi Policy Python SDK
VERSION := $(shell cd ../../ && pulumictl get version)
PYPI_VERSION := $(shell cd ../../ && pulumictl get version --language python)
PYENV := ./env
PYENVSRC := $(PYENV)/src
PYENVSRCLIB := $(PYENVSRC)/pulumi_policy
include ../../build/common.mk
ensure::
pipenv --python 3 install --dev
mkdir -p $(PYENVSRC)
build::
rm -rf $(PYENVSRC) && cp -R ./lib/. $(PYENVSRC)/
sed -i.bak 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' $(PYENVSRC)/setup.py && rm $(PYENVSRC)/setup.py.bak
sed -i.bak 's/^VERSION = .*/VERSION = "$(VERSION)"/g' $(PYENVSRCLIB)/version.py && rm $(PYENVSRCLIB)/version.py.bak
cp ../../README.md $(PYENVSRC)
cd $(PYENVSRC) && pipenv run python setup.py build bdist_wheel --universal
lint::
pipenv run mypy ./lib/pulumi_policy --config-file=mypy.ini
pipenv run pylint ./lib/pulumi_policy --rcfile=.pylintrc
test_fast::
pipenv run pip install ./env/src
pipenv run python -m unittest discover -s lib/test -v
test_all:: test_fast