-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
67 lines (53 loc) · 1.89 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
install:
@echo Installing Project Dependencies
@python3 -m pip install -e .[dev]
@pre-commit install
@rm -rf ./.tox
.PHONY: docs clean license
docs:
@echo Generating SDK Documentation
@rm -rf docs/nitric
@pdoc3 -f --html -o docs nitric
clean:
@echo Cleaning Build Artefacts
@rm -rf ./.eggs
@rm -rf ./build
@rm -rf ./dist
test:
@echo Running Tox tests
@tox -e py
NITRIC_VERSION := 1.14.0
download-local:
@rm -r ./proto/nitric
@mkdir ./proto/nitric
@cp -r ${NITRIC_CORE_HOME}/nitric/proto ./proto/nitric
download:
@mkdir -p ./proto/
@curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/proto.tgz -o ./proto/nitric.tgz
@cd ./proto && tar xvzf nitric.tgz
@cd ../
@rm ./proto/nitric.tgz
OUTPUT="."
CONTRACTS="./proto"
grpc-client: install download generate-proto
generate-proto:
@echo Generating Proto Sources
@ rm -rf $(OUTPUT)/nitric/proto
@echo $(OUTPUT)
@mkdir -p $(OUTPUT)
@python3 -m grpc_tools.protoc -I $(CONTRACTS) --python_betterproto_out=$(OUTPUT) ./$(CONTRACTS)/nitric/proto/*/*/*.proto
@rm ./__init__.py
license:
@echo Applying Apache 2 header to source files
@licenseheaders -t tools/apache-2.tmpl -o "Nitric Technologies Pty Ltd" -y 2021 -n "Nitric Python 3 SDK" -u "https://github.com/nitrictech/python-sdk" -d nitric
@licenseheaders -t tools/apache-2.tmpl -o "Nitric Technologies Pty Ltd" -y 2021 -n "Nitric Python 3 SDK" -u "https://github.com/nitrictech/python-sdk" -d tests
@licenseheaders -t tools/apache-2.tmpl -o "Nitric Technologies Pty Ltd" -y 2021 -n "Nitric Python 3 SDK" -u "https://github.com/nitrictech/python-sdk" -d tools
build: clean grpc-client license docs
@echo Building sdist and wheel
@python3 setup.py sdist bdist_wheel
distribute: build
@echo Uploading to pypi
@python3 -m twine upload --repository pypi dist/*
distribute-test: build
@echo Uploading to testpypi
@python3 -m twine upload --repository testpypi dist/*