-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
81 lines (61 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
SHELL := /bin/bash
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME = UnleashClient
.PHONY: sphinx
#-----------------------------------------------------------------------
# Rules of Rules : Grouped rules that _doathing_
#-----------------------------------------------------------------------
test: lint pytest specification-test
precommit: clean generate-requirements
build: clean build-package upload
build-local: clean build-package
docs: docker-docs-stop sphinx docker-docs
#-----------------------------------------------------------------------
# Install
#-----------------------------------------------------------------------
install:
pip install -U -r requirements.txt && \
pip install . && \
./scripts/get-spec.sh
install-docs: install
pip install -U -r requirements-docs.txt
#-----------------------------------------------------------------------
# Testing & Linting
#-----------------------------------------------------------------------
fmt:
black . && \
ruff UnleashClient tests --fix
lint:
black . --check && \
ruff check UnleashClient tests docs && \
mypy ${PROJECT_NAME} --install-types --non-interactive;
pytest:
export PYTHONPATH="${ROOT_DIR}:$$PYTHONPATH" && \
py.test tests/unit_tests
specification-test:
export PYTHONPATH="${ROOT_DIR}:$$PYTHONPATH" && \
py.test --no-cov tests/specification_tests
tox:
tox --parallel auto
#-----------------------------------------------------------------------
# Rules
#-----------------------------------------------------------------------
clean:
rm -rf build; \
rm -rf dist; \
rm -rf UnleashClient.egg-info;
build-package:
python -m build
upload:
twine upload dist/*
#-----------------------------------------------------------------------
# Docs
#-----------------------------------------------------------------------
docker-docs-stop:
docker stop unleash-docs | true
sphinx:
cd docs; \
rm -rf _build; \
make html;
docker-docs:
docker run -d --name unleash-docs --rm -v `pwd`/docs/_build/html:/web -p 8080:8080 halverneus/static-file-server:latest