-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
105 lines (83 loc) · 2.18 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
DEV_VENV?=""
VERSION?=""
.PHONY: install-poetry
install-poetry:
pip install poetry==1.5.1
poetry config installer.max-workers 1
.PHONY: install-tox
install-tox:
pip install tox==3.24.3 tox-factor==0.1.2
.PHONY: install-setuptools
install-setuptools:
python -m pip install --upgrade pip setuptools wheel
.PHONY: install-tools
install-tools: install-setuptools install-poetry install-tox
.PHONY: deps
deps:
poetry install --extras all
.PHONY: clean
clean:
@rm -rf dist
@rm -rf dev
@rm -rf splunk_opentelemetry.egg-info
.PHONY: develop
develop:
ifeq ($(DEV_VENV),"")
@echo "Usage: make develop DEV_ENV=~/path/to/dev/project/venv"
else
$(DEV_VENV)/bin/pip uninstall splunk-opentelemetry --yes
. $(DEV_VENV)/bin/activate && poetry install --no-dev --extras all
endif
.PHONY: build
build:
poetry build
.PHONY: publish
publish:
poetry publish
.PHONY: isort-check
isort-check:
poetry run isort --profile black --diff --check-only ./splunk_otel ./tests
.PHONY: black-check
black-check:
poetry run black --diff --check ./splunk_otel ./tests/
.PHONY: pylint
pylint:
poetry run pylint ./splunk_otel ./tests/ ./scripts/
.PHONY: flake8
flake8:
poetry run flake8 ./splunk_otel ./tests/ ./scripts/
.PHONY: lint
lint: isort-check black-check flake8 pylint
.PHONY: mypy
mypy:
poetry run mypy --namespace-packages --show-error-codes splunk_otel/
.PHONY: fmt
fmt: isort black
.PHONY: black
black:
poetry run black splunk_otel tests scripts
.PHONY: isort
isort:
poetry run isort --profile black ./splunk_otel ./tests ./scripts
.PHONY: test
test:
poetry run pytest tests/unit
.PHONY: integration
integration:
poetry run pytest tests/integration
.PHONY: test-with-cov
test-with-cov:
poetry run coverage erase
poetry run pytest --cov splunk_otel --cov-append --cov-branch --cov-report='' --junit-xml=test_results/results.xml tests/unit/
poetry run coverage report --show-missing
poetry run coverage xml
.PHONY: prepare-release
prepare-release:
ifeq ($(VERSION),"")
@echo "Usage: make prepare-release VERSION=<version_number>"
else
git checkout -B release/v$(VERSION)
poetry run python scripts/prepare_release.py --version $(VERSION)
git add -A .
git commit -m"Preparing release v$(VERSION)" -S
endif