-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
90 lines (69 loc) · 2.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.PHONY: build thrift lint docs dist inc-version publish sample-app \
test test-util test-runtime test-opentracing \
default
default: test
build:
echo "Nothing to build"
check-virtual-env:
@echo virtual-env: $${VIRTUAL_ENV?"Please run in virtual-env"}
bootstrap: check-virtual-env
pip install -r requirements.txt
pip install -r requirements-test.txt
python setup.py develop
lint:
pylint -r n --disable=invalid-name,global-statement,bare-except \
lightstep/tracer.py lightstep/constants.py lightstep/recorder.py
docs:
cd docs && make html
dist: build docs inc-version
mkdir -p dist
rm -rf dist
python setup.py sdist # source distribution
python setup.py bdist_wheel
# TODO: There's inelegant dependency on Node.js here
inc-version: scripts/node_modules
node scripts/inc_version.js
git tag `cat VERSION`
scripts/node_modules:
cd scripts && npm update
publish: dist
@if [ $(shell git symbolic-ref --short -q HEAD) = "master" ]; then exit 0; else \
echo "Current git branch does not appear to be 'master'. Refusing to publish."; exit 1; \
fi
git add VERSION lightstep/version.py setup.py CHANGELOG.md
git commit -m "Updating Version to `cat VERSION`"
git push
git push --tags
twine upload dist/*
example: build
python examples/trivial/main.py
test27: build
tox -e py27
test34: build
tox -e py34
test35: build
tox -e py35
test36: build
tox -e py36
test37: build
tox -e py37
test38: build
tox -e py38
test: build
tox
# LightStep-specific: rebuilds the LightStep protobuf files.
proto:
protoc --proto_path "$(PWD)/../googleapis:$(PWD)/../lightstep-tracer-common/" \
--python_out="$(PWD)/lightstep" \
collector.proto
thrift:
docker run -v "$(PWD)/lightstep:/out" -v "$(MONO_REPO)/go/src/github.com/lightstep/common-go:/data" --rm thrift:0.13.0 \
thrift -r --gen py -out /out /data/crouton.thrift
python-modernize -w $(PWD)/lightstep/crouton/
rm -rf lightstep/crouton/ReportingService-remote
clean:
find . -name '__pycache__' -exec rm -R {} +
find . -name '*.pyc' -exec rm {} +
rm -Rf ./*.egg-info
rm -Rf ./dist/
rm -Rf ./build/