Makefile 2.1 KB
Newer Older
K
kezhenxu94 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

17 18
VERSION ?= latest

K
kezhenxu94 已提交
19 20 21 22 23 24
.PHONY: license

setup:
	python3 -m pip install --upgrade pip
	python3 -m pip install grpcio --ignore-installed

25 26 27
setup-test: setup
	pip3 install -e .[test]

K
kezhenxu94 已提交
28
gen:
29
	python3 -m grpc_tools.protoc --version || python3 -m pip install grpcio-tools
30
	python3 tools/codegen.py
K
kezhenxu94 已提交
31

K
kezhenxu94 已提交
32
lint: clean
33
	flake8 --version || python3 -m pip install flake8
34 35
	flake8 . --count --select=E9,F63,F7,F82 --show-source
	flake8 . --count --max-complexity=12 --max-line-length=120
K
kezhenxu94 已提交
36

37
license: clean
K
kezhenxu94 已提交
38 39
	python3 tools/check-license-header.py skywalking tests tools

40
test: gen setup-test
41
	python3 -m pytest -v tests
K
kezhenxu94 已提交
42

K
kezhenxu94 已提交
43 44 45
install: gen
	python3 setup.py install --force

46 47 48
package: clean gen
	python3 setup.py sdist bdist_wheel

49 50 51
upload-test: package
	twine upload --repository-url https://test.pypi.org/legacy/ dist/*

52 53 54
upload: package
	twine upload dist/*

K
kezhenxu94 已提交
55
clean:
56 57
	rm -rf skywalking/protocol
	rm -rf apache_skywalking.egg-info dist build
58 59
	rm -rf skywalking-python*.tgz*
	find . -name "__pycache__" -exec rm -r {} +
60
	find . -name ".pytest_cache" -exec rm -r {} +
61 62 63 64 65 66
	find . -name "*.pyc" -exec rm -r {} +

release: clean lint license
	-tar -zcvf skywalking-python-src-$(VERSION).tgz *
	gpg --batch --yes --armor --detach-sig skywalking-python-src-$(VERSION).tgz
	shasum -a 512 skywalking-python-src-$(VERSION).tgz > skywalking-python-src-$(VERSION).tgz.tgz.sha512