-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
70 lines (51 loc) · 1.8 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
SHELL = /bin/bash
VENV_PATH = .venv
help:
@echo "Thanks for your interest in the Snuba SnQL SDK!"
@echo
@echo "make lint: Run linters"
@echo "make tests: Run tests"
@echo "make format: Run code formatters (destructive)"
@echo
@echo "Also make sure to read ./CONTRIBUTING.rst"
@false
.venv:
virtualenv -ppython3.11 $(VENV_PATH)
. $(VENV_PATH)/bin/activate
$(VENV_PATH)/bin/pip install -e . -r test-requirements.txt -r linter-requirements.txt
make install-dev: .venv
$(VENV_PATH)/bin/pip install -e . -r test-requirements.txt -r linter-requirements.txt
setup-git:
pip install 'pre-commit==3.6.0'
pre-commit install --install-hooks
dist: .venv
rm -rf dist build
$(VENV_PATH)/bin/python setup.py sdist bdist_wheel
.PHONY: dist
format: .venv
$(VENV_PATH)/bin/flake8 tests examples snuba_sdk
$(VENV_PATH)/bin/black tests examples snuba_sdk
$(VENV_PATH)/bin/isort snuba_sdk tests
$(VENV_PATH)/bin/mypy --config-file mypy.ini --strict tests examples snuba_sdk
.PHONY: format
tests: .venv
@$(VENV_PATH)/bin/pytest
.PHONY: tests
check: lint tests
.PHONY: check
lint: .venv
$(VENV_PATH)/bin/flake8 tests examples snuba_sdk
$(VENV_PATH)/bin/black --check tests examples snuba_sdk
$(VENV_PATH)/bin/isort --df snuba_sdk tests
$(VENV_PATH)/bin/mypy --config-file mypy.ini --strict tests examples snuba_sdk
.PHONY: lint
apidocs: .venv
$(VENV_PATH)/bin/pip install -U -r ./docs-requirements.txt
$(VENV_PATH)/bin/sphinx-build -W -b html docs/ docs/_build
apidocs-hotfix: apidocs
$(VENV_PATH)/bin/pip install ghp-import
$(VENV_PATH)/bin/ghp-import -pf docs/_build
.PHONY: apidocs-hotfix
make generate-pdocs: .venv
$(VENV_PATH)/bin/pip install -U -r ./docs-requirements.txt
$(VENV_PATH)/bin/pdoc -o docs/_html --search --logo "https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" snuba_sdk